Skip to content

Commit

Permalink
Test topic client using multiple brokers
Browse files Browse the repository at this point in the history
  • Loading branch information
philipp94831 committed Jan 30, 2025
1 parent 4df0519 commit 6886227
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
1 change: 0 additions & 1 deletion streams-bootstrap-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ dependencies {
name = "kafka",
version = testContainersVersion
)
testFixturesImplementation(group = "org.assertj", name = "assertj-core", version = assertJVersion)
testImplementation(group = "io.confluent", name = "kafka-streams-avro-serde", version = confluentVersion)
val log4jVersion: String by project
testImplementation(group = "org.apache.logging.log4j", name = "log4j-slf4j2-impl", version = log4jVersion)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@

package com.bakdata.kafka;

import static org.assertj.core.api.Assertions.assertThat;
import static org.awaitility.Awaitility.await;

import java.time.Duration;
Expand Down Expand Up @@ -98,7 +97,7 @@ public void start() {

await()
.atMost(Duration.ofSeconds(120))
.untilAsserted(() -> {
.until(() -> {
final Container.ExecResult result = this.brokers.stream()
.findFirst()
.get()
Expand All @@ -111,8 +110,12 @@ public void start() {
);
final String brokers = result.getStdout().replace("\n", "");

assertThat(brokers).asInt().isEqualTo(this.brokersNum);
});
return Integer.parseInt(brokers);
}, readyBrokers -> readyBrokers == this.brokersNum);
await()
.pollDelay(Duration.ofSeconds(10))
.atMost(Duration.ofSeconds(11))
.until(() -> true);
}

@Override
Expand Down

0 comments on commit 6886227

Please sign in to comment.