Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
43 changes: 20 additions & 23 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ plugins {
id 'com.github.kt3k.coveralls' version '2.12.2'
id 'com.github.spacialcircumstances.gradle-cucumber-reporting' version '0.1.25'
id 'org.jetbrains.gradle.plugin.idea-ext' version '1.4.1'
id 'info.solidsoft.pitest' version '1.15.0'
id 'info.solidsoft.pitest' version '1.19.0-rc.3'
id 'uk.gov.hmcts.java' version '0.12.68'
id 'au.com.dius.pact' version '4.6.20'
id 'org.jsonschema2pojo' version '1.2.2'
Expand Down Expand Up @@ -244,7 +244,7 @@ dependencies {
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-jdbc'
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-oauth2-resource-server'
implementation group: 'org.springframework.cloud', name: 'spring-cloud-starter-openfeign'
implementation group: 'org.springframework.cloud', name: 'spring-cloud-starter-loadbalancer'
implementation group: 'org.springframework.cloud', name: 'spring-cloud-starter-loadbalancer', version: '4.3.1'
implementation group: 'org.springframework.hateoas', name: 'spring-hateoas'
implementation group: 'org.springframework.plugin', name: 'spring-plugin-core'
implementation group: 'org.springframework.retry', name: 'spring-retry'
Expand Down Expand Up @@ -304,7 +304,7 @@ dependencies {
testImplementation group: 'io.rest-assured', name: 'rest-assured', version: '5.5.6'
testImplementation group: 'org.assertj', name: 'assertj-vavr', version: '0.5.0'
testImplementation group: 'org.springframework.boot', name: 'spring-boot-starter-test'
testImplementation group: 'org.springframework.cloud', name: 'spring-cloud-starter-contract-stub-runner'
testImplementation group: 'org.springframework.cloud', name: 'spring-cloud-starter-contract-stub-runner', version: '4.3.1'
testImplementation group: 'org.testcontainers', name: 'testcontainers', version: testContainersVersion
testImplementation group: 'org.testcontainers', name: 'postgresql', version: testContainersVersion
testImplementation group: 'org.testcontainers', name: 'elasticsearch', version: testContainersVersion
Expand All @@ -313,6 +313,7 @@ dependencies {
testImplementation group: 'com.github.hmcts', name: 'ccd-test-definitions', version: ccdTestDefinitionVersion
testImplementation group: 'com.github.hmcts', name: 'befta-fw', version: beftaFwVersion
testImplementation group: 'com.github.hmcts', name: 'fortify-client', version: '1.4.10', classifier: 'all'
testImplementation 'org.springframework.cloud:spring-cloud-contract-wiremock:4.3.1'

contractTestImplementation group: 'au.com.dius.pact.provider', name: 'junit5', version: pactProviderVersion
contractTestImplementation group: 'au.com.dius.pact.provider', name: 'spring', version: pactProviderVersion
Expand Down Expand Up @@ -623,7 +624,7 @@ jacocoTestReport {
def report = file("${buildDir}/reports/jacoco/test/jacocoTestReport.xml")
logger.lifecycle("Checking coverage results: ${report}")

def parser = new XmlParser()
def parser = new groovy.xml.XmlParser()
parser.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false);
parser.setFeature("http://apache.org/xml/features/disallow-doctype-decl", false)
def results = parser.parse(report)
Expand Down Expand Up @@ -719,11 +720,11 @@ task fortifyScan(type: JavaExec) {

idea {
module {
// config to allow Intelij to mark test source and resource files correctly to help linting tools
testSourceDirs += project.sourceSets.aat.java.srcDirs
testSourceDirs += project.sourceSets.contractTest.java.srcDirs
testResourceDirs += project.sourceSets.aat.resources.srcDirs
testResourceDirs += project.sourceSets.contractTest.resources.srcDirs
// config to allow InteliJ to mark test source and resource files correctly to help linting tools
testSources.from(project.sourceSets.aat.java.srcDirs)
testSources.from(project.sourceSets.contractTest.java.srcDirs)
testResources.from(project.sourceSets.aat.resources.srcDirs)
testResources.from(project.sourceSets.contractTest.resources.srcDirs)
}
}

Expand All @@ -735,7 +736,7 @@ task highLevelDataSetup(type: JavaExec) {
jvmArgs = ['--add-opens=java.base/java.lang.reflect=ALL-UNNAMED']
}

task smoke() {
task smoke(type: JavaExec) {
description = 'Executes smoke tests against an the CCD Data Store API instance just deployed'
dependsOn aatClasses

Expand All @@ -745,19 +746,15 @@ task smoke() {
into "$buildDir/test-results/test"
}

doLast {
generateCucumberReports.enabled = true
javaexec {
mainClass = "uk.gov.hmcts.ccd.datastore.befta.DataStoreBeftaMain"
classpath += configurations.cucumberRuntime + sourceSets.aat.runtimeClasspath
args = ['--plugin', "json:${rootDir}/target/cucumber.json",
'--plugin', "junit:${buildDir}/test-results/smoke/cucumber.xml",
'--tags', '@Smoke and not @Ignore',
'--glue', 'uk.gov.hmcts.befta.player',
'--glue', "uk.gov.hmcts.ccd.datastore.befta", 'src/aat/resources/features']
jvmArgs = [ '--add-opens=java.base/java.lang.reflect=ALL-UNNAMED' ]
}
}
generateCucumberReports.enabled = true
mainClass = "uk.gov.hmcts.ccd.datastore.befta.DataStoreBeftaMain"
classpath += configurations.cucumberRuntime + sourceSets.aat.runtimeClasspath
args = ['--plugin', "json:${rootDir}/target/cucumber.json",
'--plugin', "junit:${buildDir}/test-results/smoke/cucumber.xml",
'--tags', '@Smoke and not @Ignore',
'--glue', 'uk.gov.hmcts.befta.player',
'--glue', "uk.gov.hmcts.ccd.datastore.befta", 'src/aat/resources/features']
jvmArgs = [ '--add-opens=java.base/java.lang.reflect=ALL-UNNAMED' ]

finalizedBy {
generateCucumberReports {
Expand Down
5 changes: 3 additions & 2 deletions gradle/suppress.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import groovy.util.slurpersupport.GPathResult
import groovy.xml.XmlSlurper
import groovy.xml.slurpersupport.GPathResult
import groovy.xml.DOMBuilder
import groovy.xml.XmlUtil
import org.w3c.dom.Document
Expand Down Expand Up @@ -114,4 +115,4 @@ task suppressCves() {
// If no argument is specified, the default report file is 'dependency-check-report.xml'
suppressCves()
}
}
}
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.0-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ public String getValue() {
}

public static List<DisplayContextParameter> getDisplayContextParametersFor(String displayContextParameter) {
List<DisplayContextParameter> displayContextParameterTypeList = new ArrayList<>();
List<String> displayContextParameters = new ArrayList<>();
final List<DisplayContextParameter> displayContextParameterTypeList = new ArrayList<>();
final List<String> displayContextParameters = new ArrayList<>();

if (Strings.isNullOrEmpty(displayContextParameter)) {
return Collections.emptyList();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ public CreateCaseEventResult createCaseSystemEvent(final String caseReference,
Event event) {
final CaseDetails caseDetails = delegatingCaseDetailsRepository.findByReference(caseReference)
.orElseThrow(() ->
new ResourceNotFoundException(format("Case with reference %s could not be found", caseReference)));
new ResourceNotFoundException(format("Case with reference %s could not be found", caseReference)));

final CaseEventDefinition caseEventDefinition = new CaseEventDefinition();
caseEventDefinition.setId("DocumentUpdated");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ private ObjectNode buildSortOrderFieldNode(CaseTypeDefinition caseTypeDefinition
ObjectNode objectNode = objectMapper.createObjectNode();
CommonField commonField =
caseTypeDefinition.getComplexSubfieldDefinitionByPath(sortOrderField.getCaseFieldId()).orElseThrow(() ->
new ServiceException(String.format("Case field '%s' does not exist in configuration for case type '%s'.",
sortOrderField.getCaseFieldId(), caseTypeDefinition.getId()))
new ServiceException(String.format("Case field '%s' does not exist in configuration for case type "
+ "'%s'.", sortOrderField.getCaseFieldId(), caseTypeDefinition.getId()))
);
FieldTypeDefinition fieldType = commonField.getFieldTypeDefinition();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ public BaseType getType() {
public List<ValidationResult> validate(final String dataFieldId,
final JsonNode dataValue,
final CaseFieldDefinition caseFieldDefinition) {
List<ValidationResult> validationResults;

// Empty text should still check against MIN - MIN may or may not be 0
if (isNullOrEmpty(dataValue)) {
Expand Down Expand Up @@ -87,6 +86,7 @@ public List<ValidationResult> validate(final String dataFieldId,
+ " does not match Document Management domain or expected URL path", dataFieldId));
}

List<ValidationResult> validationResults;
if (dataValue.has(DOCUMENT_BINARY_URL)) {
final JsonNode documentBinaryUrl = dataValue.get(DOCUMENT_BINARY_URL);
validationResults = validateDocumentBinaryURL(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ public void openMocks() {
}

/**
* <p>Test cached behaviour of getDataStoreUserAccessToken method. Caching is implemented using Spring
* Cacheable annotation so test is performed on the actual IdamRepository bean with mocked dependencies.</p>
* Test cached behaviour of getDataStoreUserAccessToken method. Caching is implemented using Spring
* Cacheable annotation so test is performed on the actual IdamRepository bean with mocked dependencies.
*
* <p>As the caching behaviour is controlled by Spring it is not reset between tests. For this reason
* all tests have to be in a single method so that state can be controlled.</p>
Expand Down