From c12043e0632ae84122a7636da09145faa38323ac Mon Sep 17 00:00:00 2001 From: Petr Beran Date: Wed, 20 Mar 2024 21:13:16 +0100 Subject: [PATCH] [ARQ-2231] The JUnit 5 container does not work with manual mode tests --- .../jboss/arquillian/junit5/ArquillianExtension.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/junit5/core/src/main/java/org/jboss/arquillian/junit5/ArquillianExtension.java b/junit5/core/src/main/java/org/jboss/arquillian/junit5/ArquillianExtension.java index bf6240991..13a7c21c5 100644 --- a/junit5/core/src/main/java/org/jboss/arquillian/junit5/ArquillianExtension.java +++ b/junit5/core/src/main/java/org/jboss/arquillian/junit5/ArquillianExtension.java @@ -96,7 +96,10 @@ public void interceptTestMethod(Invocation invocation, ReflectiveInvocatio public void interceptBeforeEachMethod(Invocation invocation, ReflectiveInvocationContext invocationContext, ExtensionContext extensionContext) throws Throwable { if (IS_INSIDE_ARQUILLIAN.test(extensionContext) || isRunAsClient(extensionContext)) { - invocation.proceed(); + getManager(extensionContext).getAdaptor().before( + extensionContext.getRequiredTestInstance(), + extensionContext.getRequiredTestMethod(), + invocation::proceed); } else { invocation.skip(); } @@ -106,7 +109,10 @@ public void interceptBeforeEachMethod(Invocation invocation, public void interceptAfterEachMethod(Invocation invocation, ReflectiveInvocationContext invocationContext, ExtensionContext extensionContext) throws Throwable { if (IS_INSIDE_ARQUILLIAN.test(extensionContext) || isRunAsClient(extensionContext)) { - invocation.proceed(); + getManager(extensionContext).getAdaptor().after( + extensionContext.getRequiredTestInstance(), + extensionContext.getRequiredTestMethod(), + invocation::proceed); } else { invocation.skip(); }