Provides API endpoints that enable clients manage Tasks in the Camunda Task Database.
The general approach and interaction with Access Management is depicted below. The search endpoints has some slight differences but are similar.
Since Spring Boot 2.1 bean overriding is disabled. If you want to enable it you will need to
set spring.main.allow-bean-definition-overriding
to true
.
JUnit 5 is now enabled by default in the project. Please refrain from using JUnit4 and use the next generation
The project uses Gradle as a build tool. It already contains
./gradlew
wrapper script, so there's no need to install gradle.
To build the project execute the following command:
./gradlew build
This will do compilation, checkstyle, PMD checks , run tests , but not integration or functional tests.
-
Prerequisite:
- Check if services are running in minikube, if not follow the README in https://github.com/hmcts/wa-kube-environment
- Check if minikube IP is set as environment variable.
You should see the ip and port as output, eg: http://192.168.64.14:30196. If you do not see, then from your wa-kube-enviroment map environment variables
echo $OPEN_ID_IDAM_URL
source .env
-
You can either run as Java Application from run configurations or
./gradlew clean bootRun
- Before running the wa-task-management-application with the above command, If you want to run the application with profile replication make sure to set the spring-profile with the below command
And if you are running minikube with mac m1, m2 chips with ARM Architecture make sure to set the environment with the below command
export SPRING_PROFILES_ACTIVE=replica;
export environment=local-arm-arch
- Before running the wa-task-management-application with the above command, If you want to run the application with profile replication make sure to set the spring-profile with the below command
-
In order to test if the application is up, you can call its health endpoint:
curl http://localhost:8087/health
You should get a response similar to this:
{"status":"UP","diskSpace":{"status":"UP","total":249644974080,"free":137188298752,"threshold":10485760}}
-
To access any service endpoint, you must set headers Service Authorization, Authorization
- To set Service Authorization header, from wa-kube-environment Goto wa-kube-environment/scripts/actions
and execute command
The command will generate a long token prefixed with your name. Copy the token till the name and set in Service Authorization header Service Authorization: Bearer 'your token'
./idam-service-token.sh wa_task_management_api
- To set Authorization header, from the same path execute command
The command should generate a long token, copy the whole token and set in Authoirization header Authorization: Bearer 'your token' Note: if the command returns null, then make sure the environment variable is set and you have sourced the environment variables.
./idam-user-token.sh "${TEST_CASEOFFICER_USERNAME}" "${TEST_CASEOFFICER_PASSWORD}"
- To set Service Authorization header, from wa-kube-environment Goto wa-kube-environment/scripts/actions
and execute command
-
To run all functional tests or single test you can run as Junit, make sure the env is set
OPEN_ID_IDAM_URL=http://'minikubeIP:port' Using simulator: OPEN_ID_IDAM_URL=http://sidam-simulator
Note: Make sure the BPMN and DMN are deployed onto Camunda locally.
-
BPMN project is wa-standalone-task-bpmn DMN project is wa-task-configuration-template Services wa_workflow_api should be running. And WA Case Type CCD definition from wa-ccd-definitions is uploaded as well.
-
To run integration tests docker should be running.
-
To run all tests including junit, integration and functional. You can run the command
./gradlew test integration functional
or
./gradlew tests
You can run contract or pact tests as follows:
./gradlew contract
You can then publish your pact tests locally by first running the pact docker-compose:
docker-compose -f docker-pactbroker-compose.yml up
and then using it to publish your tests:
./gradlew pactPublish
To trigger the replication code you will have to run the code with the following env var
export SPRING_PROFILES_ACTIVE=replica
This project is licensed under the MIT License - see the LICENSE file for details