diff --git a/build.gradle.kts b/build.gradle.kts index 6017e13..79822d4 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -43,7 +43,7 @@ subprojects { implementation("org.apache.avro:avro:1.11.0") testImplementation("org.springframework.boot:spring-boot-starter-test") - testImplementation("org.testcontainers:junit-jupiter:1.17.2") + testImplementation("org.testcontainers:junit-jupiter:1.19.3") } dependencyManagement { diff --git a/consumer/src/test/kotlin/com/rogervinas/stream/ConsumerApplicationTest.kt b/consumer/src/test/kotlin/com/rogervinas/stream/ConsumerApplicationTest.kt index 573ed8c..6e662f0 100644 --- a/consumer/src/test/kotlin/com/rogervinas/stream/ConsumerApplicationTest.kt +++ b/consumer/src/test/kotlin/com/rogervinas/stream/ConsumerApplicationTest.kt @@ -14,8 +14,8 @@ import org.mockito.Mockito.timeout import org.mockito.Mockito.verify import org.springframework.boot.test.context.SpringBootTest import org.springframework.boot.test.mock.mockito.MockBean -import org.testcontainers.containers.DockerComposeContainer -import org.testcontainers.containers.wait.strategy.Wait +import org.testcontainers.containers.ComposeContainer +import org.testcontainers.containers.wait.strategy.Wait.forListeningPort import org.testcontainers.junit.jupiter.Container import org.testcontainers.junit.jupiter.Testcontainers import java.io.File @@ -37,10 +37,10 @@ class ConsumerApplicationTest { private val TIMEOUT = Duration.ofSeconds(5) @Container - val container = DockerComposeContainer(File("../docker-compose.yml")) - .apply { withLocalCompose(true) } - .apply { withExposedService("broker", BROKER_PORT, Wait.forListeningPort()) } - .apply { withExposedService("schema-registry", SCHEMA_REGISTRY_PORT, Wait.forListeningPort()) } + val container = ComposeContainer(File("../docker-compose.yml")) + .withLocalCompose(true) + .withExposedService("broker", BROKER_PORT, forListeningPort()) + .withExposedService("schema-registry", SCHEMA_REGISTRY_PORT, forListeningPort()) } @MockBean(name = "process") diff --git a/producer1/src/test/kotlin/com/rogervinas/stream/Producer1ApplicationTest.kt b/producer1/src/test/kotlin/com/rogervinas/stream/Producer1ApplicationTest.kt index 616a0cd..abd9f25 100644 --- a/producer1/src/test/kotlin/com/rogervinas/stream/Producer1ApplicationTest.kt +++ b/producer1/src/test/kotlin/com/rogervinas/stream/Producer1ApplicationTest.kt @@ -13,8 +13,8 @@ import org.springframework.context.annotation.Configuration import org.springframework.context.annotation.Import import org.springframework.context.annotation.Primary import org.springframework.test.web.reactive.server.WebTestClient -import org.testcontainers.containers.DockerComposeContainer -import org.testcontainers.containers.wait.strategy.Wait +import org.testcontainers.containers.ComposeContainer +import org.testcontainers.containers.wait.strategy.Wait.forListeningPort import org.testcontainers.junit.jupiter.Container import org.testcontainers.junit.jupiter.Testcontainers import java.io.File @@ -39,10 +39,10 @@ class Producer1ApplicationTest { private val TIMEOUT = Duration.ofSeconds(5) @Container - val container = DockerComposeContainer(File("../docker-compose.yml")) - .apply { withLocalCompose(true) } - .apply { withExposedService("broker", BROKER_PORT, Wait.forListeningPort()) } - .apply { withExposedService("schema-registry", SCHEMA_REGISTRY_PORT, Wait.forListeningPort()) } + val container = ComposeContainer(File("../docker-compose.yml")) + .withLocalCompose(true) + .withExposedService("broker", BROKER_PORT, forListeningPort()) + .withExposedService("schema-registry", SCHEMA_REGISTRY_PORT, forListeningPort()) } @Test diff --git a/producer2/src/test/kotlin/com/rogervinas/stream/Producer2ApplicationTest.kt b/producer2/src/test/kotlin/com/rogervinas/stream/Producer2ApplicationTest.kt index ffd82e0..9bbc57a 100644 --- a/producer2/src/test/kotlin/com/rogervinas/stream/Producer2ApplicationTest.kt +++ b/producer2/src/test/kotlin/com/rogervinas/stream/Producer2ApplicationTest.kt @@ -13,8 +13,8 @@ import org.springframework.context.annotation.Configuration import org.springframework.context.annotation.Import import org.springframework.context.annotation.Primary import org.springframework.test.web.reactive.server.WebTestClient -import org.testcontainers.containers.DockerComposeContainer -import org.testcontainers.containers.wait.strategy.Wait +import org.testcontainers.containers.ComposeContainer +import org.testcontainers.containers.wait.strategy.Wait.forListeningPort import org.testcontainers.junit.jupiter.Container import org.testcontainers.junit.jupiter.Testcontainers import java.io.File @@ -39,10 +39,10 @@ class Producer2ApplicationTest { private val TIMEOUT = Duration.ofSeconds(5) @Container - val container = DockerComposeContainer(File("../docker-compose.yml")) - .apply { withLocalCompose(true) } - .apply { withExposedService("broker", BROKER_PORT, Wait.forListeningPort()) } - .apply { withExposedService("schema-registry", SCHEMA_REGISTRY_PORT, Wait.forListeningPort()) } + val container = ComposeContainer(File("../docker-compose.yml")) + .withLocalCompose(true) + .withExposedService("broker", BROKER_PORT, forListeningPort()) + .withExposedService("schema-registry", SCHEMA_REGISTRY_PORT, forListeningPort()) } @Test