diff --git a/activemq-unit-tests/src/test/java/org/apache/activemq/broker/policy/SecureDLQTest.java b/activemq-unit-tests/src/test/java/org/apache/activemq/broker/policy/SecureDLQTest.java index 9d656e891c..354031ed9c 100644 --- a/activemq-unit-tests/src/test/java/org/apache/activemq/broker/policy/SecureDLQTest.java +++ b/activemq-unit-tests/src/test/java/org/apache/activemq/broker/policy/SecureDLQTest.java @@ -95,13 +95,10 @@ public class SecureDLQTest extends DeadLetterTestSupport { @Override public void tearDown() throws Exception { + if (dlqConnection != null) { + dlqConnection.close(); + } super.tearDown(); - if (dlqSession != null) { - dlqSession.close(); - } - if (dlqConsumer != null) { - dlqConsumer.close(); - } } @Override