2019年2月25日

Spring Boot 2 实践记录之 Powermock 和 SpringBootTest

摘要: 由于要代码中使用了 Date 类生成实时时间,单元测试中需要 Mock Date 的构造方法,以预设其行为,这就要使用到 PowerMock 在 Spring Boot 的测试套件中,需要添加 @RunWith(SpringRunner.class) 和 @SpringBootTest 注解。 但是 阅读全文

posted @ 2019-02-25 20:11 刘兴伟 阅读(4016) 评论(0) 推荐(0) 编辑

导航