Add Stream Application Test Support for TestContainers
This commit is contained in:
@@ -19,6 +19,7 @@ package org.springframework.cloud.stream.app.test.integration;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.function.Function;
|
||||
@@ -147,5 +148,22 @@ public abstract class AbstractTestTopicListener implements TestTopicListener {
|
||||
public boolean isSatisfied() {
|
||||
return this.satisfied.get();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
Verifier verifier = (Verifier) o;
|
||||
return predicate.equals(verifier.predicate);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(predicate);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,10 +55,10 @@ public class KafkaStreamApplicationIntegrationTestSupportTests extends KafkaStre
|
||||
void verifierOnTheFly() {
|
||||
kafkaTemplate.send(STREAM_APPLICATIONS_TEST_TOPIC, "hello test3");
|
||||
kafkaTemplate.send(STREAM_APPLICATIONS_TEST_TOPIC, "hello test4");
|
||||
await().atMost(Duration.ofSeconds(30))
|
||||
.until(verifyOutputPayload((s -> s.equals("hello test4"))));
|
||||
await().atMost(Duration.ofSeconds(30))
|
||||
.until(verifyOutputPayload((s -> s.equals("hello test3"))));
|
||||
await().atMost(Duration.ofSeconds(30))
|
||||
.until(verifyOutputPayload((s -> s.equals("hello test4"))));
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user