如何在spring环境中做单元测试

在测试类的上方加入以下注解

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration("classpath:spring.xml")
public class Test01 {
@Autowired
private AmqSenderService mapper;


@Test
public void test04() {
                // mapper.sendMsg();
}

posted @ 2019-01-08 16:45  M号开发者  阅读(331)  评论(0编辑  收藏  举报