Skip to content

Commit 060d95c

Browse files
committed
[XEN-3155] actually fetch enough lines to pass the test
1 parent 2889b1e commit 060d95c

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

2repository/src/integrationTest/java/eu/xenit/docker/alfresco/test/LoggingTests.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,9 @@ private boolean isJsonLogs(String logs) {
9292

9393
}
9494

95-
private boolean containsSpringDebugLog(String logLines) {
96-
return getJsonLogs(logLines).anyMatch(line -> {
97-
if (!line.has("severity") || !line.has("loggerName")) return false;
98-
return line.get("severity").asText().equals("DEBUG") && line.get("loggerName").asText().contains("org.springframework");
95+
private boolean containsSpringDebugLog(String logs) {
96+
return logs.lines().anyMatch(line -> {
97+
return line.contains("DEBUG org.springframework");
9998
});
10099
}
101100

@@ -135,12 +134,12 @@ public void testJsonLogging() {
135134
@Test
136135
public void testLogLevelConfiguration() {
137136
try (GenericContainer<?> alfContainer = new GenericContainer<>(getAlfrescoImageName())) {
138-
// Start container with debug Spring, use json logging for easier parsing
139-
setupAlfrescoTestContainer(alfContainer, true, Map.of("LOG_LEVEL_org_springframework", "debug"));
137+
// Start container with debug Spring
138+
setupAlfrescoTestContainer(alfContainer, false, Map.of("LOG_LEVEL_org_springframework", "debug"));
140139
alfContainer.start();
141140

142141
// Accumulate some logs (make sure we get enough to catch some Spring logs)
143-
Awaitility.await().until(() -> alfContainer.getLogs().length() > 100);
142+
Awaitility.await().until(() -> alfContainer.getLogs().lines().count() > 100);
144143

145144
String logs = alfContainer.getLogs();
146145

0 commit comments

Comments
 (0)