Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
91aa71b
CCD-7242 definition spreadsheet test harness added
markdathornehmcts Apr 7, 2026
e3057d6
CCD-7242 definition spreadsheet test harness added
markdathornehmcts Apr 7, 2026
4b7928d
CCD-7242 documentation added
markdathornehmcts Apr 7, 2026
8e32c9f
CCD-7242 removed unused logback configuration
markdathornehmcts Apr 13, 2026
0c7b8be
CCD-7242 using Slf4J for logging
markdathornehmcts Apr 13, 2026
ce9fbc1
CCD-7242 constants for caseventid, caasetypeid, casefieldid
markdathornehmcts Apr 13, 2026
991d6a9
CCD-7242 remove alternative name lookup for the "casetypeid" and "cas…
markdathornehmcts Apr 13, 2026
c2e4e3b
CCD-7242 remove alternative name for accessprofile column
markdathornehmcts Apr 13, 2026
9743508
CCD-7242 remove complexity and findHeaderRow
markdathornehmcts Apr 13, 2026
1b6198f
CCD-7242 deal with null headerRow
markdathornehmcts Apr 13, 2026
2489fe6
CCD-7242 remove alternative header names
markdathornehmcts Apr 13, 2026
708caaf
CCD-7242 remove unused file logback-test.xml
markdathornehmcts Apr 13, 2026
cc5e2cc
CCD-7242 code review changes
markdathornehmcts Apr 14, 2026
e96d362
CCD-7242 runnable definitionSpreadsheetHarness
markdathornehmcts Apr 20, 2026
56429f1
CCD-7242 remove ambiguous warnings for both jackson version 2 and 3
markdathornehmcts Apr 21, 2026
fd5022a
CCD-7242 moved harness to support-tools module
markdathornehmcts Apr 21, 2026
f189976
CCD-7242 fix pipeline build
markdathornehmcts Apr 22, 2026
edb5ee5
CCD-7242 Moved harness to support-tools module. Add test. Review code
markdathornehmcts Apr 22, 2026
3f7fe8a
CCD-7242 Fix ACR Migration check failure furing pipeline build - hmct…
markdathornehmcts Apr 22, 2026
19c493b
CCD-7242 documentation added
markdathornehmcts Apr 24, 2026
b5ea538
CCD-7242 tidy up
markdathornehmcts Apr 24, 2026
5f78cb6
CCD-7242 simplify readSheet method.
markdathornehmcts Apr 24, 2026
c512e28
CCD-7242 test excel files now in resources
markdathornehmcts Apr 24, 2026
5138b30
CCD-7242 general get system property error message handling
markdathornehmcts Apr 24, 2026
4c3810d
CCD-7242 new open spreadsheet inputstream method
markdathornehmcts Apr 24, 2026
1ec6d90
Merge branch 'master' into CCD-7242_testharness
markdathornehmcts Apr 24, 2026
0f39ac2
CCD-7242 merge master changes to fix build
markdathornehmcts Apr 27, 2026
eb6d824
Merge remote-tracking branch 'origin/CCD-7242_testharness' into CCD-7…
markdathornehmcts Apr 27, 2026
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
62 changes: 49 additions & 13 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ plugins {
id 'jacoco'
id 'idea'
id 'eclipse'
id 'org.springframework.boot' version '3.5.13'
id 'org.springframework.boot' version '3.5.14'
id 'com.github.ben-manes.versions' version '0.54.0'
id 'io.spring.dependency-management' version '1.1.7'
id 'org.sonarqube' version '6.3.1.5724'
Expand All @@ -12,7 +12,7 @@ plugins {
id 'org.jetbrains.gradle.plugin.idea-ext' version '1.4.1'
id 'info.solidsoft.pitest' version '1.19.0'
id 'uk.gov.hmcts.java' version '0.12.68'
id 'au.com.dius.pact' version '4.6.20'
id 'au.com.dius.pact' version '4.7.0'
id 'org.jsonschema2pojo' version '1.2.2'
id 'org.owasp.dependencycheck' version '12.2.1'
}
Expand All @@ -22,7 +22,7 @@ def versions = [
]

ext {
set('springCloudVersion', '2025.0.1')
set('springCloudVersion', '2025.1.1')
set('spring-framework.version', '6.2.14')
set('spring-security.version', '6.5.7')
set('log4j2.version', '2.24.3')
Expand All @@ -32,7 +32,7 @@ ext {
junitPlatform = '1.14.3'
jjwt = '0.13.0'
appInsightsVersion = '2.6.4'
pactProviderVersion = '4.6.20'
pactProviderVersion = '4.7.0'
lombokVersion = '1.18.46'
lombokBindingVersion = '0.2.0'
mockito = '5.21.0'
Expand Down Expand Up @@ -102,6 +102,22 @@ application {
}

sourceSets {
supportTools {
java {
srcDir('src/support-tools/java')
compileClasspath += main.output + main.compileClasspath
runtimeClasspath += main.output + main.runtimeClasspath
}
resources {
srcDir('src/support-tools/resources')
}
}

test {
compileClasspath += sourceSets.supportTools.output
runtimeClasspath += sourceSets.supportTools.output
}

aat {
java {
srcDir('src/aat/java')
Expand Down Expand Up @@ -176,6 +192,8 @@ configurations {
integrationTestImplementation.extendsFrom(testImplementation)
integrationTestRuntimeOnly.extendsFrom(testRuntimeOnly)
integrationTestAnnotationProcessor.extendsFrom(annotationProcessor)
supportToolsCompileOnly.extendsFrom(compileOnly)
supportToolsAnnotationProcessor.extendsFrom(annotationProcessor)

all.collect { configuration ->
configuration.exclude group: 'org.apache.logging.log4j', module: 'log4j-to-slf4j'
Expand Down Expand Up @@ -244,7 +262,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', version: '4.3.1'
implementation group: 'org.springframework.cloud', name: 'spring-cloud-starter-loadbalancer', version: '4.3.2'
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 All @@ -265,7 +283,7 @@ dependencies {
implementation group: 'com.github.hmcts.java-logging', name: 'logging', version: '8.0.0'

implementation group: 'com.auth0', name: 'java-jwt', version: '4.5.1'
implementation group: 'com.google.guava', name: 'guava', version: '33.5.0-jre'
implementation group: 'com.google.guava', name: 'guava', version: '33.6.0-jre'
implementation group: 'com.github.ben-manes.caffeine', name: 'caffeine', version: '3.2.3'
implementation group: 'com.microsoft.azure', name: 'applicationinsights-logging-logback', version: appInsightsVersion
implementation group: 'com.microsoft.azure', name: 'applicationinsights-spring-boot-starter', version: appInsightsVersion
Expand All @@ -288,6 +306,7 @@ dependencies {
implementation group: 'org.jooq', name: 'jool-java-8', version: '0.9.15'
implementation group: 'org.mapstruct', name: 'mapstruct', version: '1.6.3'
implementation group: 'pl.jalokim.propertiestojson', name: 'java-properties-to-json', version: '5.3.0'
implementation group: 'org.apache.poi', name: 'poi-ooxml', version: '5.4.0'

annotationProcessor group: 'org.mapstruct', name: 'mapstruct-processor', version: '1.6.3'
testAnnotationProcessor group: 'org.mapstruct', name: 'mapstruct-processor', version: '1.6.3'
Expand All @@ -297,14 +316,14 @@ dependencies {
testImplementation libraries.junit5
testImplementation libs.mockito
mockitoAgent(libs.mockito) {
transitive = false;
transitive = false
}
testImplementation group: 'com.opentable.components', name: 'otj-pg-embedded', version: '1.1.1'
testImplementation group: 'com.xebialabs.restito', name: 'restito', version: '1.1.2'
testImplementation group: 'io.rest-assured', name: 'rest-assured', version: '5.5.7'
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', version: '4.3.1'
testImplementation group: 'org.springframework.cloud', name: 'spring-cloud-starter-contract-stub-runner', version: '4.3.3'
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,7 +332,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'
testImplementation 'org.springframework.cloud:spring-cloud-contract-wiremock:4.3.3'

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 @@ -625,7 +644,7 @@ jacocoTestReport {
logger.lifecycle("Checking coverage results: ${report}")

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/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 @@ -718,13 +737,23 @@ task fortifyScan(type: JavaExec) {
jvmArgs = ['--add-opens=java.base/java.lang.reflect=ALL-UNNAMED']
}

tasks.register('definitionSpreadsheetHarness', JavaExec) {
group = "verification"
description = "Runs the definition spreadsheet harness via main()."
dependsOn supportToolsClasses
mainClass = "uk.gov.hmcts.ccd.tools.DefinitionSpreadsheetHarness"
classpath = sourceSets.supportTools.runtimeClasspath
}

idea {
module {
// config to allow InteliJ to mark test source and resource files correctly to help linting tools
// config to allow IntelliJ 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)
testSources.from(project.sourceSets.supportTools.java.srcDirs)
testResources.from(project.sourceSets.aat.resources.srcDirs)
testResources.from(project.sourceSets.contractTest.resources.srcDirs)
testResources.from(project.sourceSets.supportTools.resources.srcDirs)
}
}

Expand Down Expand Up @@ -758,7 +787,7 @@ task smoke(type: JavaExec) {

finalizedBy {
generateCucumberReports {
doLast{
doLast {
delete "${rootDir}/BEFTA Report for Smoke Tests/"
new File("${rootDir}/BEFTA Report for Smoke Tests").mkdirs()
file("${rootDir}/target/cucumber/cucumber-html-reports").renameTo(file("${rootDir}/BEFTA Report for Smoke Tests"))
Expand Down Expand Up @@ -798,7 +827,7 @@ task functional(type: JavaExec) {
finalizedBy {
generateCucumberReports.enabled = true
generateCucumberReports {
doLast{
doLast {
delete "${rootDir}/BEFTA Report for Functional Tests/"
new File("${rootDir}/BEFTA Report for Functional Tests").mkdirs()
file("${rootDir}/target/cucumber/cucumber-html-reports").renameTo(file("${rootDir}/BEFTA Report for Functional Tests"))
Expand Down Expand Up @@ -896,6 +925,13 @@ void configRemoteRunTask(Task execTask, String env) {
}
}

tasks.named('definitionSpreadsheetHarness', JavaExec) {
systemProperty 'definition.file', project.findProperty('definition.file')
systemProperty 'roles', project.findProperty('roles')
systemProperty 'target.fields', project.findProperty('target.fields')
systemProperty 'event.id', project.findProperty('event.id')
}

void loadEnvSecrets(String env) {
def azCmd = ['az', 'keyvault', 'secret', 'show', '--vault-name', "ccd-${env}", '-o', 'tsv', '--query', 'value', '--name', 'data-store-remote-env']
if (!project.file("./.${env}-remote-env").exists()) {
Expand Down
40 changes: 40 additions & 0 deletions scripts/run-definition-spreadsheet-harness.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/usr/bin/env bash
# Runs the definition spreadsheet harness with the provided arguments.
#
Comment thread
markdathornehmcts marked this conversation as resolved.
# Usage:
# run-definition-spreadsheet-harness.sh <definition-xlsx> <roles> <target-fields> <event-id>
#
# <roles> and <target-fields> can be comma separated lists.
#
# Example:
# ./scripts/run-definition-spreadsheet-harness.sh /ccd-appeal-config-preview-pr3017.xlsx caseworker-ia-admofficer isFeePaymentEnabled,sponsorEmailAdminJ,sponsorMobileNumberAdminJ,sponsorAddress editAppealAfterSubmit;
#
# Process summary:
# 1) Reads CaseEventToFields, AuthorisationCaseField, RoleToAccessProfiles from the XLSX.
# 2) Resolves roles to access profiles.
# 3) Evaluates read access for each field and matching case type for the event.
#
# Exit code:
# Non-zero on Gradle task failure (invalid input/configuration or non-returned decisions).
#
set -euo pipefail

script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
repo_root="$(cd "${script_dir}/.." && pwd)"

if [ "$#" -ne 4 ]; then
exit 1
fi

definition_file="$1"
roles="$2"
target_fields="$3"
event_id="$4"

cd "${repo_root}"

./gradlew definitionSpreadsheetHarness \
-Pdefinition.file="$definition_file" \
-Proles="$roles" \
-Ptarget.fields="$target_fields" \
-Pevent.id="$event_id"
Loading