From 48eeab3d206e20d9f4894302670d02364a75a17a Mon Sep 17 00:00:00 2001
From: Pavel Vetokhin
Date: Fri, 8 Mar 2024 19:47:07 +0300
Subject: [PATCH] Default service name
---
.../bezmen/resilience/AbstractResilienceTest.java | 3 ++-
.../src/main/java/smecalculus/bezmen/testing/Demiurge.java | 7 +++----
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/test/e2e/src/test/java/smecalculus/bezmen/resilience/AbstractResilienceTest.java b/test/e2e/src/test/java/smecalculus/bezmen/resilience/AbstractResilienceTest.java
index 464e3c07..4589cc00 100644
--- a/test/e2e/src/test/java/smecalculus/bezmen/resilience/AbstractResilienceTest.java
+++ b/test/e2e/src/test/java/smecalculus/bezmen/resilience/AbstractResilienceTest.java
@@ -43,6 +43,7 @@ public abstract class AbstractResilienceTest {
@BeforeAll
void abstractBeforeAll() {
services = dockerClient.listContainersCmd().withShowAll(true).exec().stream()
- .collect(groupingBy(container -> container.getLabels().get("com.docker.compose.service")));
+ .collect(groupingBy(
+ container -> container.getLabels().getOrDefault("com.docker.compose.service", "unknown")));
}
}
diff --git a/tool/testing/src/main/java/smecalculus/bezmen/testing/Demiurge.java b/tool/testing/src/main/java/smecalculus/bezmen/testing/Demiurge.java
index 37b52f7c..ff126e09 100644
--- a/tool/testing/src/main/java/smecalculus/bezmen/testing/Demiurge.java
+++ b/tool/testing/src/main/java/smecalculus/bezmen/testing/Demiurge.java
@@ -24,14 +24,13 @@ public class Demiurge {
public void starts(@NonNull List containers) {
try {
- containers.forEach(container -> dockerClient.startContainerCmd(container.getId()).exec());
+ containers.forEach(container ->
+ dockerClient.startContainerCmd(container.getId()).exec());
} catch (NotModifiedException e) {
LOG.debug("Already started");
}
containers.forEach(container ->
- await(container.getNames()[0])
- .atMost(SERVICE_START_TIMEOUT)
- .until(() -> isStarted(container)));
+ await(container.getNames()[0]).atMost(SERVICE_START_TIMEOUT).until(() -> isStarted(container)));
}
public void kills(@NonNull Container container) {