Skip to content

Commit b9fb2bb

Browse files
committed
Move unittests to JUnit5
1 parent c43e658 commit b9fb2bb

File tree

9 files changed

+1226
-534
lines changed

9 files changed

+1226
-534
lines changed

mq-jms-spring-boot-starter/build.gradle

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ plugins {
2525
id 'jacoco'
2626
}
2727

28-
ext.mockitoVersion = '5.12.0'
28+
ext.mockitoVersion = '5.20.0'
2929

3030
dependencies {
3131
// Using "api" in this section means that the dependency ends up being listed
@@ -56,13 +56,33 @@ dependencies {
5656
api group: 'org.messaginghub', name: 'pooled-jms', version: pooledJmsVersion
5757

5858
// Testing - these are not put into the pom.xml describing our uploaded jars
59-
testImplementation group: 'junit', name: 'junit', version: jUnitVersion
6059
testImplementation group: 'org.springframework.boot', name: 'spring-boot-starter-test', version: springBootVersion
6160
testImplementation group: 'org.mockito', name:'mockito-core', version: mockitoVersion
61+
62+
// Setting up the dependencies needed for JUnit5 testing
63+
testImplementation group:'org.junit.jupiter', name:'junit-jupiter-api', version: jUnitVersion
64+
testRuntimeOnly group:'org.junit.jupiter', name:'junit-jupiter-engine', version: jUnitVersion
65+
testRuntimeOnly group:'org.junit.platform', name:'junit-platform-launcher'
6266
}
6367

6468
// This can be useful during development
6569
tasks.withType(JavaCompile) {
6670
options.compilerArgs << '-Xlint:unchecked'
6771
options.deprecation = true
6872
}
73+
74+
configurations {
75+
// We seem to get two versions of the org.json classes. Since we're not doing anything with
76+
// android, exclude it to avoid any warning messages.
77+
all*.exclude module: 'android-json'
78+
}
79+
80+
tasks.test {
81+
useJUnitPlatform()
82+
jvmArgs "-javaagent:${configurations.testRuntimeClasspath.find { it.name.contains('mockito-core') }}", '-Xshare:off'
83+
testLogging {
84+
//events "PASSED", "SKIPPED", "FAILED", "STANDARD_OUT", "STANDARD_ERROR"
85+
events "PASSED", "SKIPPED", "FAILED"
86+
87+
}
88+
}

0 commit comments

Comments
 (0)