diff --git a/test-framework/junit5/src/main/java/io/quarkus/test/junit/NativeTestExtension.java b/test-framework/junit5/src/main/java/io/quarkus/test/junit/NativeTestExtension.java index 9e9e2419b606c..ef39d9b91381f 100644 --- a/test-framework/junit5/src/main/java/io/quarkus/test/junit/NativeTestExtension.java +++ b/test-framework/junit5/src/main/java/io/quarkus/test/junit/NativeTestExtension.java @@ -151,10 +151,15 @@ public void postProcessTestInstance(Object testInstance, ExtensionContext contex } } - private void throwBootFailureException() { + private void throwBootFailureException() throws Exception { if (firstException != null) { Throwable throwable = firstException; firstException = null; + + if (throwable instanceof Exception) { + throw (Exception) throwable; + } + throw new RuntimeException(throwable); } else { throw new TestAbortedException("Boot failed");