SpringBoot单元测试实践
@RunWith(SpringRunner.class)
@SpringBootTest(classes = Application.class)
@Transactional
@Rollback(true)
public class HelloServiceTest {
@Autowired
private HelloService helloService;
@Test
public void sayHello() {
helloService.sayHello("zhangsan");
// XXX Asset
}
使用内存数据库 h2 + flayway为dao层测试
mock feign client
@SpringBootTest 性能优化
最后更新于