Commit 429da743 authored by Stephane Nicoll's avatar Stephane Nicoll

Add missing close

parent ccc5e657
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
package org.springframework.boot.autoconfigure.amqp; package org.springframework.boot.autoconfigure.amqp;
import org.junit.After;
import org.junit.Rule; import org.junit.Rule;
import org.junit.Test; import org.junit.Test;
import org.junit.rules.ExpectedException; import org.junit.rules.ExpectedException;
...@@ -49,11 +50,18 @@ import static org.mockito.Mockito.verify; ...@@ -49,11 +50,18 @@ import static org.mockito.Mockito.verify;
*/ */
public class RabbitAutoConfigurationTests { public class RabbitAutoConfigurationTests {
private AnnotationConfigApplicationContext context;
@Rule @Rule
public ExpectedException thrown = ExpectedException.none(); public ExpectedException thrown = ExpectedException.none();
private AnnotationConfigApplicationContext context;
@After
public void close() {
if (this.context != null) {
this.context.close();
}
}
@Test @Test
public void testDefaultRabbitConfiguration() { public void testDefaultRabbitConfiguration() {
load(TestConfiguration.class); load(TestConfiguration.class);
......
...@@ -20,6 +20,7 @@ import javax.jms.ConnectionFactory; ...@@ -20,6 +20,7 @@ import javax.jms.ConnectionFactory;
import org.apache.activemq.ActiveMQConnectionFactory; import org.apache.activemq.ActiveMQConnectionFactory;
import org.apache.activemq.pool.PooledConnectionFactory; import org.apache.activemq.pool.PooledConnectionFactory;
import org.junit.After;
import org.junit.Test; import org.junit.Test;
import org.springframework.beans.BeansException; import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor; import org.springframework.beans.factory.config.BeanPostProcessor;
...@@ -54,6 +55,13 @@ public class JmsAutoConfigurationTests { ...@@ -54,6 +55,13 @@ public class JmsAutoConfigurationTests {
private AnnotationConfigApplicationContext context; private AnnotationConfigApplicationContext context;
@After
public void close() {
if (this.context != null) {
this.context.close();
}
}
@Test @Test
public void testDefaultJmsConfiguration() { public void testDefaultJmsConfiguration() {
load(TestConfiguration.class); load(TestConfiguration.class);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment