[英]Hibernate messages when using @DataJpaTest with SpringBoot
I am doing @DataJpaTest on default spring boot settings. 我在默认的弹簧启动设置上执行@DataJpaTest。 When I run the test, hibernate(?) is flooding console with schema creation messages like: 当我运行测试时,hibernate(?)会在控制台中充斥模式创建消息,例如:
Hibernate: alter table ...
Hibernate: alter table ...
Hibernate: alter table ...
Hibernate: alter table ...
Hibernate: call next value ...
And so on. 等等。 Does anyone knows how to disable this messages? 有谁知道如何禁用此消息? I have logback configuration for test with log level OFF on root logger. 我具有用于在root logger上将日志级别设置为OFF的测试的logback配置。
/Annonymous /匿名
The @DataJpaTest
by default show SQL output. 默认情况下, @DataJpaTest
显示SQL输出。
* If SQL output should be logged.
* @return if SQL is logged
*/
@PropertyMapping("spring.jpa.show-sql")
boolean showSql() default true;
you can set the showSql=false within the annotation @DataJpaTest(showSql=false)
您可以在@DataJpaTest批注中设置showSql = false @DataJpaTest(showSql=false)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.