Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
57459b2
Bump org.springframework.boot:spring-boot-gradle-plugin
dependabot[bot] Jul 22, 2024
f6b0de2
Merge branch 'master' into dependabot/gradle/org.springframework.boot…
hcarslaw Jul 31, 2024
05a8511
FPET-1062: Update dependencies to fix build
hcarslaw Aug 6, 2024
5ef469e
FPET-1062: Fix compile tests
hcarslaw Aug 6, 2024
e385528
FPET-1062: Update dependencies to fix unit tests
hcarslaw Aug 7, 2024
ff0062c
FPET-1062: Update github CI to java 17
hcarslaw Aug 7, 2024
01fee56
FPET-1062: Fix CVE issue
hcarslaw Aug 7, 2024
b392349
FPET-1062: Fix CVE issue
hcarslaw Aug 7, 2024
a6450a8
Update values.preview.template.yaml
hcarslaw Aug 7, 2024
a9d0d5c
FPET-1062: Upgrade rest-assured and serenity
hcarslaw Aug 9, 2024
becff72
FPET-1062: Remove unnecessary dependency changes
hcarslaw Aug 12, 2024
0d5a75d
Update values.preview.template.yaml
hcarslaw Aug 12, 2024
bbda788
Bump org.springdoc:springdoc-openapi-ui from 1.6.9 to 1.8.0
dependabot[bot] May 1, 2024
5081b06
Bump org.junit.jupiter:junit-jupiter-engine from 5.9.2 to 5.10.2
dependabot[bot] Apr 30, 2024
a95663d
Bump info.solidsoft.pitest from 1.7.4 to 1.15.0
dependabot[bot] May 6, 2024
b878cac
updated end point
praneethhm Oct 23, 2024
e51606f
contract test fix
sahitya-desireddy May 1, 2024
ccbded9
Bump org.springframework.security:spring-security-crypto
dependabot[bot] Jul 17, 2024
38dc448
Bump org.projectlombok:lombok from 1.18.26 to 1.18.34
dependabot[bot] Jul 17, 2024
46d270e
Bump au.com.dius.pact from 4.1.7 to 4.6.11
dependabot[bot] Jul 17, 2024
2c33cba
updated pact
praneethhm Oct 23, 2024
f68f160
Bump org.springframework.cloud:spring-cloud-contract-wiremock
dependabot[bot] Jul 17, 2024
d74b3cf
Bump org.owasp.dependencycheck from 9.0.4 to 10.0.3
dependabot[bot] Jul 17, 2024
398d19e
upgraded gradle & pact
praneethhm Oct 23, 2024
fc3263b
Merge branch 'dependabot/gradle/org.springframework.boot-spring-boot-…
praneethhm Oct 24, 2024
0e2add0
updated cdam url
praneethhm Oct 28, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v1
with:
java-version: 11
java-version: 17
- name: Build
run: ./gradlew check
95 changes: 49 additions & 46 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,17 @@ import org.springframework.boot.gradle.tasks.run.BootRun

buildscript {
ext {
springBootVersion = '2.7.18'
springBootVersion = '3.3.2'
}
repositories {
mavenLocal()
jcenter()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
classpath("net.serenity-bdd:serenity-gradle-plugin:2.4.34")
classpath("net.serenity-bdd:serenity-gradle-plugin:2.4.34"){
exclude group: "org.codehaus.groovy", module: "groovy"
}
}
}

Expand All @@ -20,11 +22,11 @@ plugins {
id 'com.github.ben-manes.versions' version '0.51.0'
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
id 'jacoco'
id 'org.owasp.dependencycheck' version '9.0.4'
id 'org.owasp.dependencycheck' version '10.0.3'
id 'org.sonarqube' version '5.0.0.4638'
id 'org.springframework.boot' version '2.7.0'
id 'info.solidsoft.pitest' version '1.7.4'
id 'au.com.dius.pact' version '4.1.7'
id 'org.springframework.boot' version '3.3.2'
id 'info.solidsoft.pitest' version '1.15.0'
id 'au.com.dius.pact' version '4.6.11'
}

apply plugin: 'net.serenity-bdd.aggregator'
Expand Down Expand Up @@ -169,49 +171,55 @@ def versions = [
commonsIo: '2.7',
commonsLang3: '3.9',
commonsBeanUtils: '1.9.4',
feignHttpClient: '10.2.0',
feignHttpClient: '13.3',
gradlePitest: '1.4.5',
guava: '32.1.2-jre',
jacksonDatabind: '2.16.0',
apacheLogging: '2.20.0',
jsonAssert: '1.2.3',
junit: '4.13.1',
lombok: '1.18.26',
junit: '5.10.3',
lombok: '1.18.34',
nimbus: '5.1',
pdfbox: '2.0.24',
pitest: '1.7.3',
powerMock: '2.0.0',
puppyCrawl: '8.29',
reformsJavaLogging: '5.1.1',
restAssured: '4.5.1',
serenity: '2.2.13',
restAssured: '5.5.0',
serenity: '4.1.20',
serenityCucumber: '1.9.51',
serviceTokenGenerator: '3.0.0',
sonarPitest: '0.5',
spring_security_rsa: '1.0.12.RELEASE',
springBoot: '2.7.18',
springCloud: '3.1.6',
springBoot: '3.3.2',
springCloud: '4.1.3',
springHateoas: '1.5.5',
unirest: '1.4.9',
wiremockVersion: '2.27.2',
wiremockVersion: '3.9.1',
springSecurityCrypto: '5.7.11',
tomcat : '9.0.83',
tomcat : '10.1.26',
pact_version: '4.1.11',
httpComponents: '4.5.13',
bouncycastle: '1.73',
ccdCaseDocumentAmClient: '1.7.2',
springFramework : '5.3.27'
springFramework : '6.1.11'
]

ext["logback.version"] = '1.2.13'
ext['snakeyaml.version'] = '2.2'
ext['jackson.version'] = '2.16.0'
ext['spring-framework.version'] = '5.3.27'
ext['spring-framework.version'] = '6.1.11'


dependencies {

configurations {
all {
exclude group: 'ch.qos.logback', module: 'logback-classic'
exclude group: 'org.apache.logging.log4j', module: 'log4j-to-slf4j'
}
}

dependencies {
//integration test
integrationTestImplementation group: 'com.mashape.unirest', name: 'unirest-java', version: versions.unirest
integrationTestImplementation group: 'com.nimbusds', name: 'nimbus-jose-jwt', version: versions.nimbus
Expand Down Expand Up @@ -245,7 +253,7 @@ dependencies {



testImplementation group: 'org.springframework.cloud', name: 'spring-cloud-contract-wiremock', version: '3.1.1'
testImplementation group: 'org.springframework.cloud', name: 'spring-cloud-contract-wiremock', version: '4.1.4'

implementation (group: 'commons-beanutils', name: 'commons-beanutils', version: versions.commonsBeanUtils) {
force = true
Expand All @@ -262,13 +270,11 @@ dependencies {

implementation group: 'com.github.hmcts', name:'ccd-case-document-am-client', version: versions.ccdCaseDocumentAmClient

implementation(group: 'org.apache.logging.log4j', name: 'log4j-to-slf4j', version: versions.apacheLogging)
implementation(group: 'org.apache.logging.log4j', name: 'log4j-api', version: versions.apacheLogging)

implementation group: 'org.springframework.boot', name: 'spring-boot-starter-web', version: versions.springBoot
implementation group: 'com.puppycrawl.tools', name: 'checkstyle', version: versions.puppyCrawl
implementation group: 'commons-io', name: 'commons-io', version: versions.commonsIo
implementation group: 'org.springdoc', name: 'springdoc-openapi-ui', version: '1.6.9'
implementation group: 'org.springdoc', name: 'springdoc-openapi-ui', version: '1.8.0'
implementation group: 'org.apache.httpcomponents.client5', name: 'httpclient5', version: '5.3.1'

implementation group: 'commons-fileupload', name: 'commons-fileupload', version: '1.5'

Expand All @@ -294,13 +300,13 @@ dependencies {
exclude group: 'io.reactivex', module: 'rxnetty-contexts'
exclude group: 'io.reactivex', module: 'rxnetty-servo'
exclude group: 'org.bouncycastle'
exclude group: 'org.apache.httpcomponents'
}

implementation group: 'junit', name: 'junit', version: versions.junit
implementation group: 'org.junit.jupiter', name: 'junit-jupiter', version: versions.junit
implementation group: 'org.pitest', name: 'pitest', version: versions.pitest
implementation group:'info.solidsoft.gradle.pitest', name: 'gradle-pitest-plugin', version: versions.gradlePitest
implementation group:'org.codehaus.sonar-plugins', name:'sonar-pitest-plugin', version: versions.sonarPitest
implementation group: 'org.apache.httpcomponents', name: 'httpclient', version: versions.httpComponents
implementation (group: 'com.launchdarkly', name: 'launchdarkly-java-server-sdk', version: '7.4.0')
implementation group: 'net.logstash.logback', name: 'logstash-logback-encoder', version:'7.4'

Expand All @@ -309,7 +315,6 @@ dependencies {
annotationProcessor "org.springframework.boot:spring-boot-configuration-processor"
implementation group: 'org.projectlombok', name: 'lombok', version: versions.lombok
implementation("org.springframework.boot:spring-boot-starter-validation")
testImplementation group: 'com.github.tomakehurst', name:'wiremock', version: versions.wiremockVersion
testImplementation group: 'io.rest-assured', name: 'rest-assured', version: versions.restAssured
testImplementation group: 'io.rest-assured', name: 'json-path', version: versions.restAssured
testImplementation group: 'io.rest-assured', name: 'xml-path', version: versions.restAssured
Expand All @@ -323,13 +328,11 @@ dependencies {

contractTestImplementation group: 'org.apache.httpcomponents', name: 'httpclient', version: versions.httpComponents
contractTestImplementation group: 'au.com.dius.pact.consumer', name: 'junit5', version: versions.pact_version
contractTestImplementation group: 'au.com.dius.pact.consumer', name: 'java8', version: versions.pact_version
contractTestRuntime group: 'au.com.dius.pact.consumer', name: 'junit5', version: versions.pact_version
contractTestRuntime group: 'au.com.dius.pact.consumer', name: 'java8', version: versions.pact_version

contractTestImplementation group: 'org.springframework.boot', name: 'spring-boot-starter-test'
contractTestImplementation("org.junit.jupiter:junit-jupiter-api:5.10.2")
contractTestRuntime("org.junit.jupiter:junit-jupiter-engine:5.9.2")
contractTestRuntime("org.junit.jupiter:junit-jupiter-engine:5.10.2")
contractTestImplementation('org.junit.jupiter:junit-jupiter-api:5.10.2')

contractTestImplementation sourceSets.main.runtimeClasspath
Expand Down Expand Up @@ -384,21 +387,22 @@ dependencyManagement {
entry 'tomcat-embed-el'
}

// CVE-2021-28170
dependency group: 'org.glassfish', name: 'jakarta.el', version: '4.0.2'

//CVE-2022-45688
dependencySet(group: 'org.json', version: '20230227') {
entry 'json'
}
//CVE-2023-2976

dependency group: 'org.apache.groovy', name: 'groovy', version: '4.0.22'

//CVE-2023-2976
dependency group: 'com.google.guava', name: 'guava', version: '32.1.2-jre'

//CVE-2022-1471
dependencySet(group: 'org.yaml', version: '2.2') {
entry 'snakeyaml'
}
dependency group: 'org.springframework.security', name: 'spring-security-crypto', version: '5.7.5'
dependency group: 'org.springframework.security', name: 'spring-security-crypto', version: '6.3.1'


}
Expand Down Expand Up @@ -561,30 +565,29 @@ run {
}
}


project.ext {
pactVersion = getCheckedOutGitCommitHash()
}

pact {
publish {
pactDirectory = 'pacts'
pactBrokerUrl = System.getenv("PACT_BROKER_FULL_URL") ?: 'http://localhost:80'
tags = [System.getenv("PACT_BRANCH_NAME") ?:'Dev']
version = project.pactVersion
}
}

task runAndPublishConsumerPactTests(type: Test){
dependsOn(contract)
logger.lifecycle("Runs pact Tests")
testClassesDirs = sourceSets.contractTest.output.classesDirs
classpath = sourceSets.contractTest.runtimeClasspath

finalizedBy(pactPublish)
}

runAndPublishConsumerPactTests.dependsOn contract

runAndPublishConsumerPactTests.finalizedBy pactPublish

def getCheckedOutGitCommitHash() {
'git rev-parse --verify --short HEAD'.execute().text.trim()
}

pact {
publish {
pactDirectory = 'pacts'
pactBrokerUrl = System.getenv("PACT_BROKER_FULL_URL") ?: 'http://localhost:80'
tags = [System.getenv("PACT_BRANCH_NAME") ?:'Dev']
version = project.pactVersion
}
}
2 changes: 1 addition & 1 deletion charts/prl-dgs/values.preview.template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ java:
MANAGEMENT_ENDPOINT_HEALTH_CACHE_TIMETOLIVE: "30000"
DOCMOSIS_SERVICE_DEV_MODE_FLAG: "true"
PDF_TEST_ENABLED: "true"
CCD_CASE_DOCS_AM_API: http://prl-ccd-definitions-pr-2424-cdam
CCD_CASE_DOCS_AM_API: http://prl-ccd-definitions-pr-2460-cdam
AUTH_PROVIDER_SERVICE_CLIENT_BASEURL: "http://rpe-service-auth-provider-{{ .Values.global.environment }}.service.core-compute-{{ .Values.global.environment }}.internal"
IDAM_S2S_URL: "http://rpe-service-auth-provider-{{ .Values.global.environment }}.service.core-compute-{{ .Values.global.environment }}.internal"
DOCMOSIS_SERVICE_BASE_URL: "https://docmosis.aat.platform.hmcts.net"
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.4-all.zip
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package uk.gov.hmcts.reform.prl;

import io.restassured.response.Response;
import jakarta.annotation.PostConstruct;
import lombok.extern.slf4j.Slf4j;
import net.serenitybdd.junit.spring.integration.SpringIntegrationMethodRule;
import org.assertj.core.util.Strings;
Expand All @@ -17,7 +18,6 @@
import java.net.URL;
import java.util.Base64;
import java.util.UUID;
import javax.annotation.PostConstruct;

@Slf4j
@RunWith(SpringRunner.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.openfeign.EnableFeignClients;
import uk.gov.hmcts.reform.authorisation.ServiceAuthAutoConfiguration;

@SpringBootApplication(
scanBasePackages = {"uk.gov.hmcts.reform.prl",
"uk.gov.hmcts.reform.logging.appinsights",
"uk.gov.hmcts.reform.ccd.document"},
exclude = {ServiceAuthAutoConfiguration.class})
"uk.gov.hmcts.reform.ccd.document"}
)
public class DocumentGeneratorApplication {

public static void main(String[] args) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.google.common.collect.ImmutableList;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.hc.client5.http.config.RequestConfig;
import org.apache.hc.client5.http.impl.classic.CloseableHttpClient;
import org.apache.hc.client5.http.impl.classic.HttpClientBuilder;
import org.apache.hc.core5.util.Timeout;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
Expand Down Expand Up @@ -88,9 +89,9 @@ private RestTemplate getRestTemplate(
new StringHttpMessageConverter()));

RequestConfig config = RequestConfig.custom()
.setConnectTimeout(connectTimeout)
.setConnectionRequestTimeout(connectRequestTimeout)
.setSocketTimeout(connectRequestTimeout)
.setConnectTimeout(Timeout.ofMilliseconds(connectTimeout))
.setConnectionRequestTimeout(Timeout.ofMilliseconds(connectRequestTimeout))
.setResponseTimeout(Timeout.ofMilliseconds(connectRequestTimeout))
.build();

CloseableHttpClient client = HttpClientBuilder
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package uk.gov.hmcts.reform.prl.documentgenerator.config;

import jakarta.validation.Valid;
import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
import org.springframework.validation.annotation.Validated;

import java.util.Map;
import javax.validation.Valid;


@Getter
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package uk.gov.hmcts.reform.prl.documentgenerator.config;

import jakarta.annotation.PostConstruct;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
Expand All @@ -8,7 +9,6 @@
import java.util.List;
import java.util.Map;
import java.util.Optional;
import javax.annotation.PostConstruct;

import static java.util.stream.Collectors.toMap;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.responses.ApiResponses;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
Expand All @@ -19,7 +20,6 @@
import uk.gov.hmcts.reform.prl.documentgenerator.domain.response.GeneratedDocumentInfo;
import uk.gov.hmcts.reform.prl.documentgenerator.service.DocumentManagementService;

import javax.validation.Valid;

@RestController
@RequestMapping(path = "/version/1")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public ResponseEntity<Object> handleDocumentStorageAndPDFGenerationException(Exc
log.error(exception.getMessage(), exception);

if (exception.getCause() instanceof HttpClientErrorException) {
HttpStatus httpClientErrorException = ((HttpClientErrorException) exception.getCause()).getStatusCode();
HttpStatus httpClientErrorException = (HttpStatus) ((HttpClientErrorException) exception.getCause()).getStatusCode();

if (httpClientErrorException == HttpStatus.BAD_REQUEST) {
return ResponseEntity.status(HttpStatus.SERVICE_UNAVAILABLE).body(exception.getMessage());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import lombok.Value;

import java.util.Map;
import javax.validation.constraints.NotBlank;

@Value
@Schema(description = "Request body model for Document Generation Request")
Expand Down
Loading