diff --git a/spring-jms/src/test/com/baeldung/spring/jms/MapMessageConvertAndSendTest.java b/spring-jms/src/test/com/baeldung/spring/jms/MapMessageConvertAndSendTest.java index 4bd9827c60..19b9097601 100644 --- a/spring-jms/src/test/com/baeldung/spring/jms/MapMessageConvertAndSendTest.java +++ b/spring-jms/src/test/com/baeldung/spring/jms/MapMessageConvertAndSendTest.java @@ -1,6 +1,6 @@ package com.baeldung.spring.jms; -import org.junit.Before; +import org.junit.BeforeClass; import org.junit.Test; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; @@ -10,11 +10,11 @@ import com.baeldung.spring.jms.SampleJmsMessageSender; public class MapMessageConvertAndSendTest { - private SampleJmsMessageSender messageProducer; + private static SampleJmsMessageSender messageProducer; @SuppressWarnings("resource") - @Before - public void setUp() { + @BeforeClass + public static void setUp() { ApplicationContext applicationContext = new ClassPathXmlApplicationContext(new String[] { "classpath:EmbeddedActiveMQ.xml", "classpath:applicationContext.xml" }); messageProducer = (SampleJmsMessageSender) applicationContext.getBean("SampleJmsMessageSender"); }