You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by sl...@apache.org on 2026/09/22 22:46:46 UTC
(maven-mvnd) 01/01: Log raw-streams protocol messages only on assertion failure
This is an automated email from the ASF dual-hosted git repository.
slachiewicz pushed a commit to branch fix/raw-streams-log-noise
in repository https://gitbox.apache.org/repos/asf/maven-mvnd.git
commit 5c699bd230da547c54b785b1ace923c7fc6c42db
Author: Sylwester Lachiewicz <sl...@apache.org>
AuthorDate: Wed Sep 23 00:46:32 2026 +0200
Log raw-streams protocol messages only on assertion failure
RawStreamsTest dumped the whole client/daemon protocol stream (including
~30 KeepAlive events) to stdout for every run, making the integration-test
log output hard to grep. Include the captured messages in the assertion
failure message instead, so they show up only when the test fails.
---
.../src/test/java/org/mvndaemon/mvnd/it/RawStreamsTest.java | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/integration-tests/src/test/java/org/mvndaemon/mvnd/it/RawStreamsTest.java b/integration-tests/src/test/java/org/mvndaemon/mvnd/it/RawStreamsTest.java
index 9a9510d1..0351d1bd 100644
--- a/integration-tests/src/test/java/org/mvndaemon/mvnd/it/RawStreamsTest.java
+++ b/integration-tests/src/test/java/org/mvndaemon/mvnd/it/RawStreamsTest.java
@@ -21,6 +21,7 @@ package org.mvndaemon.mvnd.it;
import javax.inject.Inject;
import java.io.IOException;
+import java.util.stream.Collectors;
import org.assertj.core.api.Assertions;
import org.junit.jupiter.api.Test;
@@ -52,10 +53,10 @@ class RawStreamsTest {
final TestClientOutput o = new TestClientOutput();
client.execute(o, "validate", "--quiet", "--raw-streams").assertSuccess();
String expected = "PrintOut{payload='Hello'}";
- o.getMessages().forEach(m -> System.out.println(m.toString()));
assertTrue(
o.getMessages().stream().anyMatch(m -> m.toString().contains(expected)),
- "Output should contain " + expected);
+ () -> "Output should contain " + expected + " but got:\n"
+ + o.getMessages().stream().map(Object::toString).collect(Collectors.joining("\n")));
assertDaemonRegistrySize(1);
}