Coder Social home page Coder Social logo

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.

for more Info about the CaseWorker, Please refer to the confluence

Architecture of the Caseworker (https://tools.hmcts.net/confluence/pages/viewpage.action?pageId=1444742328) and

Business of the CaseWorker (https://tools.hmcts.net/confluence/display/RTRD/Caseworker+Reference+Data)

Prerequisites

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

  • Java 17
  • Docker

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

While not essential, it is highly recommended to use the pre-push git hook included in this repository to ensure that all tests are passing. This can be done by running the following command: $ git config core.hooksPath .githooks

Environment Vars

If running locally for development or testing you will need to set the following environment variables

  • export POSTGRES_USERNAME=dbrefdata
  • export POSTGRES_PASSWORD=
  • export client-secret=
  • export totp_secret=
  • export password=
  • export key=

Running the application

Please Make sure you are connected to the VPN before running the Application. (https://portal.platform.hmcts.net/vdesk/webtop.eui?webtop=/Common/webtop_full&webtop_type=webtop_full)

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

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

or

docker-compose up

After, 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:8095/health

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

{"status":"UP"}

If the API is running, you can see API's in swagger :

http://localhost:8095/swagger-ui.html

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:8095/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

To publish against remote broker: ./gradlew pactPublish

Turn on VPN and verify on url https://pact-broker.platform.hmcts.net/ The pact contract(s) should be published

To publish against local broker: Uncomment out the line found in the build.gradle: pactBrokerUrl = 'http://localhost:9292' comment out the real broker

Start the docker container from the root dir run docker-compose -f broker-compose.yml up

Publish via the gradle command ./gradlew pactPublish

Once Verify on url http://localhost:9292/ The pact contract(s) should be published

Remember to return the localhost back to the remote broker

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

rd-caseworker-ref-api's People

Contributors

abhijitdiwan avatar adilhmcts avatar arshinsalim avatar conorh994 avatar dependabot-preview[bot] avatar dpmatheson avatar fiyin-cgi avatar github-actions[bot] avatar hmcts-jenkins-rd[bot] avatar ishratt avatar jackbraceycgi avatar kiran-yenigala-hmcts avatar kotlapra23 avatar lukasz-wolski avatar lukehalsall avatar manishparyani avatar manukundloo-hmcts avatar nayeemshaik-hmcts avatar nitishsingla1234 avatar pksaxena01 avatar prudhvi-maddineni avatar renovate[bot] avatar ruban72 avatar sabinahmcts avatar sahitya-desireddy avatar shivajihmcts avatar shreedhar-hmcts avatar sujeethkumarari avatar vijayrajagopalan-hmcts avatar vilasshelke-hmcts avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rd-caseworker-ref-api's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Rate-Limited

These updates are currently rate-limited. Click on a checkbox below to force their creation now.

  • Update dependency ch.qos.logback:logback-classic to v1.5.8
  • Update dependency ch.qos.logback:logback-core to v1.5.8
  • Update dependency com.azure:azure-messaging-servicebus to v7.17.3
  • Update dependency hashicorp/terraform to v1.9.6
  • Update dependency org.postgresql:postgresql to v42.7.4
  • Update org.apache.tomcat.embed:9.0.93 to v9.0.95 (org.apache.tomcat.embed:tomcat-embed-websocket, org.apache.tomcat.embed:tomcat-embed-el, org.apache.tomcat.embed:tomcat-embed-core)
  • Update dependency com.azure:azure-core to v1.52.0
  • Update dependency com.fasterxml.jackson.core:jackson-databind to v2.17.2
  • Update dependency com.nimbusds:nimbus-jose-jwt to v9.41.1
  • Update dependency commons-io:commons-io to v2.17.0
  • Update dependency gradle to v8.10.1
  • Update dependency info.solidsoft.gradle.pitest:gradle-pitest-plugin to v1.15.0
  • Update dependency io.jsonwebtoken:jjwt to v0.12.6
  • Update dependency net.minidev:json-smart to v2.5.1
  • Update dependency org.apache.commons:commons-compress to v1.27.1
  • Update dependency org.bouncycastle:bcpkix-jdk18on to v1.78.1
  • Update dependency org.pitest:pitest to v1.17.0
  • Update dependency org.springdoc:springdoc-openapi-ui to v1.8.0
  • Update dependency org.springframework.security:spring-security-core to v5.8.14
  • Update dependency pmd to v6.55.0
  • Update feign monorepo (io.github.openfeign:feign-jackson, io.github.openfeign:feign-httpclient)
  • Update flyway to v10.18.0 (org.flywaydb:flyway-database-postgresql, org.flywaydb:flyway-core, org.flywaydb.flyway)
  • Update junit5 monorepo to v5.11.0 (org.junit.jupiter:junit-jupiter-engine, org.junit.jupiter:junit-jupiter-api)
  • Update log4j2 monorepo to v2.24.0 (org.apache.logging.log4j:log4j-core, org.apache.logging.log4j:log4j-to-slf4j, org.apache.logging.log4j:log4j, org.apache.logging.log4j:log4j-api)
  • Update mockito monorepo to v4.11.0 (org.mockito:mockito-junit-jupiter, org.mockito:mockito-inline, org.mockito:mockito-core)
  • Update plugin au.com.dius.pact to v4.6.14
  • Update plugin com.github.ben-manes.versions to v0.51.0
  • Update plugin org.sonarqube to v5.1.0.4882
  • Update testcontainers-java monorepo to v1.20.1 (org.testcontainers:testcontainers, org.testcontainers:junit-jupiter, org.testcontainers:postgresql)
  • Update versions.jackson to v2.17.2 (com.fasterxml.jackson.core:jackson-annotations, com.fasterxml.jackson.core:jackson-core, com.fasterxml.jackson.datatype:jackson-datatype-jsr310)
  • Update versions.logback to v1.5.8 (ch.qos.logback:logback-classic, ch.qos.logback:logback-core)
  • Update versions.restAssured to v4.5.1 (io.rest-assured:rest-assured-common, io.rest-assured:rest-assured)
  • Update Terraform azurerm to v4
  • Update dependency com.fasterxml.woodstox:woodstox-core to v7
  • Update dependency com.github.hmcts.java-logging:logging-appinsights to v6
  • Update dependency com.github.hmcts:idam-java-client to v3
  • Update dependency com.github.hmcts:service-auth-provider-java-client to v5
  • Update dependency com.github.tomakehurst:wiremock-jre8 to v3
  • Update dependency com.google.guava:guava to v33
  • Update dependency com.launchdarkly:launchdarkly-java-server-sdk to v7
  • Update dependency com.opentable.components:otj-pg-embedded to v1
  • Update dependency com.sun.xml.bind:jaxb-osgi to v4
  • Update dependency io.rest-assured:rest-assured to v5
  • Update dependency org.jetbrains:annotations to v24
  • Update dependency org.springframework.security:spring-security-core to v6
  • Update dependency org.yaml:snakeyaml to v2
  • Update dependency pmd to v7
  • Update dependency ubuntu to v22
  • Update feign monorepo to v13 (major) (io.github.openfeign:feign-jackson, io.github.openfeign:feign-httpclient)
  • Update mockito monorepo to v5 (major) (org.mockito:mockito-junit-jupiter, org.mockito:mockito-inline, org.mockito:mockito-core)
  • Update org.apache.tomcat.embed:9.0.93 to v10 (major) (org.apache.tomcat.embed:tomcat-embed-websocket, org.apache.tomcat.embed:tomcat-embed-el, org.apache.tomcat.embed:tomcat-embed-core)
  • Update spring boot to v3 (major) (org.springframework.boot:spring-boot-starter-test, org.springframework.boot:spring-boot-starter-cache, org.springframework.boot:spring-boot-starter-web, org.springframework.boot:spring-boot-starter-security, org.springframework.boot:spring-boot-starter-json, org.springframework.boot:spring-boot-starter-actuator, org.springframework.boot:spring-boot-starter-data-jpa, org.springframework.boot)
  • Update spring cloud to v4 (major) (org.springframework.cloud:spring-cloud-openfeign-core, org.springframework.cloud:spring-cloud-starter-openfeign, org.springframework.cloud:spring-cloud-contract-wiremock, org.springframework.cloud:spring-cloud-starter-bootstrap)
  • Update spring core to v6 (major) (org.springframework:spring-test, org.springframework:spring-beans, org.springframework:spring-core, org.springframework:spring-webmvc, org.springframework:spring-web, org.springframework:spring-tx, org.springframework:spring-orm, org.springframework:spring-jdbc, org.springframework:spring-jcl, org.springframework:spring-expression, org.springframework:spring-context-support, org.springframework:spring-context, org.springframework:spring-aspects, org.springframework:spring-aop)
  • Update versions.poi to v5 (major) (org.apache.poi:poi-ooxml, org.apache.poi:poi)
  • Update versions.restAssured to v5 (major) (io.rest-assured:rest-assured-common, io.rest-assured:rest-assured)
  • 🔐 Create all rate-limited PRs at once 🔐

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

docker-compose
docker-compose.yml
dockerfile
Dockerfile
  • hmctspublic.azurecr.io/base/java 21-distroless
database/Dockerfile
  • postgres 16
github-actions
.github/workflows/autoupdate.yml
  • ubuntu 18.04
.github/workflows/combine-prs.yml
  • ubuntu 20.04
gradle
build.gradle
  • net.serenity-bdd:serenity-gradle-plugin 2.4.34
  • org.flywaydb:flyway-database-postgresql 10.1.0
  • uk.gov.hmcts.java 0.12.61
  • com.github.ben-manes.versions 0.43.0
  • info.solidsoft.pitest 1.15.0
  • io.spring.dependency-management 1.1.6
  • org.sonarqube 5.0.0.4638
  • org.springframework.boot 2.7.18
  • org.flywaydb.flyway 10.1.0
  • au.com.dius.pact 4.1.7
  • pmd 6.53.0
  • jacoco 0.8.12
  • org.apache.poi:poi 4.1.2
  • org.apache.poi:poi-ooxml 4.1.2
  • javax.validation:validation-api 2.0.1.Final
  • org.springframework.boot:spring-boot-starter-data-jpa 2.7.18
  • org.springframework.boot:spring-boot-starter-actuator 2.7.18
  • org.springframework.boot:spring-boot-starter-json 2.7.18
  • org.springframework.boot:spring-boot-starter-security 2.7.18
  • org.springframework.boot:spring-boot-starter-web 2.7.18
  • org.springframework.boot:spring-boot-starter-cache 2.7.18
  • org.springframework.security:spring-security-core 5.7.11
  • org.springframework:spring-aop 5.3.39
  • org.springframework:spring-aspects 5.3.39
  • org.springframework:spring-context 5.3.39
  • org.springframework:spring-context-support 5.3.39
  • org.springframework:spring-expression 5.3.39
  • org.springframework:spring-jcl 5.3.39
  • org.springframework:spring-jdbc 5.3.39
  • org.springframework:spring-orm 5.3.39
  • org.springframework:spring-tx 5.3.39
  • org.springframework:spring-web 5.3.39
  • org.springframework:spring-webmvc 5.3.39
  • org.bouncycastle:bcpkix-jdk18on 1.77
  • com.github.ben-manes.caffeine:caffeine 3.1.8
  • io.rest-assured:rest-assured 3.3.0
  • com.sun.xml.bind:jaxb-osgi 2.3.9
  • com.github.hmcts:service-auth-provider-java-client 4.0.3
  • com.fasterxml.jackson.datatype:jackson-datatype-jsr310 2.14.2
  • io.jsonwebtoken:jjwt 0.9.1
  • com.fasterxml.jackson.core:jackson-core 2.14.2
  • com.fasterxml.jackson.core:jackson-annotations 2.14.2
  • com.fasterxml.jackson.core:jackson-databind 2.14.2
  • com.fasterxml.jackson:jackson-bom 2.17.2
  • org.jetbrains:annotations 13.0
  • javax.inject:javax.inject 1
  • com.github.hmcts:idam-java-client 2.1.1
  • com.nimbusds:nimbus-jose-jwt 9.40
  • org.flywaydb:flyway-core 10.1.0
  • org.flywaydb:flyway-database-postgresql 10.1.0
  • org.postgresql:postgresql 42.7.3
  • com.google.guava:guava 32.1.3-jre
  • org.glassfish:javax.el 3.0.0
  • javax.el:javax.el-api 3.0.0
  • org.yaml:snakeyaml 1.33
  • com.launchdarkly:launchdarkly-java-server-sdk 6.2.1
  • org.apache.logging.log4j:log4j-api 2.17.1
  • org.apache.logging.log4j:log4j 2.17.1
  • org.apache.logging.log4j:log4j-to-slf4j 2.17.1
  • com.azure:azure-core 1.50.0
  • com.azure:azure-messaging-servicebus 7.17.2
  • com.google.code.gson:gson 2.11.0
  • org.springframework:spring-core 5.3.39
  • org.springframework:spring-beans 5.3.39
  • ch.qos.logback:logback-core 1.2.13
  • ch.qos.logback:logback-classic 1.2.13
  • io.github.openfeign.form:feign-form 3.8.0
  • io.github.openfeign.form:feign-form-spring 3.8.0
  • io.github.openfeign:feign-httpclient 11.0
  • org.apache.logging.log4j:log4j-core 2.17.1
  • com.github.hmcts.java-logging:logging 6.1.6
  • com.github.hmcts.java-logging:logging-appinsights 5.1.9
  • com.vladmihalcea:hibernate-types-52 2.21.1
  • com.fasterxml.jackson.module:jackson-module-jaxb-annotations 2.17.2
  • org.yaml:snakeyaml 1.33
  • org.springdoc:springdoc-openapi-ui 1.6.8
  • org.springframework.cloud:spring-cloud-starter-bootstrap 3.1.8
  • net.minidev:json-smart 2.4.11
  • com.github.hmcts:rd-commons-lib 0.0.18
  • commons-io:commons-io 2.16.1
  • org.projectlombok:lombok 1.18.32
  • org.hamcrest:hamcrest-junit 2.0.0.0
  • io.rest-assured:rest-assured 4.3.3
  • io.rest-assured:rest-assured-common 4.3.3
  • org.testcontainers:postgresql 1.17.6
  • org.testcontainers:junit-jupiter 1.17.6
  • org.testcontainers:testcontainers 1.17.6
  • com.github.tomakehurst:wiremock-jre8 2.35.2
  • org.mockito:mockito-core 4.3.1
  • org.mockito:mockito-inline 4.3.1
  • net.bytebuddy:byte-buddy 1.15.1
  • net.bytebuddy:byte-buddy-agent 1.15.1
  • org.powermock:powermock-api-mockito2 2.0.9
  • org.mockito:mockito-junit-jupiter 4.3.1
  • org.skyscreamer:jsonassert 1.5.3
  • org.json:json 20240303
  • org.junit.jupiter:junit-jupiter-api 5.9.2
  • org.junit.jupiter:junit-jupiter-engine 5.9.2
  • org.pitest:pitest 1.16.1
  • info.solidsoft.gradle.pitest:gradle-pitest-plugin 1.7.0
  • org.codehaus.sonar-plugins:sonar-pitest-plugin 0.5
  • io.github.openfeign:feign-jackson 12.1
  • com.github.mifmif:generex 1.0.2
  • org.springframework.cloud:spring-cloud-contract-wiremock 3.1.10
  • org.springframework.boot:spring-boot-starter-test 2.7.18
  • com.opentable.components:otj-pg-embedded 0.13.4
  • org.springframework:spring-test 5.3.39
  • ch.qos.logback:logback-classic 1.5.7
  • ch.qos.logback:logback-core 1.5.7
  • org.apache.commons:commons-compress 1.21
  • au.com.dius.pact.consumer:junit5 4.1.7
  • au.com.dius.pact.consumer:java8 4.1.7
  • au.com.dius.pact.consumer:junit5 4.1.7
  • au.com.dius.pact.consumer:java8 4.1.7
  • au.com.dius.pact.provider:junit5 4.1.7
  • au.com.dius.pact.provider:spring 4.1.7
  • au.com.dius.pact.provider:junit5spring 4.1.7
  • org.apache.tomcat.embed:tomcat-embed-core 9.0.93
  • org.apache.tomcat.embed:tomcat-embed-el 9.0.93
  • org.apache.tomcat.embed:tomcat-embed-websocket 9.0.93
  • com.fasterxml.woodstox:woodstox-core 6.7.0
  • commons-fileupload:commons-fileupload 1.5
  • org.springframework.cloud:spring-cloud-starter-openfeign 3.1.9
  • org.springframework.cloud:spring-cloud-openfeign-core 3.1.9
  • io.netty:netty-buffer 4.1.111.Final
  • io.netty:netty-codec 4.1.111.Final
  • io.netty:netty-codec-dns 4.1.111.Final
  • io.netty:netty-codec-http 4.1.111.Final
  • io.netty:netty-codec-http2 4.1.111.Final
  • io.netty:netty-codec-socks 4.1.111.Final
  • io.netty:netty-common 4.1.111.Final
  • io.netty:netty-handler 4.1.111.Final
  • io.netty:netty-handler-proxy 4.1.111.Final
  • io.netty:netty-resolver 4.1.111.Final
  • io.netty:netty-resolver-dns 4.1.111.Final
  • io.netty:netty-resolver-dns-classes-macos 4.1.111.Final
  • io.netty:netty-resolver-dns-native-macos 4.1.111.Final
  • io.netty:netty-transport 4.1.111.Final
  • io.netty:netty-transport-classes-epoll 4.1.111.Final
  • io.netty:netty-transport-classes-kqueue 4.1.111.Final
  • io.netty:netty-transport-native-epoll 4.1.111.Final
  • io.netty:netty-transport-native-kqueue 4.1.111.Final
  • io.netty:netty-transport-native-unix-common 4.1.111.Final
gradle-wrapper
gradle/wrapper/gradle-wrapper.properties
  • gradle 8.7
helm-values
charts/rd-caseworker-ref-api/values.yaml
helmv3
charts/rd-caseworker-ref-api/Chart.yaml
  • java 5.2.1
  • servicebus 1.0.7
terraform
infrastructure/main.tf
infrastructure/terraform.tf
  • azuread 2.53.1
  • azurerm ~> 3.106
terraform-version
infrastructure/.terraform-version
  • hashicorp/terraform 1.9.4

  • Check this box to trigger a request for Renovate to run again on this repository

Action Required: Fix Renovate Configuration

There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.

Location: renovate.json
Error type: Duplicate keys in JSON
Message: "Syntax error: duplicated keys \"extends\" near ends\": [\n "

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.