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

相关文章:

  • 2021-11-15
  • 2021-04-14
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-11
  • 2022-12-23
  • 2021-10-01
猜你喜欢
  • 2021-07-27
  • 2021-12-29
  • 2021-09-14
  • 2021-12-02
  • 2022-12-23
  • 2022-12-23
  • 2021-07-24
相关资源
相似解决方案