Skip to content

Commit

Permalink
Fix afterEach callback for integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
johnaohara committed Feb 24, 2023
1 parent 1b8fc61 commit 8371983
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,18 @@ protected void invokeAfterEachCallbacks(QuarkusTestMethodContext testMethodConte
invokeAfterEachCallbacks(QuarkusTestMethodContext.class, testMethodContext);
}

protected boolean isAfterAllCallbacksEmpty() {
return afterAllCallbacks == null || afterAllCallbacks.isEmpty();
protected boolean isAfterEachCallbacksEmpty() {
return afterEachCallbacks == null || afterEachCallbacks.isEmpty();
}

protected void invokeAfterEachCallbacks(Class<?> clazz, Object classInstance) throws Exception {
invokeCallbacks(afterEachCallbacks, "afterEach", clazz, classInstance);
}

protected boolean isAfterAllCallbacksEmpty() {
return afterAllCallbacks == null || afterAllCallbacks.isEmpty();
}

protected void invokeAfterAllCallbacks(QuarkusTestContext testContext) throws Exception {
invokeAfterAllCallbacks(QuarkusTestContext.class, testContext);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public void afterTestExecution(ExtensionContext context) throws Exception {
@Override
public void afterEach(ExtensionContext context) throws Exception {
if (!failedBoot) {
if (!isAfterAllCallbacksEmpty()) {
if (!isAfterEachCallbacksEmpty()) {
invokeAfterEachCallbacks(createQuarkusTestMethodContext(context));
}

Expand Down

0 comments on commit 8371983

Please sign in to comment.