Changed @Before to @BeforeClass

accordingly made the necessary methods staic
This commit is contained in:
Kiran 2016-10-09 14:22:20 -04:00 committed by GitHub
parent ca3e67fcd8
commit 872654d54c
1 changed files with 4 additions and 4 deletions

View File

@ -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");
}