Skip to content

Commit

Permalink
ARQ-2231 The JUnit 5 container does not work with manual mode tests (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
rhusar committed Jul 3, 2024
1 parent df08821 commit fc45617
Showing 1 changed file with 19 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,23 +93,28 @@ public void interceptTestMethod(Invocation<Void> invocation, ReflectiveInvocatio
}

@Override
public void interceptBeforeEachMethod(Invocation<Void> invocation,
ReflectiveInvocationContext<Method> invocationContext, ExtensionContext extensionContext) throws Throwable {
if (IS_INSIDE_ARQUILLIAN.test(extensionContext) || isRunAsClient(extensionContext)) {
invocation.proceed();
} else {
invocation.skip();
}
public void interceptBeforeEachMethod(Invocation<Void> invocation, ReflectiveInvocationContext<Method> invocationContext, ExtensionContext extensionContext) throws Throwable {
if (IS_INSIDE_ARQUILLIAN.test(extensionContext) || isRunAsClient(extensionContext)) {
// Since the invocation is going to proceed, the invocation must happen within the context of SPI before()
getManager(extensionContext).getAdaptor().before(
extensionContext.getRequiredTestInstance(),
extensionContext.getRequiredTestMethod(),
invocation::proceed);
} else {
invocation.skip();
}
}

@Override
public void interceptAfterEachMethod(Invocation<Void> invocation,
ReflectiveInvocationContext<Method> invocationContext, ExtensionContext extensionContext) throws Throwable {
if (IS_INSIDE_ARQUILLIAN.test(extensionContext) || isRunAsClient(extensionContext)) {
invocation.proceed();
} else {
invocation.skip();
}
public void interceptAfterEachMethod(Invocation<Void> invocation, ReflectiveInvocationContext<Method> invocationContext, ExtensionContext extensionContext) throws Throwable {
if (IS_INSIDE_ARQUILLIAN.test(extensionContext) || isRunAsClient(extensionContext)) {
getManager(extensionContext).getAdaptor().after(
extensionContext.getRequiredTestInstance(),
extensionContext.getRequiredTestMethod(),
invocation::proceed);
} else {
invocation.skip();
}
}

@Override
Expand Down

0 comments on commit fc45617

Please sign in to comment.