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 - test springboot3 #2927

Closed
wants to merge 61 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
6399334
upgrade spring boot
Jefex7 May 1, 2024
f2b4adc
javax to jakarta
Jefex7 May 1, 2024
e448564
Solve deprecations
Jefex7 May 1, 2024
b4fefba
upgrade dependencies 2 & fix checkstyle
Jefex7 May 10, 2024
150a7a6
Changed depdendencies
Jefex7 May 15, 2024
c41945c
Fix deprecations
Jefex7 May 15, 2024
11c79d3
Upgrade Dependencies to fix CVEs
Jefex7 May 15, 2024
5ecc6a9
upgrade dependencies 3
Jefex7 May 15, 2024
11b2314
Exclude Dependency to fix CVE
Jefex7 May 16, 2024
4c04af0
change codeQl config
Jefex7 Jun 12, 2024
dc34359
upgrade sonarqube & remove wrong method
Jefex7 Jun 12, 2024
e9c34c5
Changed application.yml
Jefex7 May 22, 2024
4da759e
upgrade dependencies & solve deprecations
Jefex7 Jun 12, 2024
04d9ef4
upgrading dependencies & fix checkstyle
Jefex7 Jun 12, 2024
20272d9
add suprression
Jefex7 Jun 12, 2024
37a1002
changed gradle test for JunitPlatform
Jefex7 Jun 17, 2024
6247edc
add dependencies
Jefex7 Jun 19, 2024
8ced8dd
fix error
Jefex7 Jun 19, 2024
76b6704
Remove config
Jefex7 Jun 19, 2024
f846cbe
Fix error and add suppress CVE
Jefex7 Jun 19, 2024
d7da6e4
Disable functional test class creating too many request error.
Jefex7 Jun 24, 2024
ebec9ee
Update build.gradle
Jefex7 Jun 24, 2024
f38ec1b
Upgrade Caffeine dependency & Correct Annotation
Jefex7 Jun 24, 2024
1fbcb1a
Merge branch 'master' into DTSCCI-217_TestSpringboot3
Jefex7 Jun 27, 2024
0a89731
Fix error in dependencies & checkstyle
Jefex7 Jun 27, 2024
c293eea
add logging
Jefex7 Jun 27, 2024
df2cada
add logging 2
Jefex7 Jun 27, 2024
091e061
Merge branch 'master' into DTSCCI-217_TestSpringboot3
Jefex7 Jul 1, 2024
57e9c03
Try Manual Caching
EllisD-B Jul 1, 2024
f4a82cc
Add logging
EllisD-B Jul 1, 2024
6f81f3e
exclude for testing.
Jefex7 Jul 1, 2024
c3bcd4e
adding dependencies
Jefex7 Jul 1, 2024
a279823
Merge conflicts
Jefex7 Jul 2, 2024
bfeb328
Remove Disable
Jefex7 Jul 2, 2024
1bb8296
Remove unused import
Jefex7 Jul 2, 2024
30435c9
Fix Checkstyle
Jefex7 Jul 2, 2024
5badaf2
remove retry for functional Test class
Jefex7 Jul 2, 2024
36a0dcd
re add config to gradle
Jefex7 Jul 2, 2024
2c4fd16
upgrade retry dependency and change the retryable config.
Jefex7 Jul 2, 2024
960a0cd
Test Functional test with some disabled.
Jefex7 Jul 3, 2024
4b9808d
try more recent version springboot
Jefex7 Jul 3, 2024
f36ca4b
Remove Spring Extension
Jefex7 Jul 3, 2024
d48cdda
Test @Retryable & missing jakarta
Jefex7 Jul 3, 2024
0f0a372
Fix Checkstyle
Jefex7 Jul 3, 2024
843c97d
Merge branch 'master' into DTSCCI-217_TestSpringboot3
EllisD-B Jul 8, 2024
da7154a
Checkstyle + resolve conflicts
EllisD-B Jul 8, 2024
a0b2109
Add consumption + production http type to fact feing
EllisD-B Jul 8, 2024
bab864e
Make json parser available in main sourceSet
EllisD-B Jul 8, 2024
a2cfbd1
Add logs for debug
EllisD-B Jul 8, 2024
9c263b0
Add sendgrid testing enabled to base test
EllisD-B Jul 9, 2024
3be11b3
add classpath
EllisD-B Jul 10, 2024
9442d42
Move default to application.yml
EllisD-B Jul 10, 2024
bfec903
revert test property source
EllisD-B Jul 10, 2024
33f23be
Merge branch 'master' into DTSCCI-217_TestSpringboot3
ed14537 Jul 10, 2024
c85a942
default testing to true
EllisD-B Jul 11, 2024
0715dd0
default testing to false
EllisD-B Jul 11, 2024
c2c4815
remove env test property
EllisD-B Jul 11, 2024
a5f0bdf
Enable testing
EllisD-B Jul 11, 2024
7e64fce
Add testing to application yml
EllisD-B Jul 11, 2024
96d1bab
More logging
EllisD-B Jul 15, 2024
2b3d19e
More logging
EllisD-B Jul 15, 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
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
122 changes: 64 additions & 58 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {
id 'uk.gov.hmcts.java' version '0.12.43'
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.7'
id 'org.owasp.dependencycheck' version '8.0.1'
id 'org.sonarqube' version '5.0.0.4638'
id 'com.github.ben-manes.versions' version '0.51.0'
Expand All @@ -28,15 +28,15 @@ 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,
restAssuredVersion: '4.2.0',
jackson : '2.17.0',
junit : '5.10.1',
junitPlatform : '1.10.2',
logback : '1.5.6',
springBoot : springBootVersion,
restAssured : '5.4.0',
jackson : '2.17.1',
junit : '5.10.1',
junitPlatform : '1.10.2',
pact_version : '4.1.7',
serviceAuthVersion : '4.0.3',
idamJavaClient : '2.0.1',
Expand Down Expand Up @@ -148,41 +148,41 @@ 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...
dependency group: 'com.google.guava', name: 'guava', version: '33.1.0-jre'

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

dependency group: 'org.bouncycastle', name: 'bcprov-jdk18on', version: '1.77'

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

dependencySet(group: 'ch.qos.logback', version: '1.2.13') {
entry 'logback-core'
entry 'logback-classic'
//Solves CVE-2023-35116
dependencySet(group: 'com.fasterxml.jackson.core', version: versions.jackson) {
entry 'jackson-core'
entry 'jackson-annotations'
entry 'jackson-databind'
}

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-2976, CVE-2018-10237, CVE-2020-8908
dependency group: 'com.google.guava', name: 'guava', version: '33.1.0-jre'

//Solves CVE-2023-33201
dependency group: 'org.bouncycastle', name: 'bcprov-jdk18on', version: '1.77'
}
}
}
Expand Down Expand Up @@ -217,14 +217,12 @@ dependencies {
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-validation'
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-quartz'

implementation group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.20.0'
implementation group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.20.0'

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

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: 'ch.qos.logback', name: 'logback-classic', version: versions.logback
implementation group: 'ch.qos.logback', name: 'logback-core', version: versions.logback
implementation group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.20.0'
implementation group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.20.0'

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

Expand All @@ -237,24 +235,26 @@ 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: '5.1.7'
implementation group: 'uk.gov.hmcts.reform', name: 'logging-appinsights', version: '5.1.7'
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: '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

Expand All @@ -268,33 +268,40 @@ 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.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.retry', name: 'spring-retry', version: '2.0.6'
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: 'org.springframework.cloud',name : 'spring-cloud-starter-bootstrap'
implementation group: 'org.springframework.cloud', name: 'spring-cloud-starter-bootstrap', version: '4.0.1'

implementation group: 'org.json', name: 'json', version: '20240303'
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'
implementation 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'
Expand All @@ -316,7 +323,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 All @@ -340,9 +347,6 @@ dependencies {
contractTestImplementation sourceSets.main.runtimeClasspath
contractTestImplementation sourceSets.test.runtimeClasspath
}
configurations.all {
exclude group: 'com.vaadin.external.google', module: 'android-json'
}

dependencies {
testImplementation project(path: ':domain-model')
Expand All @@ -353,8 +357,6 @@ dependencies {
integrationTestImplementation project(':domain-model')
}



task contract(type: Test) {
description = 'Runs the consumer Pact tests'
useJUnitPlatform()
Expand Down Expand Up @@ -412,6 +414,10 @@ task migrateClaims() {

tasks.withType(Test) {
useJUnitPlatform()

testLogging {
exceptionFormat = 'full'
}
}

task functional(type: Test) {
Expand All @@ -422,7 +428,6 @@ task functional(type: Test) {
include "uk/gov/hmcts/cmc/claimstore/tests/functional/**"
testLogging.showStandardStreams = true


environment("APPINSIGHTS_INSTRUMENTATIONKEY", "test-key")
}

Expand Down Expand Up @@ -490,6 +495,7 @@ sonarqube {
"**/cmc/claimstore/services/ccd/callbacks/ioc/FeesAndPaymentsConfiguration.java",
"**/cmc/claimstore/services/ccd/callbacks/HWFMiscellaneousCallbackHandler.java",
"**/cmc/claimstore/services/ccd/callbacks/HWFFullAndPartRemissionCallbackHandler.java",
"**/cmc/claimstore/services/UserService.java",
"**/cmc/claimstore/courtfinder/models/**",
"**/ccd/migration/**",
"**/EmailData.java",
Expand Down
4 changes: 1 addition & 3 deletions config/owasp/suppressions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
<suppress>
<cve>CVE-2023-39017</cve>
<cve>CVE-2022-45688</cve>
<cve>CVE-2024-23446</cve>
<cve>CVE-2024-22257</cve>
<cve>CVE-2023-6378</cve>
<cve>CVE-2023-5072</cve>
<cve>CVE-2023-33202</cve>
</suppress>
</suppressions>
10 changes: 4 additions & 6 deletions domain-model/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,26 @@ repositories {

dependencies {
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-json'

implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.14.0'
implementation group: 'cz.jirutka.validator', name: 'validator-collection', version: '2.2.0'

// The below fixes https://nvd.nist.gov/vuln/detail/CVE-2019-12384 while waiting for spring to pull new version
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.17.0'

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 group: 'org.mockito', name: 'mockito-core', version: '5.11.0'
testImplementation group: 'org.assertj', name: 'assertj-core', version: '3.25.3'
testImplementation group: 'javax.el', name: 'javax.el-api', version: '3.0.0'
testImplementation group: 'org.glassfish.web', name: 'javax.el', version: '2.2.6'
testImplementation group: 'jakarta.el', name: 'jakarta.el-api', version: '6.0.0'
testImplementation group: 'org.glassfish', name: 'jakarta.el', version: '4.0.2'
testImplementation group: 'com.google.guava', name: 'guava', version: '32.0.1-jre'
testImplementation group: 'org.mockito', name: 'mockito-junit-jupiter', version: '3.8.0'
testImplementation group: 'org.junit.jupiter', name:'junit-jupiter-params', version:'5.10.1'
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: '5.10.1'
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: '5.9.3'
testImplementation group: 'org.junit.platform', name: 'junit-platform-commons', version: '1.10.2'

}

test {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package uk.gov.hmcts.cmc.domain.constraints;

import jakarta.validation.ConstraintValidator;
import jakarta.validation.ConstraintValidatorContext;

import java.time.LocalDate;
import java.time.temporal.ChronoUnit;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;

public class AgeRangeConstraintValidator implements ConstraintValidator<AgeRangeValidator, LocalDate> {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
package uk.gov.hmcts.cmc.domain.constraints;

import jakarta.validation.Constraint;
import jakarta.validation.Payload;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import javax.validation.Constraint;
import javax.validation.Payload;

@Documented
@Constraint(validatedBy = AgeRangeConstraintValidator.class)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package uk.gov.hmcts.cmc.domain.constraints;

import jakarta.validation.ConstraintViolation;
import jakarta.validation.Validation;
import jakarta.validation.ValidatorFactory;
import org.apache.commons.lang3.StringUtils;

import java.util.Set;
import java.util.stream.Collectors;
import javax.validation.ConstraintViolation;
import javax.validation.Validation;
import javax.validation.ValidatorFactory;

public class BeanValidator {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
package uk.gov.hmcts.cmc.domain.constraints;

import jakarta.validation.Constraint;
import jakarta.validation.Payload;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import javax.validation.Constraint;
import javax.validation.Payload;

@Documented
@Constraint(validatedBy = ClaimantAmountConstraintValidator.class)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
package uk.gov.hmcts.cmc.domain.constraints;

import jakarta.validation.ConstraintValidator;
import jakarta.validation.ConstraintValidatorContext;
import uk.gov.hmcts.cmc.domain.models.AmountRow;

import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;

public class ClaimantAmountConstraintValidator implements ConstraintValidator<ClaimantAmount, AmountRow> {

@Override
Expand Down
Loading