在测试类的上方加入以下注解
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration("classpath:spring.xml")
public class Test01 {
@Autowired
private AmqSenderService mapper;
@Test
public void test04() {
// mapper.sendMsg();
}
在测试类的上方加入以下注解
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration("classpath:spring.xml")
public class Test01 {
@Autowired
private AmqSenderService mapper;
@Test
public void test04() {
// mapper.sendMsg();
}
转载于:https://www.cnblogs.com/a1304908180/p/10239856.html