Improving test error reporting - include exception
@@ -21,10 +21,11 @@ package io.bootique.junit5.handler.app;
import io.bootique.BQRuntime;
import io.bootique.command.CommandOutcome;
import io.bootique.junit5.BQApp;
-import org.junit.jupiter.api.Assertions;
import org.junit.platform.commons.logging.Logger;
import org.junit.platform.commons.logging.LoggerFactory;
+import static org.junit.jupiter.api.Assertions.fail;
+
/**
* @since 2.0
*/
@@ -67,7 +68,10 @@ public class ManagedTestRuntime {
public void run() {
LOGGER.debug(() -> "Starting Bootique runtime '" + name + "'...");
CommandOutcome result = runtime.run();
- Assertions.assertTrue(result.isSuccess(), () -> "Runtime '" + getName() + " failed to start: " + result);
+
+ if (!result.isSuccess()) {
+ fail("Runtime '" + getName() + " failed to start: " + result, result.getException());
+ }
}
public void shutdown() {
