Improve Kotlin Testcontainers samples
Make those code samples more idiomatic. See gh-35446
This commit is contained in:
committed by
Andy Wilkinson
parent
352ab4f93a
commit
becff01db1
@@ -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) {
|
||||
|
||||
@@ -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")
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -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")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user