Giter Club home page Giter Club logo

ia-home-office-integration-api's Introduction

ia-home-office-integration-api

Service to trigger Home Office API calls (ATLAS)

Background

There are Business needs to call Home Office, through their API. ia-home-office-integration-api allows HMCTS to Get case related data from Home Office and validate the appeal submitted. HMCTS will notify Home Office on certain notifications and directions.

Prerequisites

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

  • Java 17
  • Docker (optional)

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

Running application

ia-home-office-integration-api is common Spring Boot application. Command to run:

./gradlew clean bootRun

Testing application

Unit tests and code style checks:

./gradlew clean build

Integration tests use Wiremock and Spring MockMvc framework:

./gradlew integration

Functional tests use started application instance:

./gradlew functional

In order for these tests to run successfully you will need its dependencies to be running.

Firstly, the ia-home-office-mock-api needs to be running (port 8098), this api along with instructions to run locally can be found at https://github.com/hmcts/ia-home-office-mock-api

Environment variable HOME_OFFICE_ENDPOINT should point to http://localhost:8098

To successfully interact with the above dependencies a few environment variables need to be set as below. The examples (the values below are not real, replace them with values matching those in the latest CCD Definition spreadsheet):

Environment Variable Example values
TEST_CASEOFFICER_USERNAME [email protected]
TEST_CASEOFFICER_PASSWORD password
TEST_LAW_FIRM_A_USERNAME [email protected]
TEST_LAW_FIRM_A_PASSWORD password
IA_IDAM_CLIENT_ID some-idam-client-id
IA_IDAM_SECRET some-idam-secret
IA_IDAM_REDIRECT_URI http://localhost:3451/oauth2redirect
IA_S2S_SECRET some-s2s-secret
IA_S2S_MICROSERVICE some-s2s-gateway
HOME_OFFICE_ENDPOINT http://localhost:8098

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

./gradlew functional --tests CcdScenarioRunnerTest --info -Dscenario=RIA-3271

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 contract or pact tests:

You can run contract or pact tests as follows:

./gradlew contract

Using the application

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

curl http://localhost:8094/health

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

{"status":"UP"}

Usage

API details about usages and error statuses are placed in Swagger UI

Implementation

ia-home-office-integration-api has finite retry policy and it tries configurable number of times to submit given CCD Event.

Authentication is defined as any other Reform application with Idam Authorization token and S2S ServiceAuthorization token.

Every Business logic and validation have to be implemented in scheduled CCD Event. ia-home-office-integration-api is not responsible for checking case state data.

For example: Home Office case data may become not needed anymore after appeal is moved from appealSubmitted state.

In this case downstream application (ia-case-api) must implement robust logic to prevent unsuspected behaviour and handle future CCD Event submission gracefully.

Adding Git Conventions

Include the git conventions.

  • Make sure your git version is at least 2.9 using the git --version command
  • Run the following command:
git config --local core.hooksPath .git-config/hooks

Once the above is done, you will be required to follow specific conventions for your commit messages and branch names.

If you violate a convention, the git error message will report clearly the convention you should follow and provide additional information where necessary.

Optional:

  • Install this plugin in Chrome: https://github.com/refined-github/refined-github

    It will automatically set the title for new PRs according to the first commit message, so you won't have to change it manually.

    Note that it will also alter other behaviours in GitHub. Hopefully these will also be improvements to you.

In case of problems

  1. Get in touch with your Technical Lead and inform them, so they can adjust the git hooks accordingly

  2. Instruct IntelliJ not to use Git Hooks for that commit or use git's --no-verify option if you are using the command-line

  3. If the rare eventuality that the above is not possible, you can disable enforcement of conventions using the following command

    git config --local --unset core.hooksPath

    Still, you shouldn't be doing it so make sure you get in touch with a Technical Lead soon afterwards.

License

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

ia-home-office-integration-api's People

Contributors

amandarichards avatar augustio avatar bradsorour avatar burale avatar burnsthmcts avatar colmlynch60 avatar dependabot-preview[bot] avatar divisathyan avatar filippo-possenti-version1 avatar hsjhita avatar jakecohensol avatar jamieclarkehmcts avatar jamiephillipshmcts avatar jkumar-moj avatar kalachandrasekar1 avatar lee365 avatar makowalski avatar mkayad avatar mokainos avatar nilay913 avatar raghera avatar rajeshthuraiyur avatar renovate[bot] avatar sabahirfan avatar srihari-nakkala avatar tarun-palisetty avatar timja avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

uk-gov-mirror

ia-home-office-integration-api's Issues

Dependency Dashboard

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

Open

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

  • Update all non-major dependencies (gradle, hashicorp/terraform, microsoft/ApplicationInsights-Java, org.assertj:assertj-core, com.google.guava:guava, com.github.hmcts:fortify-client, net.bytebuddy:byte-buddy-agent, org.springframework.cloud:spring-cloud-contract-wiremock, com.github.tomakehurst:wiremock, org.projectlombok:lombok, org.apache.tomcat.embed:tomcat-embed-websocket, org.apache.tomcat.embed:tomcat-embed-core, net.bytebuddy:byte-buddy, ch.qos.logback:logback-core, ch.qos.logback:logback-classic, commons-io:commons-io, com.fasterxml.jackson.core:jackson-databind, net.minidev:json-smart, com.nimbusds:nimbus-jose-jwt, com.github.hmcts.java-logging:logging, org.bouncycastle:bcprov-jdk18on, org.springframework.cloud:spring-cloud-starter-bootstrap, org.springframework.cloud:spring-cloud-starter-openfeign, com.fasterxml.jackson.module:jackson-module-afterburner, com.fasterxml.jackson.module:jackson-module-parameter-names, com.fasterxml.jackson.datatype:jackson-datatype-jdk8, com.fasterxml.jackson.datatype:jackson-datatype-jsr310, com.fasterxml.jackson.dataformat:jackson-dataformat-cbor, com.fasterxml.jackson.dataformat:jackson-dataformat-yaml, com.fasterxml.jackson.core:jackson-annotations, com.fasterxml.jackson.core:jackson-core, jacoco, checkstyle, org.springdoc:springdoc-openapi-ui, net.serenity-bdd:serenity-spring, net.serenity-bdd:serenity-rest-assured, net.serenity-bdd:serenity-junit, net.serenity-bdd:serenity-core, io.rest-assured:xml-path, io.rest-assured:json-path, io.rest-assured:rest-assured, io.rest-assured:rest-assured-all, org.pitest:pitest, au.com.dius.pact.provider:junit5spring, au.com.dius.pact.provider:spring, au.com.dius.pact.provider:junit5, au.com.dius.pact.consumer:junit5, org.junit.platform:junit-platform-engine, org.junit.platform:junit-platform-commons, org.junit.jupiter:junit-jupiter-params, org.junit.jupiter:junit-jupiter-engine, org.junit.jupiter:junit-jupiter-api, au.com.dius.pact, com.github.ben-manes.versions, org.owasp.dependencycheck, uk.gov.hmcts.java, io.spring.dependency-management)

Detected dependencies

docker-compose
docker-compose.yml
dockerfile
Dockerfile
  • hmctspublic.azurecr.io/base/java 17-distroless
github-actions
.github/workflows/pr-title-validation.yml
.github/workflows/swagger.yml
  • actions/checkout v1
  • actions/cache v1
  • actions/setup-java v1
gradle
build.gradle
  • org.yaml:snakeyaml 2.2
  • net.serenity-bdd:serenity-gradle-plugin 3.2.3
  • io.spring.dependency-management 1.1.4
  • org.springframework.boot 2.7.18
  • uk.gov.hmcts.java 0.12.50
  • org.owasp.dependencycheck 9.0.4
  • com.github.ben-manes.versions 0.50.0
  • org.sonarqube 3.5.0.2730
  • au.com.dius.pact 4.2.14
  • info.solidsoft.pitest 1.15.0
  • io.freefair.lombok 6.6.3
  • com.adarshr.test-logger 3.2.0
  • checkstyle 10.12.0
  • pmd 6.55.0
  • jacoco 0.8.11
  • commons-fileupload:commons-fileupload 1.5
  • com.google.guava:guava 32.1.2-jre
  • org.yaml:snakeyaml 2.2
  • com.fasterxml.jackson.core:jackson-databind 2.16.0
  • com.fasterxml.jackson.core:jackson-core 2.16.0
  • com.fasterxml.jackson.core:jackson-annotations 2.16.0
  • com.fasterxml.jackson.dataformat:jackson-dataformat-yaml 2.16.0
  • com.fasterxml.jackson.dataformat:jackson-dataformat-cbor 2.16.0
  • com.fasterxml.jackson.datatype:jackson-datatype-jsr310 2.16.0
  • com.fasterxml.jackson.datatype:jackson-datatype-jdk8 2.16.0
  • com.fasterxml.jackson.module:jackson-module-parameter-names 2.16.0
  • com.fasterxml.jackson.module:jackson-module-afterburner 2.16.0
  • org.junit.jupiter:junit-jupiter-api 5.10.1
  • org.junit.jupiter:junit-jupiter-engine 5.10.1
  • org.junit.jupiter:junit-jupiter-params 5.10.1
  • org.junit.platform:junit-platform-commons 1.10.1
  • org.junit.platform:junit-platform-engine 1.10.1
  • org.springframework.cloud:spring-cloud-dependencies Hoxton.SR4
  • uk.gov.hmcts.reform:service-auth-provider-client 4.0.0
  • org.springframework.cloud:spring-cloud-starter-openfeign 3.1.8
  • org.springframework.cloud:spring-cloud-starter-bootstrap 3.1.7
  • org.springframework.cloud:spring-cloud-starter-netflix-hystrix 2.2.10.RELEASE
  • org.bouncycastle:bcprov-jdk18on 1.74
  • com.github.hmcts.java-logging:logging 6.0.1
  • uk.gov.hmcts.reform:logging 5.1.7
  • uk.gov.hmcts.reform:logging-appinsights 5.1.7
  • uk.gov.hmcts.reform:properties-volume-spring-boot-starter 0.1.0
  • uk.gov.hmcts.reform.auth:auth-checker-lib 2.1.4
  • org.springdoc:springdoc-openapi-ui 1.7.0
  • org.apiguardian:apiguardian-api 1.1.2
  • com.nimbusds:nimbus-jose-jwt 9.37.2
  • net.minidev:json-smart 2.5.0
  • com.fasterxml.jackson.core:jackson-databind 2.16.0
  • org.apache.httpcomponents:httpclient 4.5.14
  • commons-io:commons-io 2.15.1
  • ch.qos.logback:logback-classic 1.2.13
  • ch.qos.logback:logback-core 1.2.13
  • net.bytebuddy:byte-buddy 1.14.10
  • com.sun.xml.bind:jaxb-osgi 2.3.9
  • com.launchdarkly:launchdarkly-java-server-sdk 6.3.0
  • org.apache.tomcat.embed:tomcat-embed-core 9.0.83
  • org.apache.tomcat.embed:tomcat-embed-websocket 9.0.83
  • org.projectlombok:lombok 1.18.30
  • org.projectlombok:lombok 1.18.30
  • org.projectlombok:lombok 1.18.30
  • org.projectlombok:lombok 1.18.30
  • org.springframework.boot:spring-boot-starter-test 2.7.18
  • com.github.tomakehurst:wiremock 2.35.1
  • org.mockito:mockito-core 3.12.4
  • org.powermock:powermock-api-mockito2 2.0.9
  • org.springframework.cloud:spring-cloud-contract-wiremock 3.1.8
  • org.pitest:pitest 1.15.3
  • info.solidsoft.gradle.pitest:gradle-pitest-plugin 1.15.0
  • org.codehaus.sonar-plugins:sonar-pitest-plugin 0.5
  • net.bytebuddy:byte-buddy-agent 1.14.10
  • com.vladsch.flexmark:flexmark-all 0.64.8
  • io.rest-assured:rest-assured-all 5.3.2
  • io.rest-assured:rest-assured 5.3.2
  • io.rest-assured:json-path 5.3.2
  • io.rest-assured:xml-path 5.3.2
  • net.serenity-bdd:serenity-core 3.6.22
  • net.serenity-bdd:serenity-junit 3.6.22
  • net.serenity-bdd:serenity-rest-assured 3.6.22
  • net.serenity-bdd:serenity-spring 3.6.22
  • com.github.hmcts:fortify-client 1.3.0
  • com.google.guava:guava 32.1.2-jre
  • org.assertj:assertj-core 3.24.2
  • au.com.dius.pact.consumer:junit5 4.1.38
  • au.com.dius:pact-jvm-model 3.6.15
  • au.com.dius.pact.provider:junit5 4.1.38
  • au.com.dius.pact.provider:spring 4.1.38
  • au.com.dius.pact.provider:junit5spring 4.1.38
gradle-wrapper
gradle/wrapper/gradle-wrapper.properties
  • gradle 7.6.3
helm-values
charts/ia-home-office-integration-api/values.yaml
helmv3
charts/ia-home-office-integration-api/Chart.yaml
  • java 5.2.1
regex
Dockerfile
  • microsoft/ApplicationInsights-Java 3.4.18
terraform
infrastructure/main.tf
infrastructure/state.tf
  • azurerm ~> 3.56
terraform-version
infrastructure/.terraform-version
  • hashicorp/terraform 1.6.5

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

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.