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("单元测试完成");
    }
}
原文地址:https://www.cnblogs.com/zyf-yxm/p/10832765.html