Skip to content

Commit 3dd54bc

Browse files
Run SAML 2.0 tests in an exclusive task
Issue gh-10816
1 parent 23903b5 commit 3dd54bc

File tree

1 file changed

+30
-1
lines changed

1 file changed

+30
-1
lines changed

config/spring-security-config.gradle

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ dependencies {
113113
testRuntimeOnly 'org.hsqldb:hsqldb'
114114
}
115115

116-
117116
rncToXsd {
118117
rncDir = file('src/main/resources/org/springframework/security/config/')
119118
xsdDir = rncDir
@@ -130,3 +129,33 @@ tasks.withType(KotlinCompile).configureEach {
130129
}
131130

132131
build.dependsOn rncToXsd
132+
133+
compileTestJava {
134+
exclude "org/springframework/security/config/annotation/web/configurers/saml2/**", "org/springframework/security/config/http/Saml2*"
135+
}
136+
137+
task compileSaml2TestJava(type: JavaCompile) {
138+
javaCompiler = javaToolchains.compilerFor {
139+
languageVersion = JavaLanguageVersion.of(11)
140+
}
141+
source = sourceSets.test.java.srcDirs
142+
include "org/springframework/security/config/annotation/web/configurers/saml2/**", "org/springframework/security/config/http/Saml2*"
143+
classpath = sourceSets.test.compileClasspath
144+
destinationDirectory = new File("${buildDir}/classes/java/test")
145+
options.sourcepath = sourceSets.test.java.getSourceDirectories()
146+
}
147+
148+
task saml2Tests(type: Test) {
149+
javaLauncher = javaToolchains.launcherFor {
150+
languageVersion = JavaLanguageVersion.of(11)
151+
}
152+
filter {
153+
includeTestsMatching "org.springframework.security.config.annotation.web.configurers.saml2.*"
154+
}
155+
useJUnitPlatform()
156+
dependsOn compileSaml2TestJava
157+
}
158+
159+
tasks.named('test') {
160+
finalizedBy 'saml2Tests'
161+
}

0 commit comments

Comments
 (0)