From becff01db1bf36ff80452f945ba875c0f0d9f918 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Deleuze?= Date: Tue, 16 May 2023 13:55:29 +0200 Subject: [PATCH] Improve Kotlin Testcontainers samples Make those code samples more idiomatic. See gh-35446 --- .../testcontainers/dynamicproperties/MyIntegrationTests.kt | 4 ++-- .../testcontainers/serviceconnections/MyIntegrationTests.kt | 4 ++-- .../testing/testcontainers/vanilla/MyIntegrationTests.kt | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/features/testing/testcontainers/dynamicproperties/MyIntegrationTests.kt b/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/features/testing/testcontainers/dynamicproperties/MyIntegrationTests.kt index bce7aa1b2e..704997f646 100644 --- a/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/features/testing/testcontainers/dynamicproperties/MyIntegrationTests.kt +++ b/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/features/testing/testcontainers/dynamicproperties/MyIntegrationTests.kt @@ -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("neo4j:5") + val neo4j = Neo4jContainer("neo4j:5") @DynamicPropertySource fun neo4jProperties(registry: DynamicPropertyRegistry) { diff --git a/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/features/testing/testcontainers/serviceconnections/MyIntegrationTests.kt b/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/features/testing/testcontainers/serviceconnections/MyIntegrationTests.kt index 0ff93f611c..f1f28f5ba2 100644 --- a/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/features/testing/testcontainers/serviceconnections/MyIntegrationTests.kt +++ b/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/features/testing/testcontainers/serviceconnections/MyIntegrationTests.kt @@ -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("neo4j:5") + val neo4j = Neo4jContainer("neo4j:5") } diff --git a/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/features/testing/testcontainers/vanilla/MyIntegrationTests.kt b/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/features/testing/testcontainers/vanilla/MyIntegrationTests.kt index 90f55c8bdd..18baba5e95 100644 --- a/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/features/testing/testcontainers/vanilla/MyIntegrationTests.kt +++ b/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/features/testing/testcontainers/vanilla/MyIntegrationTests.kt @@ -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("neo4j:5") + val neo4j = Neo4jContainer("neo4j:5") } }