记录下java的个人测试方法

IDEA,用 JUnitGenerator V2.​ 0 做单元测试。。
如果是 SpringBoot,测试类上面加注解
@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest(classes = MySpringBootApplication.class)
MySpringBootApplication 是指 Application 启动类的类名。
然后再用 @Autowired 注入对象就可以测试服务层。
控制层用 postman 测试。

原文地址:https://www.cnblogs.com/gobyte/p/10976570.html