Fix NPE in test teardown when something when wrong on set up.
@@ -75,13 +75,14 @@ public abstract class AbstractJpaAppenderTest {
context.reconfigure();
StatusLogger.getLogger().reset();
+ if (this.connection != null) {
try (Statement statement = this.connection.createStatement();) {
statement.execute("SHUTDOWN");
}
-
this.connection.close();
}
}
+ }
@Test
public void testBaseJpaEntityAppender() throws SQLException {
