diff --git a/spring-data-geode-test/src/main/java/org/springframework/data/gemfire/tests/extensions/spring/test/context/support/CloseApplicationContextAfterTestClassTestExecutionListener.java b/spring-data-geode-test/src/main/java/org/springframework/data/gemfire/tests/extensions/spring/test/context/support/CloseApplicationContextAfterTestClassTestExecutionListener.java index eca88db..0e04e10 100644 --- a/spring-data-geode-test/src/main/java/org/springframework/data/gemfire/tests/extensions/spring/test/context/support/CloseApplicationContextAfterTestClassTestExecutionListener.java +++ b/spring-data-geode-test/src/main/java/org/springframework/data/gemfire/tests/extensions/spring/test/context/support/CloseApplicationContextAfterTestClassTestExecutionListener.java @@ -24,6 +24,7 @@ import org.springframework.lang.NonNull; import org.springframework.test.annotation.DirtiesContext; import org.springframework.test.context.TestContext; import org.springframework.test.context.TestExecutionListener; +import org.springframework.test.context.support.AbstractTestExecutionListener; /** * Spring {@link TestContext} framework {@link org.springframework.test.context.TestExecutionListener} used to @@ -38,10 +39,11 @@ import org.springframework.test.context.TestExecutionListener; * @see org.springframework.test.annotation.DirtiesContext * @see org.springframework.test.context.TestContext * @see org.springframework.test.context.TestExecutionListener + * @see org.springframework.test.context.support.AbstractTestExecutionListener * @since 1.0.0 */ @SuppressWarnings("all") -public class CloseApplicationContextAfterTestClassTestExecutionListener implements TestExecutionListener { +public class CloseApplicationContextAfterTestClassTestExecutionListener extends AbstractTestExecutionListener { protected static final boolean DEFAULT_SPRING_TEST_CONTEXT_CLOSED = false; @@ -52,6 +54,14 @@ public class CloseApplicationContextAfterTestClassTestExecutionListener implemen private final AtomicReference springTestContextCloseEnabled = new AtomicReference<>(); + /** + * @inheritDoc + */ + @Override + public int getOrder() { + return -1000; + } + protected boolean isSpringTestContextCloseEnabled() { return this.springTestContextCloseEnabled.updateAndGet(closeEnabled -> closeEnabled != null ? closeEnabled : getSpringTestContextCloseEnabledResolvingFunction().apply(DEFAULT_SPRING_TEST_CONTEXT_CLOSED)); @@ -85,7 +95,7 @@ public class CloseApplicationContextAfterTestClassTestExecutionListener implemen public void afterTestClass(@NonNull TestContext testContext) throws Exception { if (isSpringTestContextCloseEnabled()) { - TestExecutionListener.super.afterTestClass(testContext); + super.afterTestClass(testContext); testContext.markApplicationContextDirty(DEFAULT_HIERARCHY_MODE); } }