Improve Kotlin Testcontainers samples

Make those code samples more idiomatic.

See gh-35446
pull/35454/head
Sébastien Deleuze 2 years ago committed by Andy Wilkinson
parent 352ab4f93a
commit becff01db1

@ -26,7 +26,7 @@ import org.testcontainers.junit.jupiter.Testcontainers
@SpringBootTest @SpringBootTest
@Testcontainers @Testcontainers
internal class MyIntegrationTests { class MyIntegrationTests {
@Test @Test
fun myTest() { fun myTest() {
@ -36,7 +36,7 @@ internal class MyIntegrationTests {
companion object { companion object {
@Container @Container
var neo4j: Neo4jContainer<*> = Neo4jContainer<Nothing>("neo4j:5") val neo4j = Neo4jContainer("neo4j:5")
@DynamicPropertySource @DynamicPropertySource
fun neo4jProperties(registry: DynamicPropertyRegistry) { fun neo4jProperties(registry: DynamicPropertyRegistry) {

@ -26,7 +26,7 @@ import org.springframework.boot.testcontainers.service.connection.ServiceConnect
@SpringBootTest @SpringBootTest
@Testcontainers @Testcontainers
internal class MyIntegrationTests { class MyIntegrationTests {
@Test @Test
fun myTest() { fun myTest() {
@ -37,7 +37,7 @@ internal class MyIntegrationTests {
@Container @Container
@ServiceConnection @ServiceConnection
var neo4j: Neo4jContainer<*> = Neo4jContainer<Nothing>("neo4j:5") val neo4j = Neo4jContainer("neo4j:5")
} }

@ -24,7 +24,7 @@ import org.testcontainers.junit.jupiter.Testcontainers
@SpringBootTest @SpringBootTest
@Testcontainers @Testcontainers
internal class MyIntegrationTests { class MyIntegrationTests {
@Test @Test
fun myTest() { fun myTest() {
@ -33,7 +33,7 @@ internal class MyIntegrationTests {
companion object { companion object {
@Container @Container
var neo4j: Neo4jContainer<*> = Neo4jContainer<Nothing>("neo4j:5") val neo4j = Neo4jContainer("neo4j:5")
} }
} }

Loading…
Cancel
Save