Giter Club home page Giter Club logo

div-evidence-management-client-api's Introduction

Divorce Evidence Management Client API License: MIT

The Evidence Management Client API is responsible for providing an interface between the Divorce services and the HMCTS Document Management Service

Introduction

  • This API provides below endpoints
    • File Upload(s)
    • File Download
  • It uses the following tech stack tech stack
    • Java11
    • Spring Boot
    • Junit, Mockito, SpringBootTest and Powermockito
    • Gradle
    • Spring Hateos
    • Traverson
  • Plugins used by project
    • Jacoco
    • OWASP dependency check
    • Sonar

Setup

  1. Clone the repo
git clone [https://github.com/hmcts/div-evidence-management-client-api.git](https://github.com/hmcts/div-evidence-management-client-api.git)
  1. cd into the directory
cd div-evidence-management-client-api
  1. Run the following command
./gradlew bootRun

This command will start the spring boot application in an embedded tomcat on port 4006. To change the port change the configuration in application.properties.

This will output:

<==========---> 80% EXECUTING [43s]
> :bootRun

this is an expected behaviour of Gradle and means the project is running.

Additional Commands that are available:

  • This command will create a local SonarQube docker instance on port 9000:
docker pull sonarqube:latest && docker run -d --restart=always -p9000:9000 sonarqube:latest
  • This command will generate sonar reports and update it into local SonarQube instance.
./gradlew sonarqube -Dsonar.host.url=http://localhost:9000
  • This command will runs all verification tasks in the project, including test.
./gradlew check

Development

API Consumption

File Upload Endpoint HTTP Protocol Header Attribute Condition Headers Body
/emclientapi/version/1/uploadFiles POST Required AuthorizationToken : { User Token } [key=file,value=MultipartFile1,key=file,value=MultipartFile2,....]
Required Content-Type :multipart/form-data
Optional RequestId :{RequestId}

File Upload Response:

[
    {
        "fileUrl": "http://localhost:8080/documents/214",
        "fileName": "file",
        "mimeType": "application/pdf",
        "createdBy": "13",
        "lastModifiedBy": "13",
        "createdOn": "2017-09-25T22:41:38.569+0000",
        "modifiedOn": "null",
        "status": "OK"
    }
]
File Download Endpoint HTTP Protocol Header Attribute Condition Headers
/emclientapi/version/1/downloadFile?fileUrl=http://localhost:8080/documents/195 GET Required AuthorizationToken : { User Token }
Optional RequestId :{RequestId}

File Download Response:

Actual file for the given URL.

Integration test

To run all integration tests locally:

  • Make a copy of src/main/resources/example-application-aat.yml as src/main/resources/application-aat.yml
  • Make a copy of src/integrationTest/resources/example-application-local.properties as src/integrationTest/resources/application-local.properties
  • Replace the replace_me secrets in both of the newly created files. You can get the values from SCM and Azure secrets key vault (the new files are in .gitignore and should not be committed to git)
  • Start the app with AAT config using ./gradlew clean bootRunAat
  • Start the test with AAT config using ./gradlew clean functional

Contract Test (PACT)

To run consumer contract tests locally

  • Execute gradle task Contract
./gradlew contract
  • To publish the contract into local pact broker or Hmcts broker. Execute:
./gradlew runAndPublishConsumerPactTests

Running additional tests in the Jenkins PR Pipeline

  1. Add one or more appropriate labels to your PR in GitHub. Valid labels are:
  • enable_fortify_scan
  • enable_full_functional_tests
  1. Trigger a build of your PR in Jenkins. Fortify scans will take place asynchronously as part of the Static Checks/Container Build step.
  • Check the Blue Ocean view for live monitoring, and review the logs once complete for any issues.
  • As Fortify scans execute during the Static Checks/Container Build step, you will need to ensure this is triggered by making a minor change to the PR, such as bumping the chart version.

License

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

div-evidence-management-client-api's People

Contributors

adusumillipraveen avatar cotterale avatar damongreen123 avatar danielbe11 avatar david-gimelle avatar dependabot-preview[bot] avatar dnenkov avatar ellisd-b avatar hosainnet avatar iichr avatar johnnyvineall avatar johnoneill46 avatar madjava avatar magicobject avatar michael1142 avatar mindgames2015 avatar mokainos avatar mthava avatar nsingamsetty avatar qzhou-hmcts avatar ravinderpal avatar rishikrsharma avatar rob-doherty avatar ruban72 avatar satyachundur avatar smillapalk avatar tchow8 avatar tseelig avatar vianvi avatar yarpo avatar

Stargazers

 avatar

Watchers

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

div-evidence-management-client-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 spring security (org.springframework.security:spring-security-rsa, org.springframework.security:spring-security-crypto)
  • Update versions.httpComponents to v4.5.14 (org.apache.httpcomponents:fluent-hc, org.apache.httpcomponents:httpclient)
  • Update versions.pact_version (au.com.dius.pact.consumer:java8, au.com.dius.pact.consumer:junit5)
  • Update versions.tomcat to v9.0.93 (org.apache.tomcat.embed:tomcat-embed-el, org.apache.tomcat.embed:tomcat-embed-websocket, org.apache.tomcat.embed:tomcat-embed-core)
  • Update Helm release java to v5.2.1
  • Update Terraform azurerm to v3.116.0
  • Update dependency checkstyle to v8.45.1
  • Update dependency com.fasterxml.jackson.core:jackson-databind to v2.17.2
  • Update dependency com.github.hmcts:fortify-client to v1.4.4
  • Update dependency com.github.tomakehurst:wiremock to v2.35.2
  • Update dependency com.jayway.jsonpath:json-path-assert to v2.9.0
  • Update dependency commons-io:commons-io to v2.16.1
  • Update dependency hashicorp/terraform to v1.9.5
  • Update dependency info.solidsoft.gradle.pitest:gradle-pitest-plugin to v1.15.0
  • Update dependency io.rest-assured:rest-assured to v4.5.1
  • Update dependency net.serenity-bdd:serenity-gradle-plugin to v2.6.0
  • Update dependency org.apache.commons:commons-lang3 to v3.17.0
  • Update dependency org.bouncycastle:bcprov-jdk15on to v1.70
  • Update dependency org.hibernate:hibernate-validator to v6.2.5.Final
  • Update dependency org.pitest:pitest-command-line to v1.16.3
  • Update dependency org.skyscreamer:jsonassert to v1.5.3
  • Update dependency org.springdoc:springdoc-openapi-ui to v1.8.0
  • Update dependency org.springframework.retry:spring-retry to v1.3.4
  • Update junit5 monorepo to v5.11.0 (org.junit.jupiter:junit-jupiter-engine, org.junit.jupiter:junit-jupiter-api)
  • Update log4j2 monorepo to v2.23.1 (org.apache.logging.log4j:log4j-to-slf4j, org.apache.logging.log4j:log4j-api)
  • Update plugin au.com.dius.pact to v4.6.14
  • Update plugin info.solidsoft.pitest to v1.15.0
  • Update plugin io.spring.dependency-management to v1.1.6
  • Update plugin org.owasp.dependencycheck to v8.4.3
  • Update plugin org.sonarqube to v3.5.0.2730
  • Update versions.jacksonCore to v2.17.2 (com.fasterxml.jackson.core:jackson-core, com.fasterxml.jackson.core:jackson-annotations)
  • Update versions.logbackVersion to v1.5.7 (ch.qos.logback:logback-core, ch.qos.logback:logback-classic)
  • Update versions.serenity to v2.6.0 (net.serenity-bdd:serenity-spring, net.serenity-bdd:serenity-rest-assured, net.serenity-bdd:serenity-junit, net.serenity-bdd:serenity-core)
  • Update Terraform azurerm to v4
  • Update dependency checkstyle to v10
  • Update dependency com.github.tomakehurst:wiremock to v3
  • Update dependency com.google.guava:guava to v33
  • Update dependency gradle to v8
  • Update dependency io.rest-assured:rest-assured to v5
  • Update dependency net.serenity-bdd:serenity-cucumber to v4
  • Update dependency net.serenity-bdd:serenity-gradle-plugin to v4
  • Update dependency org.glassfish:jakarta.el to v4
  • Update dependency org.hibernate:hibernate-validator to v8
  • Update dependency org.springframework.cloud:spring-cloud-dependencies to v2023
  • Update dependency org.springframework.hateoas:spring-hateoas to v2
  • Update dependency org.springframework.plugin:spring-plugin-core to v3
  • Update dependency org.springframework.retry:spring-retry to v2
  • Update dependency org.yaml:snakeyaml to v2
  • Update hmctspublic.azurecr.io/base/java Docker tag to v21
  • Update plugin org.owasp.dependencycheck to v10
  • Update plugin org.sonarqube to v5
  • Update spring boot to v3 (major) (org.springframework.boot:spring-boot-starter-web, org.springframework.boot:spring-boot-starter-aop, org.springframework.boot:spring-boot-starter-actuator, org.springframework.boot:spring-boot-devtools, org.springframework.boot:spring-boot-dependencies, org.springframework.boot, org.springframework.boot:spring-boot-gradle-plugin)
  • Update spring core to v6 (major) (org.springframework:spring-webmvc, org.springframework:spring-web, org.springframework:spring-jcl, org.springframework:spring-expression, org.springframework:spring-core, org.springframework:spring-context-support, org.springframework:spring-context, org.springframework:spring-aop)
  • Update versions.serenity to v4 (major) (net.serenity-bdd:serenity-spring, net.serenity-bdd:serenity-rest-assured, net.serenity-bdd:serenity-junit, net.serenity-bdd:serenity-core)
  • Update versions.tomcat to v10 (major) (org.apache.tomcat.embed:tomcat-embed-el, org.apache.tomcat.embed:tomcat-embed-websocket, org.apache.tomcat.embed:tomcat-embed-core)
  • ๐Ÿ” Create all rate-limited PRs at once ๐Ÿ”

Warning

Renovate failed to look up the following dependencies: Failed to look up maven package uk.gov.hmcts.reform:service-auth-provider-client, Failed to look up maven package uk.gov.hmcts.reform:logging-appinsights, Failed to look up maven package uk.gov.hmcts.reform:logging-httpcomponents, Failed to look up maven package uk.gov.hmcts.reform:logging-spring, Failed to look up maven package uk.gov.hmcts.reform:properties-volume-spring-boot-starter.

Files affected: build.gradle


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 17-distroless
gradle
settings.gradle
build.gradle
  • info.solidsoft.gradle.pitest:gradle-pitest-plugin 1.6.0
  • org.pitest:pitest-command-line 1.6.6
  • org.springframework.boot:spring-boot-gradle-plugin 2.7.14
  • net.serenity-bdd:serenity-gradle-plugin 2.5.8
  • io.spring.dependency-management 1.0.11.RELEASE
  • info.solidsoft.pitest 1.9.11
  • org.owasp.dependencycheck 8.0.2
  • org.sonarqube 3.2.0
  • org.springframework.boot 2.7.14
  • au.com.dius.pact 4.1.0
  • com.github.ben-manes.versions 0.51.0
  • uk.gov.hmcts.java 0.12.27
  • org.projectlombok:lombok 1.18.30
  • org.springframework.boot:spring-boot-dependencies 2.7.17
  • org.springframework.cloud:spring-cloud-dependencies 2021.0.8
  • com.netflix.servo:servo-core 0.13.2
  • org.glassfish:jakarta.el 3.0.4
  • org.apache.logging.log4j:log4j-api 2.17.1
  • org.apache.logging.log4j:log4j-to-slf4j 2.17.1
  • org.springframework:spring-aop 5.3.30
  • org.springframework:spring-context 5.3.30
  • org.springframework:spring-context-support 5.3.30
  • org.springframework:spring-core 5.3.30
  • org.springframework:spring-expression 5.3.30
  • org.springframework:spring-jcl 5.3.30
  • org.springframework:spring-web 5.3.30
  • org.springframework:spring-webmvc 5.3.30
  • org.yaml:snakeyaml 1.33
  • checkstyle 8.29
  • junit:junit 4.13.2
  • junit:junit 4.13.2
  • com.mashape.unirest:unirest-java 1.4.9
  • io.rest-assured:rest-assured 4.2.1
  • junit:junit 4.13.2
  • net.serenity-bdd:serenity-cucumber 1.9.51
  • net.serenity-bdd:serenity-core 2.5.8
  • net.serenity-bdd:serenity-junit 2.5.8
  • net.serenity-bdd:serenity-rest-assured 2.5.8
  • net.serenity-bdd:serenity-spring 2.5.8
  • org.apache.commons:commons-lang3 3.9
  • org.skyscreamer:jsonassert 1.2.3
  • uk.gov.hmcts.reform:service-auth-provider-client 3.0.0
  • com.fasterxml.jackson.core:jackson-annotations 2.13.2
  • com.fasterxml.jackson.core:jackson-databind 2.13.2
  • com.fasterxml.jackson.core:jackson-core 2.13.2
  • com.google.code.findbugs:jsr305 3.0.2
  • com.jayway.jsonpath:json-path-assert 2.4.0
  • commons-io:commons-io 2.7
  • org.springdoc:springdoc-openapi-ui 1.6.9
  • io.swagger.core.v3:swagger-annotations 2.2.15
  • javax.validation:validation-api 2.0.0.Final
  • org.hibernate:hibernate-validator 6.0.17.Final
  • org.springframework.boot:spring-boot-devtools 2.7.17
  • org.springframework.boot:spring-boot-starter-actuator 2.7.17
  • org.springframework.boot:spring-boot-starter-aop 2.7.17
  • org.springframework.boot:spring-boot-starter-web 2.7.17
  • org.springframework.cloud:spring-cloud-starter-netflix-hystrix 2.2.10.RELEASE
  • org.springframework.cloud:spring-cloud-starter-netflix-ribbon 2.2.10.RELEASE
  • org.springframework.hateoas:spring-hateoas 0.25.2.RELEASE
  • org.springframework.plugin:spring-plugin-core 1.2.0.RELEASE
  • org.springframework.retry:spring-retry 1.2.5.RELEASE
  • org.bouncycastle:bcprov-jdk15on 1.61
  • org.apache.httpcomponents:httpclient 4.5.13
  • org.apache.httpcomponents:fluent-hc 4.5.13
  • uk.gov.hmcts.reform:logging-appinsights 5.1.7
  • uk.gov.hmcts.reform:logging-httpcomponents 5.1.7
  • uk.gov.hmcts.reform:logging-spring 5.1.7
  • uk.gov.hmcts.reform:properties-volume-spring-boot-starter 0.0.4
  • com.google.guava:guava 32.1.2-jre
  • org.apache.tomcat.embed:tomcat-embed-core 9.0.80
  • org.apache.tomcat.embed:tomcat-embed-websocket 9.0.80
  • org.apache.tomcat.embed:tomcat-embed-el 9.0.80
  • ch.qos.logback:logback-classic 1.2.10
  • ch.qos.logback:logback-core 1.2.10
  • org.springframework.security:spring-security-rsa 1.1.0
  • org.springframework.security:spring-security-crypto 6.2.1
  • com.github.tomakehurst:wiremock 2.27.2
  • com.github.hmcts:fortify-client 1.2.0
  • com.github.hmcts:fortify-client 1.2.0
  • org.projectlombok:lombok 1.18.30
  • au.com.dius.pact.consumer:junit5 4.1.7
  • au.com.dius.pact.consumer:java8 4.1.7
  • org.junit.jupiter:junit-jupiter-api 5.9.3
  • org.junit.jupiter:junit-jupiter-engine 5.9.3
gradle-wrapper
gradle/wrapper/gradle-wrapper.properties
  • gradle 7.6
helmv3
charts/div-emca/Chart.yaml
  • java 5.0.0
terraform
infrastructure/main.tf
infrastructure/state.tf
  • azurerm 3.96.0
terraform-version
infrastructure/.terraform-version
  • hashicorp/terraform 1.8.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.