Giter Club home page Giter Club logo

hmcts.rd-caseworker-ref-api's Introduction

rd-caseworker-ref-api

CaseWorker Ref API

Purpose

Provides Case worker user profile data to clients, implemented as a Java/SpringBoot application.

Prerequisites

To run the project you will need to have the following installed:

  • Java 11
  • Docker

For information about the software versions used to build this API and a complete list of it's dependencies see build.gradle

Running the application

To run the API quickly use the docker helper script as follows:

./bin/run-in-docker.sh install

or

docker-compose up

Alternatively, you can start the application from the current source files using Gradle as follows:

./gradlew clean bootRun

If required, to run with a low memory consumption, the following can be used:

./gradlew --no-daemon assemble && java -Xmx384m -jar build/libs/rd-case-worker-api.jar

Using the application

To understand if the application is working, you can call it's health endpoint:

curl http://localhost:8091/health

If the API is running, you should see this response:

{"status":"UP"}

DB Initialisation˙

The application uses a Postgres database which can be run through a docker container on its own if required.

this

The application should automatically apply any database migrations using flyway.

Running integration tests:

You can run the integration tests as follows:

./gradlew integration

Running functional tests:

If the API is running (either inside a Docker container or via gradle bootRun) you can run the functional tests as follows:

./gradlew functional

If you want to run a specific scenario use this command:

./gradlew functional --tests <TestClassName> --info -Dscenario=<Scenario>

Running smoke tests:

If the API is running (either inside a Docker container or via gradle bootRun) you can run the smoke tests as follows:

./gradlew smoke

Running mutation tests tests:

If you have some time to spare, you can run the mutation tests as follows:

./gradlew pitest

As the project grows, these tests will take longer and longer to execute but are useful indicators of the quality of the test suite.

More information about mutation testing can be found here: http://pitest.org/

Testing in Postman

To test in Postman the easiest way is to start this service using the ./bin/run-in-docker.sh script. The in postman paste the following script:

pm.sendRequest('http://127.0.0.1:8089/token', function (err, res) {
    if (err) {
        console.log(err);
    } else {
        pm.environment.set("token", res.text());
    }
});

into the pre-script window. Also add a header as follows:

ServiceAuthorization: Bearer {{token}}

Authorization : Bearer copy IDAM access token

Contract testing with pact

Please refer to the confluence on how to run and publish PACT tests. https://tools.hmcts.net/confluence/display/RTRD/PACT+testing

hmcts.rd-caseworker-ref-api's People

Contributors

abhijitdiwan avatar adilhmcts avatar conorh994 avatar dependabot-preview[bot] avatar hmcts-jenkins-rd[bot] avatar ishratt avatar kotlapra23 avatar mallikarjunputtana avatar nitishsingla1234 avatar pksaxena01 avatar ruban72 avatar shashank-rastogi avatar shreedhar-hmcts avatar sujeethkumarari avatar timja avatar vijayrajagopalan-hmcts avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.