Skip to content

Commit e6f77ef

Browse files
committed
Upgrade to JUnit 5
1 parent 8befd67 commit e6f77ef

File tree

4 files changed

+37
-13
lines changed

4 files changed

+37
-13
lines changed

kotlin/src/test/kotlin/org/axonframework/extensions/kotlin/CombiningCommandCallbackTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ import org.axonframework.commandhandling.GenericCommandMessage
2323
import org.axonframework.commandhandling.GenericCommandResultMessage
2424
import org.axonframework.commandhandling.distributed.CommandDispatchException
2525
import org.axonframework.messaging.MetaData
26-
import org.junit.Test
2726
import java.util.*
27+
import kotlin.test.Test
2828
import kotlin.test.fail
2929

3030
class CombiningCommandCallbackTest {

kotlin/src/test/kotlin/org/axonframework/extensions/kotlin/CommandGatewayExtensionsTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ import org.axonframework.commandhandling.CommandCallback
2424
import org.axonframework.commandhandling.CommandMessage
2525
import org.axonframework.commandhandling.gateway.CommandGateway
2626
import org.axonframework.messaging.MetaData
27-
import org.junit.Test
2827
import java.util.concurrent.TimeUnit
28+
import kotlin.test.Test
2929

3030
class CommandGatewayExtensionsTest {
3131
private val subjectGateway = mockk<CommandGateway>()

kotlin/src/test/kotlin/org/axonframework/extensions/kotlin/QueryGatewayExtensionsTest.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ import io.mockk.verify
2222
import org.axonframework.messaging.responsetypes.AbstractResponseType
2323
import org.axonframework.messaging.responsetypes.InstanceResponseType
2424
import org.axonframework.queryhandling.QueryGateway
25-
import org.junit.After
26-
import org.junit.Before
27-
import org.junit.Test
2825
import java.util.*
2926
import java.util.concurrent.CompletableFuture
27+
import kotlin.test.AfterTest
28+
import kotlin.test.BeforeTest
29+
import kotlin.test.Test
3030
import kotlin.test.assertSame
3131
import kotlin.test.assertTrue
3232

@@ -39,14 +39,14 @@ class QueryGatewayExtensionsTest {
3939
private val listReturnValue: CompletableFuture<List<String>> = CompletableFuture.completedFuture(listOf("Value", "Second value"))
4040
private val subjectGateway = mockk<QueryGateway>()
4141

42-
@Before
42+
@BeforeTest
4343
fun before() {
4444
every { subjectGateway.query(queryName, exampleQuery, matchInstanceResponseType<String>()) } returns instanceReturnValue
4545
every { subjectGateway.query(queryName, exampleQuery, matchOptionalResponseType<String>()) } returns optionalReturnValue
4646
every { subjectGateway.query(queryName, exampleQuery, matchMultipleInstancesResponseType<String>()) } returns listReturnValue
4747
}
4848

49-
@After
49+
@AfterTest
5050
fun after() {
5151
clearMocks(subjectGateway)
5252
}

pom.xml

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
<kotlin-logging.version>1.7.7</kotlin-logging.version>
3939
<jackson-kotlin.version>2.10.0</jackson-kotlin.version>
4040
<mockk.version>1.9.3</mockk.version>
41+
<junit.jupiter.version>5.5.2</junit.jupiter.version>
4142
</properties>
4243

4344
<dependencyManagement>
@@ -78,9 +79,24 @@
7879
</exclusions>
7980
</dependency>
8081

82+
<dependency>
83+
<groupId>org.junit.jupiter</groupId>
84+
<artifactId>junit-jupiter-api</artifactId>
85+
<version>${junit.jupiter.version}</version>
86+
</dependency>
87+
<dependency>
88+
<groupId>org.junit.jupiter</groupId>
89+
<artifactId>junit-jupiter-params</artifactId>
90+
<version>${junit.jupiter.version}</version>
91+
</dependency>
92+
<dependency>
93+
<groupId>org.junit.jupiter</groupId>
94+
<artifactId>junit-jupiter-engine</artifactId>
95+
<version>${junit.jupiter.version}</version>
96+
</dependency>
8197
<dependency>
8298
<groupId>org.jetbrains.kotlin</groupId>
83-
<artifactId>kotlin-test-junit</artifactId>
99+
<artifactId>kotlin-test-junit5</artifactId>
84100
<version>${kotlin.version}</version>
85101
<scope>test</scope>
86102
</dependency>
@@ -118,20 +134,28 @@
118134

119135
<!-- Test dependencies -->
120136
<dependency>
121-
<groupId>junit</groupId>
122-
<artifactId>junit</artifactId>
123-
<version>4.12</version>
137+
<groupId>org.junit.jupiter</groupId>
138+
<artifactId>junit-jupiter-api</artifactId>
139+
<scope>test</scope>
140+
</dependency>
141+
<dependency>
142+
<groupId>org.junit.jupiter</groupId>
143+
<artifactId>junit-jupiter-params</artifactId>
144+
<scope>test</scope>
145+
</dependency>
146+
<dependency>
147+
<groupId>org.junit.jupiter</groupId>
148+
<artifactId>junit-jupiter-engine</artifactId>
124149
<scope>test</scope>
125150
</dependency>
126151
<dependency>
127152
<groupId>org.jetbrains.kotlin</groupId>
128-
<artifactId>kotlin-test-junit</artifactId>
153+
<artifactId>kotlin-test-junit5</artifactId>
129154
<scope>test</scope>
130155
</dependency>
131156
<dependency>
132157
<groupId>io.mockk</groupId>
133158
<artifactId>mockk</artifactId>
134-
<version>${mockk.version}</version>
135159
<scope>test</scope>
136160
</dependency>
137161
</dependencies>

0 commit comments

Comments
 (0)