Giter Club home page Giter Club logo

et-sya-api's Introduction

et-sya-api

Build Status

Notes

Since Spring Boot 2.1 bean overriding is disabled. If you want to enable it you will need to set spring.main.allow-bean-definition-overriding to true.

JUnit 5 is now enabled by default in the project. Please refrain from using JUnit4 and use the next generation

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

Running the application

Create the image of the application by executing the following command:

  ./gradlew assemble

Create docker image:

  docker-compose build

Run the distribution (created in build/install/et-sya-api directory) by executing the following command:

  docker-compose up

This will start the API container exposing the application's port (set to 4550 in this template app).

In order to test if the application is up, you can call its health endpoint:

  curl http://localhost:4550/health

You should get a response similar to this:

  {"status":"UP","diskSpace":{"status":"UP","total":249644974080,"free":137188298752,"threshold":10485760}}

Running the application in the cftlib environment

To run the application in the cflib local development environment that is provided by https://github.com/hmcts/et-ccd-callbacks it is necessary to use the cftlib profile.

  ./gradlew bootRun --args='--spring.profiles.active=cftlib'

Functional API Tests

To run all Functional API tests against AAT instances: Ensure F5 VPN is on. These three variables need to be set in your WSL:

IDAM_API_URL=https://idam-api.aat.platform.hmcts.net
FT_SYA_URL=http://et-sya-api-aat.service.core-compute-aat.internal

Then run

./gradlew functional

To run all Functional API tests against local instances (useful for debugging purposes): Note that some tests may fail as it uses the [email protected] user by default when being run locally, the workaround is to create a new user for test (need to replace username and password in getLocalAccessToken method). Ensure your local environment is up and running (see instructions in ecm-ccd-docker), Callback and SYA API instances are started in separate terminals.

Then run

./gradlew functional

Viewing the API specification and consuming

In order to view API endpoints and consume the API directly, you can use the OpenAPI specification by navigating to the site with the following route appended (swagger-ui/index.html). Swagger UI (https://swagger.io/tools/swagger-ui/) allows anyone — be it your development team or your end consumers — to visualize and interact with the API’s resources without having any of the implementation logic in place. It’s automatically generated from your OpenAPI (formerly known as Swagger) Specification, with the visual documentation making it easy for back end implementation and client side consumption.

Local

  http://localhost:4550/swagger-ui/index.html

AAT

  http://et-sya-api-aat.service.core-compute-aat.internal/swagger-ui/index.html#/

Alternative script to run application

To skip all the setting up and building, just execute the following command:

./bin/run-in-docker.sh

For more information:

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

Script includes bare minimum environment variables necessary to start api instance. Whenever any variable is changed or any other script regarding docker image/container build, the suggested way to ensure all is cleaned up properly is by this command:

docker-compose rm

It clears stopped containers correctly. Might consider removing clutter of images too, especially the ones fiddled with:

docker images

docker image rm <image-id>

There is no need to remove postgres and java or similar core images.

Health check endpoint

In order to test if the application is up, you can call its health endpoint:

  curl http://localhost:4550/health

You should get a response similar to this:

  {"status":"UP"}


### Running contract or pact tests
You can run contract or pact tests as follows:
```bash
./gradlew contract

and then using it to publish your tests:

./gradlew pactPublish

In order to run both contract and publish, use the below command

./gradlew runAndPublishConsumerPactTests

Other

Hystrix offers much more than Circuit Breaker pattern implementation or command monitoring. Here are some other functionalities it provides:

License

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

et-sya-api's People

Contributors

angela-lw avatar brendanmchugh avatar btensay avatar cindychmcts avatar darylboam avatar dependabot[bot] avatar dharmendrak avatar fergusoshea avatar furnivall avatar gauravchawlamoj avatar hsjhita avatar ikirsanov avatar itay-kirsh avatar jackreevies avatar jsinghm13 avatar jthmcts avatar justmehmet avatar lvo700 avatar marcjudge avatar mokainos avatar nickwest1 avatar paul-peasegood avatar petermoores-version1 avatar reespozzi avatar renovate[bot] avatar robin-ieong avatar timja avatar vinothon84 avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

et-sya-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.

Ignored or Blocked

These are blocked by an existing closed PR and will not be recreated unless you click a checkbox below.

Detected dependencies

docker-compose
docker-compose.yml
dockerfile
Dockerfile
  • hmctspublic.azurecr.io/base/java 21-distroless
github-actions
.github/workflows/ci.yml
  • actions/checkout v4
  • actions/setup-java v4
gradle
build.gradle
  • io.spring.dependency-management 1.1.4
  • org.springframework.boot 2.7.18
  • org.owasp.dependencycheck 9.0.9
  • com.github.ben-manes.versions 0.51.0
  • org.sonarqube 4.4.1.3373
  • hmcts.ccd.sdk 5.5.0
  • au.com.dius.pact 4.3.15
  • checkstyle 10.12.5
  • pmd 6.55.0
  • com.github.hmcts:et-data-model 3.3.0
  • com.github.hmcts:et-common 1.4.0
  • uk.gov.dwp.regex:postcode-validation 1.1.0
  • org.springframework.cloud:spring-cloud-starter-openfeign 3.1.9
  • commons-fileupload:commons-fileupload 1.5
  • org.springframework.retry:spring-retry 2.0.5
  • com.fasterxml.jackson.core:jackson-core 2.16.0
  • com.fasterxml.jackson.core:jackson-databind 2.14.2
  • org.springdoc:springdoc-openapi-ui 1.7.0
  • com.github.hmcts.java-logging:logging 6.1.4
  • com.github.hmcts:ccd-client 4.9.2
  • com.github.hmcts:idam-java-client 3.0.3
  • com.github.hmcts:service-auth-provider-java-client 4.1.2
  • uk.gov.service.notify:notifications-java-client 4.1.1-RELEASE
  • commons-fileupload:commons-fileupload 1.5
  • com.google.guava:guava 33.0.0-jre
  • org.apache.tika:tika-core 2.9.1
  • org.apache.pdfbox:pdfbox 3.0.0-RC1
  • org.apache.logging.log4j:log4j-core 2.22.0
  • org.apache.logging.log4j:log4j-api 2.22.0
  • org.apache.logging.log4j:log4j-to-slf4j 2.22.0
  • com.nimbusds:nimbus-jose-jwt 9.37.3
  • org.elasticsearch:elasticsearch 8.12.1
  • org.springframework.boot:spring-boot-devtools 2.7.18
  • org.json:json 20240205
  • org.yaml:snakeyaml 2.2
  • org.apache.tomcat.embed:tomcat-embed-core 9.0.85
  • org.apache.tomcat.embed:tomcat-embed-websocket 10.1.18
  • org.springframework.security:spring-security-crypto 6.2.1
  • org.apache.commons:commons-collections4 4.4
  • com.launchdarkly:launchdarkly-java-server-sdk 7.2.6
  • ch.qos.logback:logback-classic 1.2.13
  • ch.qos.logback:logback-core 1.2.13
  • io.github.openfeign:feign-jackson 13.2.1
  • org.mockito:mockito-inline 5.2.0
  • org.junit:junit-bom 5.10.2
  • nl.jqno.equalsverifier:equalsverifier 3.15.4
  • org.assertj:assertj-core 3.25.3
  • net.javacrumbs.json-unit:json-unit 3.2.4
  • com.github.hmcts:fortify-client 1.4.1
  • au.com.dius.pact.consumer:junit5 4.1.41
  • au.com.dius.pact.consumer:java8 4.1.41
  • org.junit.jupiter:junit-jupiter-api 5.10.2
  • org.junit.jupiter:junit-jupiter-engine 5.10.2
  • org.junit.jupiter:junit-jupiter-api 5.10.2
  • org.junit.platform:junit-platform-commons 1.10.2
gradle-wrapper
gradle/wrapper/gradle-wrapper.properties
  • gradle 8.6
helm-values
charts/et-sya-api/values.yaml
helmv3
charts/et-sya-api/Chart.yaml
  • java 5.0.4
terraform
infrastructure/et_acas_api.tf
infrastructure/main.tf
infrastructure/state.tf
  • azurerm 3.91.0
terraform-version
infrastructure/.terraform-version
  • hashicorp/terraform 1.7.3

  • 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.