diff --git a/buildSrc/src/main/kotlin/uk/gov/justice/digital/hmpps/plugins/ClassPathPlugin.kt b/buildSrc/src/main/kotlin/uk/gov/justice/digital/hmpps/plugins/ClassPathPlugin.kt index ce40d61ae0..ac4e11c08a 100644 --- a/buildSrc/src/main/kotlin/uk/gov/justice/digital/hmpps/plugins/ClassPathPlugin.kt +++ b/buildSrc/src/main/kotlin/uk/gov/justice/digital/hmpps/plugins/ClassPathPlugin.kt @@ -5,6 +5,11 @@ import org.gradle.api.Project import org.gradle.api.tasks.SourceSet import org.gradle.api.tasks.SourceSetContainer import org.gradle.api.tasks.testing.Test +import org.gradle.internal.classpath.Instrumented.systemProperty +import org.gradle.internal.fingerprint.classpath.impl.ClasspathFingerprintingStrategy.compileClasspath +import org.gradle.internal.fingerprint.classpath.impl.ClasspathFingerprintingStrategy.runtimeClasspath +import org.gradle.internal.impldep.org.jsoup.nodes.Document.OutputSettings.Syntax.html +import org.gradle.internal.impldep.org.junit.experimental.categories.Categories.CategoryFilter.exclude import org.gradle.kotlin.dsl.configure import org.gradle.kotlin.dsl.get import org.gradle.kotlin.dsl.named @@ -54,7 +59,7 @@ class ClassPathPlugin : Plugin { } } - project.tasks.create("integrationTest", Test::class.java) { + project.tasks.register("integrationTest", Test::class.java) { testClassesDirs = getByName("integrationTest").output.classesDirs classpath = getByName("integrationTest").runtimeClasspath val profiles = System.getProperty("spring.profiles.active", System.getenv("SPRING_PROFILES_ACTIVE")) diff --git a/libs/document-management/src/main/kotlin/uk/gov/justice/digital/hmpps/alfresco/AlfrescoClient.kt b/libs/document-management/src/main/kotlin/uk/gov/justice/digital/hmpps/alfresco/AlfrescoClient.kt index dc0af65e35..670961174d 100644 --- a/libs/document-management/src/main/kotlin/uk/gov/justice/digital/hmpps/alfresco/AlfrescoClient.kt +++ b/libs/document-management/src/main/kotlin/uk/gov/justice/digital/hmpps/alfresco/AlfrescoClient.kt @@ -48,7 +48,7 @@ class AlfrescoClient( else -> throw RuntimeException("Failed to download document. Alfresco responded with ${res.statusCode}.") } - }, false) + }, false) ?: throw NotFoundException("Document content", "alfrescoId", id) private fun HttpHeaders.copy(key: String, res: ConvertibleClientHttpResponse) { res.headers[key]?.also { this[key] = it }