Skip to content

Commit

Permalink
Befta-fw 9.0.2, ccd-test-definitions 7.22.2, gradle 8.7 (#2434)
Browse files Browse the repository at this point in the history
* Befta-fw 9.0.1, ccd-test-definitions 7.22.1, gradle 8.7

* fix jacocoTestReport location

* Bump commons, remove latest-version plugin

* commons-io strictly 2.16.1

* Bump befta-fw to 9.0.2

* bump  ccd-test-definitions to 7.22.2

* Fix double spaces in 1002 and 13010 features

* Fix double spacing in feature f-1002

* Update values.preview.template.yaml

* Update values.preview.template.yaml

revert to use ccd-def pr 575

* empty commit to trigger build

---------

Co-authored-by: dinesh1patel <[email protected]>
Co-authored-by: Dinesh Patel <[email protected]>
  • Loading branch information
3 people committed Jul 16, 2024
1 parent 8674dd6 commit 4da6b38
Show file tree
Hide file tree
Showing 8 changed files with 87 additions and 68 deletions.
98 changes: 51 additions & 47 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,15 @@ plugins {
id 'jacoco'
id 'idea'
id 'eclipse'
id 'org.springframework.boot' version '2.1.0.RELEASE'
id 'com.github.ben-manes.versions' version '0.20.0'
id 'io.spring.dependency-management' version '1.1.4'
id 'org.sonarqube' version '4.2.0.3129'
id 'org.springframework.boot' version '2.7.12'
id 'com.github.ben-manes.versions' version '0.51.0'
id 'io.spring.dependency-management' version '1.1.5'
id 'org.sonarqube' version '5.0.0.4638'
id 'com.github.kt3k.coveralls' version '2.8.2'
id 'se.patrikerdes.use-latest-versions' version '0.2.7'
id 'com.github.spacialcircumstances.gradle-cucumber-reporting' version '0.1.23'
id 'com.github.spacialcircumstances.gradle-cucumber-reporting' version '0.1.25'
id 'org.jetbrains.gradle.plugin.idea-ext' version '0.7'
id 'info.solidsoft.pitest' version '1.4.0'
id 'uk.gov.hmcts.java' version '0.12.43'
id 'info.solidsoft.pitest' version '1.15.0'
id 'uk.gov.hmcts.java' version '0.12.57'
id 'au.com.dius.pact' version '4.1.0'
id "org.jsonschema2pojo" version "1.2.1"
}
Expand Down Expand Up @@ -60,7 +59,33 @@ dependencyCheck {
suppressionFile = 'dependency-check-suppressions.xml'
}

mainClassName = 'uk.gov.hmcts.ccd.CoreCaseDataApplication'
application {
mainClass = 'uk.gov.hmcts.ccd.CoreCaseDataApplication'
}

sourceSets {
aat {
java {
srcDir('src/aat/java')
compileClasspath += main.output
runtimeClasspath += main.output
}
resources {
srcDir('src/aat/resources')
}
}

contractTest {
java {
srcDir('src/contractTest/java')
compileClasspath += main.output
runtimeClasspath += main.output
}
resources {
srcDir('src/contractTest/resources')
}
}
}

// tag::repositories[]
repositories {
Expand Down Expand Up @@ -88,7 +113,6 @@ ext {
'class' : 98
]
springCloudVersion = '2021.0.3'
beftaFwVersion = '8.8.5'
}

java {
Expand Down Expand Up @@ -168,6 +192,12 @@ dependencies {
}
}

implementation('commons-io:commons-io') {
version {
strictly '2.16.1'
}
}


implementation 'com.google.code.gson:gson:2.8.9'
implementation group: 'org.springframework.cloud', name: 'spring-cloud-starter-openfeign', version: '3.1.9'
Expand Down Expand Up @@ -238,7 +268,7 @@ dependencies {
implementation "org.glassfish:jakarta.el:4.0.1"

implementation group: 'commons-fileupload', name: 'commons-fileupload', version: '1.5'
implementation group: 'commons-io', name: 'commons-io', version: '2.8.0'
implementation group: 'commons-io', name: 'commons-io', version: '2.16.1'

// use the latest org.springframework.security
implementation group: 'org.springframework.security', name: 'spring-security-core'
Expand Down Expand Up @@ -306,10 +336,8 @@ dependencies {
implementation 'org.jooq:jool-java-8:0.9.14'
implementation 'com.github.hmcts:ccd-case-document-am-client:1.7.1'

testImplementation group: 'com.github.hmcts', name: 'ccd-test-definitions', version: '7.21.22'

testImplementation group: 'com.github.hmcts', name: 'befta-fw', version: beftaFwVersion
testRuntimeOnly group: 'com.github.hmcts', name: 'befta-fw', version: beftaFwVersion
testImplementation group: 'com.github.hmcts', name: 'ccd-test-definitions', version: '7.22.2'
testImplementation group: 'com.github.hmcts', name: 'befta-fw', version: '9.0.2'

contractTestImplementation "org.junit.jupiter:junit-jupiter-api:${junitJupiterVersion}"
contractTestImplementation "org.junit.jupiter:junit-jupiter-engine:${junitJupiterVersion}"
Expand Down Expand Up @@ -440,16 +468,16 @@ pitest {
]

enableDefaultIncrementalAnalysis = true
historyInputLocation = ['build/reports/pitest/fastermutationtesting']
historyOutputLocation = ['build/reports/pitest/fastermutationtestingoutput']
historyInputLocation = 'build/reports/pitest/fastermutationtesting'
historyOutputLocation = 'build/reports/pitest/fastermutationtestingoutput'
threads = 15
testSourceSets = [sourceSets.test]
mainSourceSets = [sourceSets.main]
fileExtensionsToFilter.addAll('xml','json')
outputFormats = ['XML', 'HTML','CSV']
mutationThreshold = 4
coverageThreshold = 4
maxMutationsPerClass = 15
features = ["+CLASSLIMIT(limit[15])"]
jvmArgs = ['-Xms1G','-Xmx3G']
timestampedReports = false
failWhenNoMutations = false
Expand Down Expand Up @@ -636,7 +664,7 @@ sonarqube {
"**/TestingSupportController.java"
property "sonar.projectName", "ccd-data-store-api"
property "sonar.projectKey", "ccd-data-store-api"
property "sonar.coverage.jacoco.xmlReportPaths", "${jacocoTestReport.reports.xml.destination.path}"
property "sonar.coverage.jacoco.xmlReportPaths", "${jacocoTestReport.reports.xml.outputLocation}"
}
}

Expand Down Expand Up @@ -685,7 +713,7 @@ jacocoTestReport {
}

doLast {
def report = file("${jacoco.reportsDir}/test/jacocoTestReport.xml")
def report = file("${buildDir}/reports/jacoco/test/jacocoTestReport.xml")
logger.lifecycle("Checking coverage results: ${report}")

def parser = new XmlParser()
Expand Down Expand Up @@ -774,32 +802,8 @@ test {

check.dependsOn jacocoTestReport

sourceSets {
aat {
java {
srcDir('src/aat/java')
compileClasspath += main.output
runtimeClasspath += main.output
}
resources {
srcDir('src/aat/resources')
}
}

contractTest {
java {
srcDir('src/contractTest/java')
compileClasspath += main.output
runtimeClasspath += main.output
}
resources {
srcDir('src/contractTest/resources')
}
}
}

task fortifyScan(type: JavaExec) {
main = "uk.gov.hmcts.fortifyclient.FortifyClientMainApp"
mainClass = "uk.gov.hmcts.fortifyclient.FortifyClientMainApp"
classpath += sourceSets.test.runtimeClasspath
jvmArgs = ['--add-opens=java.base/java.lang.reflect=ALL-UNNAMED']
// The line below prevents the build from failing if the Fortify scan detects issues
Expand Down Expand Up @@ -953,15 +957,15 @@ void reloadEnvSecrets(String env) {
}

task runRemoteDemo(type: JavaExec) {
mainClass = mainClassName
mainClass = 'uk.gov.hmcts.ccd.CoreCaseDataApplication'
classpath = sourceSets.main.runtimeClasspath
doFirst() {
configRemoteRunTask(it, 'demo')
}
}

task runRemoteAAT(type: JavaExec) {
mainClass = mainClassName
mainClass = 'uk.gov.hmcts.ccd.CoreCaseDataApplication'
classpath = sourceSets.main.runtimeClasspath
doFirst() {
configRemoteRunTask(it, 'aat')
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
18 changes: 14 additions & 4 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
Expand All @@ -80,10 +80,10 @@ do
esac
done

APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

APP_NAME="Gradle"
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
Expand Down Expand Up @@ -143,12 +143,16 @@ fi
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down Expand Up @@ -205,6 +209,12 @@ set -- \
org.gradle.wrapper.GradleWrapperMain \
"$@"

# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1
then
die "xargs is not available"
fi

# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
Expand Down
15 changes: 9 additions & 6 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
@rem limitations under the License.
@rem

@if "%DEBUG%" == "" @echo off
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
Expand All @@ -25,7 +25,8 @@
if "%OS%"=="Windows_NT" setlocal

set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

Expand All @@ -40,7 +41,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto execute
if %ERRORLEVEL% equ 0 goto execute

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Expand Down Expand Up @@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar

:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
if %ERRORLEVEL% equ 0 goto mainEnd

:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
set EXIT_CODE=%ERRORLEVEL%
if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%

:mainEnd
if "%OS%"=="Windows_NT" endlocal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
@RunWith(Cucumber.class)
@CucumberOptions(plugin = "json:target/cucumber.json",
glue = {"uk.gov.hmcts.befta.player"},
features = { "classpath:features" }, tags = { "(not @Ignore) or (not @elasticsearch)" })
features = { "classpath:features" },
tags = "(not @Ignore) or (not @elasticsearch)")
public class DataStoreBeftaRunner {

private DataStoreBeftaRunner() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Feature: F-1002: Submit Event for an Existing Case
And another successful call [to create a token for case creation] as in [Befta_Jurisdiction2_Default_Token_Creation_Data_For_Case_Creation],
And another successful call [by same user to create a case of this case type] as in [F-1002-Case_Creation_Data],
And another successful call [to upload a document with mandatory metadata] as in [Default_Document_Upload_Data],
And another successful call [to get an update event token for the case just created] as in [S-1011-Update_Event_Token_Creation],
And another successful call [to get an update event token for the case just created] as in [S-1011-Update_Event_Token_Creation],
When a request is prepared with appropriate values,
And the request [contains an Event Id received from upstream],
And the request [contains a Case Id and Document Id created above],
Expand Down Expand Up @@ -42,7 +42,7 @@ Feature: F-1002: Submit Event for an Existing Case
And a successful call [by same user to upload a document with mandatory metadata] as in [Default_Document_Upload_1],
And a successful call [by same user to upload another document with mandatory metadata] as in [Default_Document_Upload_2],
And a successful call [by same user to upload another document with mandatory metadata] as in [Default_Document_Upload_3],
And another successful call [to get an update event token for the case just created] as in [S-1013-Update_Event_Token_Creation],
And another successful call [to get an update event token for the case just created] as in [S-1013-Update_Event_Token_Creation],
When a request is prepared with appropriate values,
And the request [contains an Event Id received from upstream],
And the request [contains the Case Id along with ids and hash tokens of the documents uploaded above],
Expand All @@ -58,7 +58,7 @@ Feature: F-1002: Submit Event for an Existing Case
And another successful call [to create a token for case creation] as in [Befta_Jurisdiction2_Default_Token_Creation_Data_For_Case_Creation],
And another successful call [by same user to create a case of this case type] as in [F-1002-Case_Creation_Data],
And another successful call [to upload a document with mandatory metadata] as in [Default_Document_Upload_Data],
And another successful call [to get an update event token for the case just created] as in [S-1014-Update_Event_Token_Creation],
And another successful call [to get an update event token for the case just created] as in [S-1014-Update_Event_Token_Creation],
When a request is prepared with appropriate values,
And the request [contains an Event Id received from upstream],
And the request [is to update the case created above, with some updates in non document fields and the Document field],
Expand All @@ -74,7 +74,7 @@ Feature: F-1002: Submit Event for an Existing Case
And another successful call [to create a token for case creation] as in [Befta_Jurisdiction2_Default_Token_Creation_Data_For_Case_Creation],
And another successful call [by same user to create a case of this case type] as in [F-1002-Case_Creation_Data],
And another successful call [to upload a document with mandatory metadata] as in [Default_Document_Upload_Data],
And another successful call [to get an update event token for the case just created] as in [S-1015-Update_Event_Token_Creation],
And another successful call [to get an update event token for the case just created] as in [S-1015-Update_Event_Token_Creation],
When a request is prepared with appropriate values,
And the request [contains a non existing document Id],
And it is submitted to call the [Submit Event for an Existing Case] operation of [CCD Data Store],
Expand All @@ -87,7 +87,7 @@ Feature: F-1002: Submit Event for an Existing Case
And another successful call [to create a token for case creation] as in [Befta_Jurisdiction2_Default_Token_Creation_Data_For_Case_Creation],
And another successful call [by same user to create a case of this case type] as in [F-1002-Case_Creation_Data],
And another successful call [to upload a document with mandatory metadata] as in [Default_Document_Upload_Data],
And another successful call [to get an update event token for the case just created] as in [S-1016-Update_Event_Token_Creation],
And another successful call [to get an update event token for the case just created] as in [S-1016-Update_Event_Token_Creation],
When a request is prepared with appropriate values,
And the request [contains a malformed document Id],
And it is submitted to call the [Submit Event for an Existing Case] operation of [CCD Data Store],
Expand All @@ -100,7 +100,7 @@ Feature: F-1002: Submit Event for an Existing Case
And another successful call [to create a token for case creation] as in [Befta_Jurisdiction2_Default_Token_Creation_Data_For_Case_Creation],
And another successful call [by same user to create a case of this case type] as in [F-1002-Case_Creation_Data],
And another successful call [to upload a document with mandatory metadata] as in [Default_Document_Upload_Data],
And another successful call [to get an update event token for the case just created] as in [S-1017-Update_Event_Token_Creation],
And another successful call [to get an update event token for the case just created] as in [S-1017-Update_Event_Token_Creation],
When a request is prepared with appropriate values,
And the request [contains a non existing Case Id],
And it is submitted to call the [Submit Event for an Existing Case] operation of [CCD Data Store],
Expand All @@ -113,7 +113,7 @@ Feature: F-1002: Submit Event for an Existing Case
And another successful call [to create a token for case creation] as in [Befta_Jurisdiction2_Default_Token_Creation_Data_For_Case_Creation],
And another successful call [by same user to create a case of this case type] as in [F-1002-Case_Creation_Data],
And another successful call [to upload a document with mandatory metadata] as in [Default_Document_Upload_Data],
And another successful call [to get an update event token for the case just created] as in [S-1018-Update_Event_Token_Creation],
And another successful call [to get an update event token for the case just created] as in [S-1018-Update_Event_Token_Creation],
When a request is prepared with appropriate values,
And the request [contains a malformed Case Id],
And it is submitted to call the [Submit Event for an Existing Case] operation of [CCD Data Store],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ Feature: F-13010: Case Access Category Tests
Given a case that has just been created as in [F-13010.2_CreateCase],
And a user with [an active profile in CCD],
When a request is prepared with appropriate values,
And [Role Assignments that don't apply for the scenario of creating a case have been filtered out] in the context,
And [the RoleToAccessProfiles tab contains CaseAccessCategory with pattern - Civil/Standard, Criminal/Serious] in the context,
And [Role Assignments that don't apply for the scenario of creating a case have been filtered out] in the context,
And [the RoleToAccessProfiles tab contains CaseAccessCategory with pattern - Civil/Standard, Criminal/Serious] in the context,
And [the case C1 contains an CaseAccessCategory field value as FamilyLaw/Standard] in the context,
And it is submitted to call the [external get case] operation of [CCD Data Store],
Then a negative response is received
Expand Down

0 comments on commit 4da6b38

Please sign in to comment.