Skip to content

Commit ca3e67f

Browse files
authored
Changed @before to @BeforeClass
accordingly made the necessary methods staic
1 parent b253563 commit ca3e67f

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package com.baeldung.spring.jms;
22

3-
import org.junit.Before;
3+
import org.junit.BeforeClass;
44
import org.junit.Test;
55
import org.springframework.context.ApplicationContext;
66
import org.springframework.context.support.ClassPathXmlApplicationContext;
@@ -9,11 +9,11 @@
99

1010
public class DefaultTextMessageSenderTest {
1111

12-
private SampleJmsMessageSender messageProducer;
12+
private static SampleJmsMessageSender messageProducer;
1313

1414
@SuppressWarnings("resource")
15-
@Before
16-
public void setUp() {
15+
@BeforeClass
16+
public static void setUp() {
1717
ApplicationContext applicationContext = new ClassPathXmlApplicationContext(new String[] { "classpath:EmbeddedActiveMQ.xml", "classpath:applicationContext.xml" });
1818
messageProducer = (SampleJmsMessageSender) applicationContext.getBean("SampleJmsMessageSender");
1919
}
@@ -23,4 +23,4 @@ public void testSimpleSend() {
2323
messageProducer.simpleSend();
2424
}
2525

26-
}
26+
}

0 commit comments

Comments
 (0)