Skip to content

Commit 0ea9805

Browse files
committed
feat: improve exception handling and debug experience
1 parent ad1ee2d commit 0ea9805

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

it/src/test/java/org/eclipse/jkube/integrationtests/assertions/InvocationResultAssertion.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
package org.eclipse.jkube.integrationtests.assertions;
1515

1616
import org.apache.maven.shared.invoker.InvocationResult;
17+
import org.eclipse.jkube.integrationtests.maven.MavenInvocationResult;
18+
19+
import java.util.Arrays;
1720

1821
public class InvocationResultAssertion {
1922

@@ -26,6 +29,10 @@ public static void assertInvocation(InvocationResult invocationResult) {
2629
if (invocationResult.getExecutionException() != null) {
2730
message.append("\n").append(invocationResult.getExecutionException().getMessage());
2831
}
32+
if (invocationResult instanceof MavenInvocationResult){
33+
Arrays.stream(((MavenInvocationResult) invocationResult).getStdOut().split("\r?\n"))
34+
.forEach(line -> message.append("\n > ").append(line));
35+
}
2936
throw new AssertionError(message.toString());
3037
}
3138
}

0 commit comments

Comments
 (0)