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

Add missing close

parent ccc5e657
......@@ -16,6 +16,7 @@
package org.springframework.boot.autoconfigure.amqp;
import org.junit.After;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
......@@ -49,11 +50,18 @@ import static org.mockito.Mockito.verify;
*/
public class RabbitAutoConfigurationTests {
private AnnotationConfigApplicationContext context;
@Rule
public ExpectedException thrown = ExpectedException.none();
private AnnotationConfigApplicationContext context;
@After
public void close() {
if (this.context != null) {
this.context.close();
}
}
@Test
public void testDefaultRabbitConfiguration() {
load(TestConfiguration.class);
......
......@@ -20,6 +20,7 @@ import javax.jms.ConnectionFactory;
import org.apache.activemq.ActiveMQConnectionFactory;
import org.apache.activemq.pool.PooledConnectionFactory;
import org.junit.After;
import org.junit.Test;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor;
......@@ -54,6 +55,13 @@ public class JmsAutoConfigurationTests {
private AnnotationConfigApplicationContext context;
@After
public void close() {
if (this.context != null) {
this.context.close();
}
}
@Test
public void testDefaultJmsConfiguration() {
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