Skip to content

Commit

Permalink
Merge pull request #31394 from johnaohara/QUARKUS-31393
Browse files Browse the repository at this point in the history
Fix afterEach callback for integration tests
  • Loading branch information
geoand authored Feb 24, 2023
2 parents 2a0d688 + 8371983 commit 7adfaa9
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 7adfaa9

Please sign in to comment.