diff --git a/spring-test/src/main/java/org/springframework/test/context/TestContextManager.java b/spring-test/src/main/java/org/springframework/test/context/TestContextManager.java index 5c0e709dae..446bd58dfd 100644 --- a/spring-test/src/main/java/org/springframework/test/context/TestContextManager.java +++ b/spring-test/src/main/java/org/springframework/test/context/TestContextManager.java @@ -366,9 +366,9 @@ public class TestContextManager { if (logger.isWarnEnabled()) { logger.warn("Caught exception while allowing TestExecutionListener [" + testExecutionListener + "] to process 'after class' callback for test class [" + testClass + "]", ex); - if (afterTestClassException == null) { - afterTestClassException = ex; - } + } + if (afterTestClassException == null) { + afterTestClassException = ex; } } }