Changed @Before to @BeforeClass
accordingly made the necessary methods staic
This commit is contained in:
parent
ca3e67fcd8
commit
872654d54c
|
@ -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");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue