Improve Kotlin Testcontainers samples

Make those code samples more idiomatic.

See gh-35446
This commit is contained in:
Sébastien Deleuze
2023-05-16 13:55:29 +02:00
committed by Andy Wilkinson
parent 352ab4f93a
commit becff01db1
3 changed files with 6 additions and 6 deletions

View File

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

View File

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

View File

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