This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @SpringBootTest | |
| @AutoConfigureMockMvc | |
| class AxonIntegrationTest(@Autowired val mockMvc: MockMvc) { | |
| @Test | |
| fun `some test`() { | |
| // ... | |
| } | |
| // ... | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| axon.axonserver.enabled: false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| dependencies { | |
| // ... | |
| implementation("org.axonframework:axon-spring-boot-starter:4.3.5") | |
| // ... | |
| } | |
| configurations { | |
| testImplementation.get().exclude(group = "org.axonframework", module = "axon-server-connector") | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| dependencies { | |
| // ... | |
| implementation("org.axonframework:axon-spring-boot-starter:4.3.5") { | |
| exclude(group = "org.axonframework", module = "axon-server-connector") | |
| } | |
| // ... | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @SpringBootTest | |
| @AutoConfigureMockMvc | |
| @Testcontainers | |
| class AxonIntegrationTest(@Autowired val mockMvc: MockMvc) { | |
| companion object { | |
| @Container val axon = AxonServerContainer | |
| } | |
| @Test |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| object AxonServerContainer : GenericContainer<AxonServerContainer>("axoniq/axonserver") { | |
| init { | |
| withExposedPorts(8024, 8124) | |
| waitingFor(forLogMessage(".*Started AxonServer.*\\n", 1)) | |
| } | |
| override fun start() { | |
| super.start() | |
| System.setProperty("axon.axonserver.servers", "localhost:${getMappedPort(8124)}") | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @SpringBootTest | |
| @AutoConfigureMockMvc | |
| @Testcontainers | |
| class AxonIntegrationTest(@Autowired val mockMvc: MockMvc) { | |
| companion object { | |
| @Container val axon = AxonServerContainer | |
| @JvmStatic | |
| @DynamicPropertySource |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // defined as a singleton in kotlin | |
| object AxonServerContainer : GenericContainer<AxonServerContainer>("axoniq/axonserver") { | |
| init { | |
| withExposedPorts(8024, 8124) | |
| // the container is ready when the below log message is posted | |
| waitingFor(forLogMessage(".*Started AxonServer.*\\n", 1)) | |
| } | |
| // this will allow us to know which host/port to connect to | |
| val servers: String get() = "localhost:${getMappedPort(8124)}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| data class Person(val name: String, val age: Int) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| val treeSet = TreeSet<Int>() | |
| val treeSetDescending = TreeSet<Int>(Collections.reverseOrder()) | |
| val hashSet = HashSet<Int>() | |
| val random = Random() | |
| repeat(10) { | |
| val number = random.nextInt(100) | |
| treeSet.add(number) | |
| treeSetDescending.add(number) | |
| hashSet.add(number) | |
| } |
NewerOlder