Skip to content

Commit

Permalink
Testcontainers 1.19.3
Browse files Browse the repository at this point in the history
  • Loading branch information
rogervinas committed Nov 28, 2023
1 parent fbe534b commit 462733c
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -37,10 +37,10 @@ class ConsumerApplicationTest {
private val TIMEOUT = Duration.ofSeconds(5)

@Container
val container = DockerComposeContainer<Nothing>(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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -39,10 +39,10 @@ class Producer1ApplicationTest {
private val TIMEOUT = Duration.ofSeconds(5)

@Container
val container = DockerComposeContainer<Nothing>(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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -39,10 +39,10 @@ class Producer2ApplicationTest {
private val TIMEOUT = Duration.ofSeconds(5)

@Container
val container = DockerComposeContainer<Nothing>(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
Expand Down

0 comments on commit 462733c

Please sign in to comment.