Last reviewed on: 15/04/2025
Provides API endpoints that enable clients to create and manage Tasks in the CFT Task Database.
All requests to Task Management will check the requester has the appropriate permissions to access the Task resource they are interacting with. If the required permissions are not present then the request will not be fulfilled.
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
To perform appropriate checks with the build:
./gradlew check
- The Task Management minikube local environment will be required to run the application fully.
- If minikube is running follow the README in https://github.com/hmcts/wa-kube-environment
- If you are running minikube with Apple silicone with ARM Architecture e.g. m1-4 make sure to set the environment with the below command
export environment=local-arm-arch
- 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-environment map environment variables
echo $OPEN_ID_IDAM_URL
source .env
- Switch on logical replication running with the following environment variable:
export SPRING_PROFILES_ACTIVE=replica;
-
You can either run as Java Application from your IDE or use gradle:
./gradlew clean bootRun
-
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 Authorization 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 integration tests you must have Docker running on your machine.
-
To run integration tests, you can run the command:
./gradlew integration
-
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
- Your minikube environment should be running correctly.
- WA CCD definition should be uploaded into your CCD environment: https://github.com/hmcts/wa-ccd-definitions
- Ensure wa_workflow_api is running: https://github.com/hmcts/wa-workflow-api
- Make sure the BPMN and DMN are deployed onto Camunda locally which should have been completed with the minikube setup steps.
- WA BPMN project is wa-standalone-task-bpmn: https://github.com/hmcts/wa-standalone-task-bpmn
- WA DMN project is wa-task-configuration-template: https://github.com/hmcts/wa-task-configuration-template
-
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
This project is licensed under the MIT License - see the LICENSE file for details