diff --git a/test-framework/junit5/src/main/java/io/quarkus/test/junit/MockSupport.java b/test-framework/junit5/src/main/java/io/quarkus/test/junit/MockSupport.java index 4707a1b63dcba..1ced5c1988d5e 100644 --- a/test-framework/junit5/src/main/java/io/quarkus/test/junit/MockSupport.java +++ b/test-framework/junit5/src/main/java/io/quarkus/test/junit/MockSupport.java @@ -18,6 +18,9 @@ static void pushContext() { } static void popContext() { + if (contexts.isEmpty()) { + return; // can happen on error in QuarkusTestResourceLifecycleManagers etc. + } List val = contexts.pop(); for (Object i : val) { try {