Prevent NPE in test
diff --git a/src/test/java/org/apache/sling/uca/impl/AgentIT.java b/src/test/java/org/apache/sling/uca/impl/AgentIT.java
index dd2bbfe..e8b6ac8 100644
--- a/src/test/java/org/apache/sling/uca/impl/AgentIT.java
+++ b/src/test/java/org/apache/sling/uca/impl/AgentIT.java
@@ -138,15 +138,15 @@
int exitCode = process.exitValue();
LOG.info("Exited with code {}", exitCode);
- if ( exitCode != 0 ) {
+ if ( exitCode == 0 ) {
+ throw new RuntimeException("Command terminated successfully. That is unexpected.");
+ } else {
return Files.lines(STDERR)
.filter( l -> l.startsWith("Exception in thread \"main\""))
.map( l -> newRecordedThrowable(l) )
.findFirst()
.orElseThrow(() -> new RuntimeException("Exit code was zero but did not find any exception information in stderr.txt"));
}
-
- return null;
}
private Process runForkedCommandWithAgent(URL url, int connectTimeoutSeconds, int readTimeoutSeconds, ClientType clientType) throws IOException {