Cache log consumers
This commit is contained in:
@@ -103,12 +103,8 @@ public class GeodeSourceTests extends AbstractStreamApplicationTests {
|
||||
|
||||
@Test
|
||||
void test() {
|
||||
// logMatcher.when(() -> clientRegion.put("hello", "world")).contains("world"));
|
||||
// LogMatcher.LogListener logListener = logMatcher.contains("world").when(() ->
|
||||
// clientRegion.put("hello", "world"));
|
||||
await().atMost(Duration.ofMinutes(2))
|
||||
.until(geodeLogMatcher.verifies(log -> log.contains("Started GeodeSource")));
|
||||
// clientRegion.put("hello", "world");
|
||||
await().atMost(Duration.ofSeconds(30))
|
||||
.until(logMatcher.verifies(log -> log
|
||||
.when(() -> clientRegion.put("hello", "world"))
|
||||
|
||||
@@ -27,6 +27,8 @@ import java.util.Map;
|
||||
import java.util.Properties;
|
||||
import java.util.UUID;
|
||||
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.ConcurrentMap;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.testcontainers.containers.DockerComposeContainer;
|
||||
import org.testcontainers.containers.output.Slf4jLogConsumer;
|
||||
@@ -132,8 +134,12 @@ public abstract class AbstractStreamApplicationTests {
|
||||
}
|
||||
|
||||
public static class AppLog extends Slf4jLogConsumer {
|
||||
private static final Map<String, AppLog> appLogs = new ConcurrentHashMap<>();
|
||||
public static AppLog appLog(String appName) {
|
||||
return new AppLog(appName);
|
||||
if (!appLogs.containsKey(appName)) {
|
||||
appLogs.put(appName, new AppLog(appName));
|
||||
}
|
||||
return appLogs.get(appName);
|
||||
}
|
||||
|
||||
AppLog(String appName) {
|
||||
|
||||
Reference in New Issue
Block a user