Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DTSCCI-217 upgrade to spring boot 3 #2856

Closed
wants to merge 45 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
d59a197
Upgrade spring boot & dependencies
Jefex7 May 1, 2024
43f598e
javax to jakarta
Jefex7 May 1, 2024
251c5ee
Solve deprecations
Jefex7 May 1, 2024
9f939e7
Fix Checkstyle
Jefex7 May 10, 2024
4037e5d
upgrade junit
Jefex7 May 10, 2024
14b10ae
upgrade dependencies
Jefex7 May 10, 2024
f3e2061
Fix Checkstyle
Jefex7 May 15, 2024
93cd468
Changed depdendencies
Jefex7 May 15, 2024
ccd0694
Fixed Test
Jefex7 May 15, 2024
63f5bbe
Fix deprecations
Jefex7 May 15, 2024
0d43c0f
Upgrade Dependencies to fix CVEs
Jefex7 May 15, 2024
ba43bc3
Merge branch 'master' into DTSCCI-217
Jefex7 May 15, 2024
bf7e579
Upgrade Dependencies to fix CVEs
Jefex7 May 15, 2024
ceba7f7
Exclude Dependency to fix CVE
Jefex7 May 16, 2024
3252edf
Upgrade CodeQl Action v1 -> v2
Jefex7 May 16, 2024
3bec5b1
Add Version to codeQl matrix
Jefex7 May 16, 2024
6dcc0a8
revert commit for Code QL java versions
Jefex7 May 16, 2024
94d5e18
Merge branch 'master' into DTSCCI-217
Jefex7 May 16, 2024
7ce9f75
skip autobuild step
Jefex7 May 16, 2024
5c6ee37
readd autobuild step
Jefex7 May 16, 2024
39c4d0f
Merge branch 'master' into DTSCCI-217
Jefex7 May 16, 2024
03584d4
Adding step for java and upgrading to v4
Jefex7 May 17, 2024
3bddc05
fix codeql step version issue
Jefex7 May 17, 2024
5d0efba
Upgrade sonarqube version
Jefex7 May 20, 2024
12c967e
Remove wrong method added.
Jefex7 May 20, 2024
b7771ce
Changed test
Jefex7 May 20, 2024
bcd3202
Changed application.yml
Jefex7 May 22, 2024
98e01c2
Adding Annotation
Jefex7 May 29, 2024
33e3ae7
change feign versions
Jefex7 May 29, 2024
16c5c44
Adding ImportAutoConfiguration
Jefex7 May 30, 2024
e31a966
added logback for testing
Jefex7 May 30, 2024
a415354
updating dependencies
Jefex7 Jun 4, 2024
1b94080
Resolve CVE
Jefex7 Jun 4, 2024
9225686
Change httpclientConfiguration
Jefex7 Jun 4, 2024
761144d
fix style
Jefex7 Jun 4, 2024
7bcb20c
Changed variable for jacoco tests reports
Jefex7 Jun 7, 2024
a8f915a
change jenkinsfile_CNP
Jefex7 Jun 12, 2024
8888716
updates
EllisD-B Jun 12, 2024
08b84e8
Revert "Changed variable for jacoco tests reports"
Jefex7 Jun 13, 2024
afb5f3d
Update build.gradle and revert Jenkinsfile_CNP
Jefex7 Jun 24, 2024
5dbad14
Change annotation
Jefex7 Jun 20, 2024
b46f34b
Add annotation to disable functional tests
Jefex7 Jun 24, 2024
cb1703d
Fix checkstyle
Jefex7 Jun 24, 2024
9348ce0
Upgrade Caffeine dependency & others
Jefex7 Jun 24, 2024
a87951c
Removing config for test in Build.gradle
Jefex7 Jun 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
14 changes: 10 additions & 4 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,21 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Setup Java JDK
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17

- name: Initialize CodeQL
uses: github/codeql-action/init@v1
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}

- name: Autobuild
uses: github/codeql-action/autobuild@v1
uses: github/codeql-action/autobuild@v3

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
uses: github/codeql-action/analyze@v3
1 change: 0 additions & 1 deletion Jenkinsfile_CNP
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,4 @@ withPipeline("java", product, component) {
env.NODE_TLS_REJECT_UNAUTHORIZED = "0";
loadVaultSecrets(secrets)
}

}
136 changes: 68 additions & 68 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import java.util.stream.Collectors
plugins {
id 'checkstyle'
id 'io.spring.dependency-management' version '1.1.0'
id 'org.springframework.boot' version '2.7.18'
id 'org.springframework.boot' version '3.2.5'
id 'org.owasp.dependencycheck' version '8.0.1'
id 'org.sonarqube' version '2.8'
id 'org.sonarqube' version '5.0.0.4638'
id 'com.github.ben-manes.versions' version '0.51.0'
id 'jacoco'
id 'idea'
Expand All @@ -25,18 +25,17 @@ dependencyUpdates.resolutionStrategy = {
}

def springBootVersion = plugins.getPlugin('org.springframework.boot').class.package.implementationVersion
def springCloudVersion = '2021.0.9'
def springCloudVersion = '2023.0.1'

def versions = [
logback : '1.2.13',
springBoot : springBootVersion,
reformJavaLogging : '5.1.7',
loggingAppinsights : '5.1.7',
restAssuredVersion: '4.2.0',
jackson : '2.17.0',
junit : '5.7.1',
junitPlatform : '1.7.1',
elasticSearch : '7.17.20'
logback : '1.5.6',
springBoot : springBootVersion,
reformJavaLogging : '5.1.7',
restAssured : '5.4.0',
jackson : '2.17.1',
junit : '5.10.1',
junitPlatform : '1.10.2',
elasticSearch : '7.17.20'
]

allprojects {
Expand Down Expand Up @@ -103,52 +102,42 @@ allprojects {
}
jcenter()
}
configurations.all {
exclude group: 'com.vaadin.external.google', module: 'android-json'
exclude group: 'jakarta.activation', module: 'jakarta.activation-api'
}

dependencyManagement {
imports {
mavenBom "org.springframework.boot:spring-boot-dependencies:${springBootVersion}"
mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
}
dependencies {
// checkstyle needs a certain version and so does spring fox swagger, so can't use latest
// fun times...
dependencySet(group: 'com.google.guava', version: '32.0.1-jre') {
entry 'guava'

dependencySet(
group: 'org.hibernate',
version: '8.0.1.Final'
) {
entry 'hibernate-validator'
}

dependencySet(group: 'ch.qos.logback', version: '1.5.6') {
entry 'logback-classic'
entry 'logback-core'
}

//Solves CVE-2023-35116
// Solves CVE-2023-35116
dependency group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: versions.jackson
dependency group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: versions.jackson
dependency group: 'com.fasterxml.jackson.core', name: 'jackson-annotations', version: versions.jackson


//Solves CVE-2022-45688, CVE-2023-5072
dependency group: 'org.json', name: 'json', version: '20231013'
//Solves CVE-2023-2976, CVE-2018-10237, CVE-2020-8908
dependency group: 'com.google.guava', name: 'guava', version: '33.1.0-jre'

// solves CVE-2022-25857
dependencySet(
group: 'org.yaml',
version: '2.0'
) {
entry 'snakeyaml'
}
//Solves CVE-2023-33201
dependency group: 'org.bouncycastle', name: 'bcprov-jdk18on', version: '1.77'

//Solves CVE-2023-6481,
dependencySet(group: 'ch.qos.logback', version: '1.2.13') {
entry 'logback-core'
entry 'logback-classic'
}

dependencySet(
group: 'org.hibernate',
version: '6.2.4.Final'
) {
entry 'hibernate-validator'
}
dependencySet(group: 'org.apache.logging.log4j', version: '2.18.0') {
entry 'log4j-api'
entry 'log4j-to-slf4j'
}
}
}
}
Expand Down Expand Up @@ -179,10 +168,8 @@ dependencies {
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-validation'
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-quartz'

implementation group: 'org.flywaydb', name: 'flyway-core', version: '5.2.4'

implementation group: 'ch.qos.logback', name: 'logback-classic', version: versions.logback
implementation group: 'ch.qos.logback', name: 'logback-core', version: versions.logback
implementation group: 'org.flywaydb', name: 'flyway-core', version: '10.14.0'
runtimeOnly group: 'org.flywaydb', name: 'flyway-database-postgresql', version: '10.14.0'

implementation group: 'com.mitchellbosecke', name: 'pebble', version: '2.4.0'

Expand All @@ -195,30 +182,33 @@ dependencies {

implementation group: 'uk.gov.service.notify', name: 'notifications-java-client', version: '5.0.1-RELEASE'

implementation group: 'uk.gov.hmcts.reform', name: 'logging', version: versions.reformJavaLogging
implementation group: 'uk.gov.hmcts.reform', name: 'logging-appinsights', version: versions.loggingAppinsights
implementation group: 'com.microsoft.azure', name: 'applicationinsights-web', version: '2.6.4'
implementation group: 'com.github.hmcts.java-logging', name: 'logging', version: '6.1.4'
implementation group: 'com.github.hmcts.java-logging', name: 'logging-appinsights', version: '6.1.2'
implementation group: 'com.microsoft.azure', name: 'applicationinsights-web', version: '3.5.1'
implementation group: 'org.apiguardian', name: 'apiguardian-api', version: '1.1.2'

implementation group: 'com.github.hmcts', name: 'java-logging', version: '6.0.1'
implementation group: 'com.github.hmcts', name: 'java-logging', version: '6.1.4'

implementation('com.github.hmcts:cmc-pdf-service-client:7.0.0') {
exclude group: 'java-logging', module: ' java-logging'
}
implementation group: 'uk.gov.hmcts.reform', name: 'document-management-client', version: '7.0.0'

implementation group: 'com.github.hmcts', name: 'document-management-client', version: '7.0.1'
implementation group: 'com.launchdarkly', name: 'launchdarkly-java-server-sdk', version: '6.3.0'
implementation group: 'uk.gov.hmcts.reform', name: 'core-case-data-store-client', version: '4.7.6'
implementation group: 'com.github.hmcts', name: 'core-case-data-store-client', version: '4.9.2'

implementation group: 'com.github.hmcts', name: 'ccd-case-document-am-client', version: '1.7.1'
implementation group: 'com.github.hmcts', name: 'doc-assembly-client', version: '1.2.2'
implementation('com.github.hmcts:payments-java-client:0.0.7') {
exclude group: 'java-logging', module: ' java-logging'
}
implementation group: 'uk.gov.hmcts.reform', name: 'service-auth-provider-client', version: '4.0.0'
implementation group: 'com.github.hmcts', name: 'service-auth-provider-java-client', version: '5.1.2'
implementation group: 'com.github.hmcts', name: 'send-letter-client', version: '3.0.16'
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-validation', version: versions.springBoot
implementation group: 'uk.gov.hmcts.reform', name: 'properties-volume-spring-boot-starter', version: '0.1.0'
implementation group: 'com.github.hmcts', name: 'properties-volume-spring-boot-starter', version: '0.1.1'

implementation group: 'org.springframework.boot', name: 'spring-boot-starter-cache'
implementation group: 'com.github.ben-manes.caffeine', name: 'caffeine', version: '2.7.0'
implementation group: 'com.github.ben-manes.caffeine', name: 'caffeine', version: '3.1.8'

implementation group: 'org.springframework.security', name: 'spring-security-web'
implementation group: 'org.springframework.security', name: 'spring-security-config'
Expand All @@ -227,42 +217,52 @@ dependencies {
implementation group: 'com.nimbusds', name: 'nimbus-jose-jwt', version: '9.37.3'
implementation group: 'io.jsonwebtoken', name: 'jjwt', version: '0.9.1'

implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.10'
implementation group: 'org.apache.httpcomponents.client5', name: 'httpclient5', version: '5.3.1'

implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.14.0'
implementation group: 'org.apache.commons', name: 'commons-csv', version: '1.8'

implementation group: 'org.jdbi', name: 'jdbi', version: '2.78'

implementation group: 'org.springframework', name: 'spring-context-support'
implementation group: 'org.springframework.retry', name: 'spring-retry'
implementation group: 'org.springframework.cloud', name: 'spring-cloud-starter-openfeign'
implementation group: 'org.springframework.cloud', name: 'spring-cloud-starter-openfeign', version: '4.1.2'
implementation group: 'org.springframework.cloud', name: 'spring-cloud-openfeign-core', version: '4.1.2'

implementation group: 'io.github.openfeign', name: 'feign-httpclient', version: '13.2.1'

implementation group: 'io.github.openfeign', name: 'feign-httpclient', version: '11.2'
implementation group: 'org.springframework.cloud', name: 'spring-cloud-starter-bootstrap', version: '4.0.1'

implementation group: 'org.springframework.cloud',name : 'spring-cloud-starter-bootstrap'
implementation group: 'jakarta.json', name: 'jakarta.json-api', version: '2.1.3'
implementation group: 'jakarta.inject', name: 'jakarta.inject-api', version: '2.0.1'

implementation group: 'javax.json', name: 'javax.json-api', version: '1.1.4'
implementation group: 'javax.inject', name: 'javax.inject', version: '1'
implementation group: 'org.springframework.cloud', name: 'spring-cloud-starter-loadbalancer', version: '4.1.2'

implementation group: 'org.json', name: 'json', version: '20240303'

testImplementation group: 'org.eclipse.parsson', name: 'parsson', version: '1.1.5'

annotationProcessor group: 'org.projectlombok', name: 'lombok', version: '1.18.26'
compileOnly group: 'org.projectlombok', name: 'lombok', version: '1.18.26'

testImplementation project(':domain-sample-data')
testImplementation project(path: ":ccd-adapter", configuration: 'testArtifacts')
testImplementation group: 'io.rest-assured', name: 'rest-assured', version: versions.restAssuredVersion
testImplementation group: 'io.rest-assured', name: 'json-path', version: versions.restAssuredVersion
testImplementation group: 'io.rest-assured', name: 'rest-assured-common', version: versions.restAssuredVersion
testImplementation group: 'io.rest-assured', name: 'xml-path', version: versions.restAssuredVersion
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: 'rest-assured-common', version: versions.restAssured
testImplementation group: 'io.rest-assured', name: 'xml-path', version: versions.restAssured

testImplementation group: 'org.springframework.boot', name: 'spring-boot-starter-test'
testImplementation group: 'org.springframework.cloud', name: 'spring-cloud-contract-wiremock'

testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: versions.junit
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: versions.junit
testImplementation group: 'org.junit.vintage', name: 'junit-vintage-engine', version: versions.junit

testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-params', version: versions.junit
testImplementation group: 'org.junit.platform', name: 'junit-platform-commons', version: versions.junitPlatform
testImplementation group: 'org.junit.platform', name: 'junit-platform-engine', version: versions.junitPlatform
testImplementation group: 'org.assertj', name: 'assertj-core', version: '3.20.2'
testImplementation group: 'org.assertj', name: 'assertj-core', version: '3.25.3'
testImplementation group: 'org.mockito', name: 'mockito-core', version: '3.11.2'
testImplementation group: 'org.mockito', name: 'mockito-junit-jupiter', version: '3.8.0'
testImplementation group: 'org.powermock', name: 'powermock-api-mockito2', version: '2.0.2'
Expand All @@ -273,7 +273,7 @@ dependencies {
testImplementation group: 'net.jodah', name: 'failsafe', version: '2.4.0'
testImplementation group: 'org.xmlunit', name: 'xmlunit-core', version: '2.8.2'
testImplementation group: 'org.xmlunit', name: 'xmlunit-matchers', version: '2.8.2'
testImplementation 'com.github.hmcts:fortify-client:1.2.1:all'
testImplementation 'com.github.hmcts:fortify-client:1.4.1:all'

integrationTestImplementation sourceSets.main.runtimeClasspath
integrationTestImplementation sourceSets.test.runtimeClasspath
Expand Down Expand Up @@ -312,7 +312,7 @@ dependencies {
integrationTestImplementation project(':domain-model')
}

test {
tasks.withType(Test) {
useJUnitPlatform()
}

Expand Down
4 changes: 2 additions & 2 deletions ccd-adapter/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ dependencies {
compileOnly group: 'org.projectlombok', name: 'lombok', version: '1.18.26'

testImplementation group: 'org.springframework.boot', name: 'spring-boot-starter-test'
testImplementation group: 'junit', name: 'junit', version: '4.13.1'
testImplementation group: 'org.assertj', name: 'assertj-core', version: '3.20.2'
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: '5.10.1'
testImplementation group: 'org.assertj', name: 'assertj-core', version: '3.25.3'
testImplementation project(':domain-sample-data')
testImplementation project(':ccd-sample-data')
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package uk.gov.hmcts.cmc.ccd.domain;

import org.junit.Test;
import org.junit.jupiter.api.Test;

import static org.assertj.core.api.Assertions.assertThat;
import static uk.gov.hmcts.cmc.ccd.domain.CCDYesNoOption.NO;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package uk.gov.hmcts.cmc.ccd.mapper;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.junit.jupiter.SpringExtension;
import uk.gov.hmcts.cmc.ccd.config.CCDAdapterConfig;
import uk.gov.hmcts.cmc.ccd.domain.CCDAddress;
import uk.gov.hmcts.cmc.domain.models.Address;
Expand All @@ -15,7 +15,7 @@

@SpringBootTest
@ContextConfiguration(classes = CCDAdapterConfig.class)
@RunWith(SpringJUnit4ClassRunner.class)
@ExtendWith(SpringExtension.class)
public class AddressMapperTest {

@Autowired
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package uk.gov.hmcts.cmc.ccd.mapper;

import junit.framework.AssertionFailedError;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.opentest4j.AssertionFailedError;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.junit.jupiter.SpringExtension;
import uk.gov.hmcts.cmc.ccd.config.CCDAdapterConfig;
import uk.gov.hmcts.cmc.ccd.domain.CCDCase;
import uk.gov.hmcts.cmc.domain.models.Claim;
Expand All @@ -17,7 +17,7 @@

@SpringBootTest
@ContextConfiguration(classes = CCDAdapterConfig.class)
@RunWith(SpringJUnit4ClassRunner.class)
@ExtendWith(SpringExtension.class)
public class BespokeOrderDirectionMapperTest {

@Autowired
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package uk.gov.hmcts.cmc.ccd.mapper;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.test.context.junit.jupiter.SpringExtension;

import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static uk.gov.hmcts.cmc.ccd.domain.CaseEvent.CCJ_REQUEST_UPLOAD;
import static uk.gov.hmcts.cmc.ccd.domain.CaseEvent.CLAIM_ISSUE_RECEIPT_UPLOAD;
import static uk.gov.hmcts.cmc.ccd.domain.CaseEvent.DEFENDANT_RESPONSE_UPLOAD;
Expand All @@ -18,7 +18,7 @@
import static uk.gov.hmcts.cmc.domain.models.ClaimDocumentType.SEALED_CLAIM;
import static uk.gov.hmcts.cmc.domain.models.ClaimDocumentType.SETTLEMENT_AGREEMENT;

@RunWith(JUnit4.class)
@ExtendWith(SpringExtension.class)
public class CaseEventMapperTest {

@Test
Expand Down
Loading