Fix NPE when tests fail.
@@ -58,12 +58,15 @@ public class AbstractJmsAppenderReconnectIT {
if (jmsClientTestConfig != null) {
jmsClientTestConfig.stop();
}
+ if (appender != null) {
// Make sure the manager is gone as to not have bad side effect on other tests.
@SuppressWarnings("resource")
final JmsManager appenderManager = appender.getManager();
if (appenderManager != null) {
Assert.assertFalse(AbstractManager.hasManager(appenderManager.getName()));
}
+ }
+ if (jmsClientTestConfig != null) {
// Make sure the manager is gone as to not have bad side effect on other tests.
@SuppressWarnings("resource")
final JmsManager testManager = jmsClientTestConfig.getJmsManager();
@@ -71,6 +74,7 @@ public class AbstractJmsAppenderReconnectIT {
Assert.assertFalse(AbstractManager.hasManager(testManager.getName()));
}
}
+ }
protected void appendEvent(final JmsAppender appender) {
final Map<String, String> map = new HashMap<>();
