springboot单元测试

@RunWith(SpringRunner.class)
@SpringBootTest(classes = DemoApplication.class)//加载启动类
public class TestAnnotation {

    @Autowired
    private AnnontationServiceTestImpl a;
    
    @Test
    public void testA(){
        System.out.println("单元测试开始");
        a.anoundTest();
        System.out.println("单元测试完成");
    }
}

 

posted @ 2019-05-08 16:36  宇枫  阅读(191)  评论(0编辑  收藏  举报