@RunWith(SpringRunner.class)
@SpringBootTest(classes=Application.class)
public class MyTest {
@Autowired AppsRepo appRepo;
@Autowired OrdersRepo ordersRepo;
@Test
public void doTest() {
System.out.println("hello world");
}
}
@SpringBootApplication
@ComponentScan
public class Application {
private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(Application.class);
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}
我有一个非常简单的集成测试,使用hibernate和postgresql数据库。只有2个存储库和1个控制器。运行此集成测试需要约62秒钟。底层发生了什么?
我只有2个领域对象和2个存储库。有没有办法加速测试?看起来大部分时间都花在hibernate上。
62秒中的40秒被用于此处 -
2016-11-18 15:58:52.264 INFO 8424 --- [restartedMain] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.PostgreSQL92Dialect
2016-11-18 15:59:31.528 DEBUG 8424 --- [restartedMain] o.h.e.j.env.spi.IdentifierHelperBuilder : JDBC driver metadata reported database stores quoted identifiers in neither upper, lower nor mixed case
DevTools
吗?这是链接 https://spring.io/blog/2015/06/17/devtools-in-spring-boot-1-3 - Abdullah Khan