Skip to content

hmcts/wa-task-management-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Task Management API

GitHub branch status Codecov

License: MIT

Last reviewed on: 15/04/2025

What does this app do?

Provides API endpoints that enable clients to create and manage Tasks in the CFT Task Database.

task-management

Access Management Process

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.

task-management

Building and deploying the application

Building the application

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

Running the application

Prerequisites:

  • 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.
    echo $OPEN_ID_IDAM_URL
    
    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
    source .env
    

Logical Replication:

  • Switch on logical replication running with the following environment variable:
    export SPRING_PROFILES_ACTIVE=replica;
    

Run:

  • 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
       ./idam-service-token.sh wa_task_management_api
      
      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'
    • To set Authorization header, from the same path execute command
       ./idam-user-token.sh "${TEST_CASEOFFICER_USERNAME}" "${TEST_CASEOFFICER_PASSWORD}"
      
      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.

Run tests

  • 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
    
  • To run all tests including junit, integration and functional. You can run the command

        ./gradlew test integration functional
    

    or

    ./gradlew tests
    

Running contract or pact 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

License

This project is licensed under the MIT License - see the LICENSE file for details

About

Work Allocation Task management api

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages