@@ -55,6 +55,10 @@ dependencies {
55
55
testImplementation ' org.mockito:mockito-core:2.18.3'
56
56
}
57
57
58
+ jacoco {
59
+ toolVersion = " 0.8.7"
60
+ }
61
+
58
62
jacocoTestReport {
59
63
reports {
60
64
xml. enabled = true
@@ -87,6 +91,48 @@ task compileModuleInfoJava(type: JavaCompile) {
87
91
}
88
92
}
89
93
94
+ compileTestJava {
95
+ options. compilerArgs = [' --release' , " 8" ]
96
+ }
97
+
98
+ def testJava8 = tasks. register(' testJava8' , Test ) {
99
+ description = ' Runs unit tests on Java 8.'
100
+ group = ' verification'
101
+
102
+ javaLauncher. set(javaToolchains. launcherFor {
103
+ languageVersion = JavaLanguageVersion . of(8 )
104
+ })
105
+ shouldRunAfter(tasks. named(' test' ))
106
+ }
107
+
108
+ def testJava17 = tasks. register(' testJava17' , Test ) {
109
+ description = ' Runs unit tests on Java 17.'
110
+ group = ' verification'
111
+
112
+ javaLauncher. set(javaToolchains. launcherFor {
113
+ languageVersion = JavaLanguageVersion . of(17 )
114
+ })
115
+ shouldRunAfter(tasks. named(' test' ))
116
+
117
+ // Following Tests are excluded in Java 17 since secp256k1 curve is disabled Java 15+
118
+ filter {
119
+ excludeTestsMatching " *.jwt.ConcurrentVerifyTest.shouldPassECDSA256KVerificationWithJOSESignature"
120
+ excludeTestsMatching " *.jwt.JWTCreatorTest.shouldAddKeyIdIfAvailableFromECDSAKAlgorithms"
121
+ excludeTestsMatching " *.jwt.JWTCreatorTest.shouldNotOverwriteKeyIdIfAddedFromECDSAKAlgorithms"
122
+ excludeTestsMatching " *.jwt.JWTTest.shouldCreateAnEmptyECDSA256KSignedToken"
123
+ excludeTestsMatching " *.jwt.algorithms.ECDSAAlgorithmTest.shouldPassECDSA256KVerificationWithJOSESignature"
124
+ excludeTestsMatching " *.jwt.algorithms.ECDSAAlgorithmTest.shouldPassECDSA256KVerificationWithJOSESignatureWithBothKeys"
125
+ excludeTestsMatching " *.jwt.algorithms.ECDSAAlgorithmTest.shouldPassECDSA256KVerificationWithProvidedPublicKey"
126
+ excludeTestsMatching " *.jwt.ECDSABouncyCastleProviderTests.shouldPassECDSA256KVerificationWithJOSESignatureWithBothKeys"
127
+ excludeTestsMatching " *.jwt.ECDSABouncyCastleProviderTests.shouldPassECDSA256KVerificationWithProvidedPublicKey"
128
+ }
129
+ }
130
+
131
+ tasks. named(' check' ) {
132
+ dependsOn(testJava8)
133
+ dependsOn(testJava17)
134
+ }
135
+
90
136
jar {
91
137
manifest. attributes(' Multi-Release' : ' true' )
92
138
}
0 commit comments