简体   繁体   English

在SpringBoot上使用@DataJpaTest时的休眠消息

[英]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.

相关问题 使用@DataJpaTest和SpringBoot的UnsatisfiedDependencyException - UnsatisfiedDependencyException using @DataJpaTest with SpringBoot 使用 DataJpaTest 时在 Hibernate 上使用 IdClass 的复合键作为复合键 - Composite keys using IdClass on Hibernate for composite keys when using DataJpaTest 使用@DataJpaTest时未配置JdbcTemplate - JdbcTemplate not configured when using @DataJpaTest springboot中使用hibernate拦截器的问题 - Problem of using hibernate interceptor in springboot 使用MySQL进行DataJpaTest存储库测试时,Hibernate不会将用户设置为在H2 DB中自动递增 - With DataJpaTest Repository Tests using MySQL, Hibernate doesn't set User to auto-increment in H2 DB 将Hibernate Validator与GWT一起使用时,如何国际化错误消息? - How to internationalize error messages when using Hibernate Validator with GWT? 如何在使用Hibernate时删除Ehcache WARN消息 - How to remove the Ehcache WARN messages when using Hibernate 在 springboot 中使用 @EnableWebFluxSecurity 时出错 - Error when using @EnableWebFluxSecurity in springboot 使用 DataJpaTest 进行测试时服务 Bean 未满足依赖关系 - Service Bean unsatisfied dependency when testing with DataJpaTest 使用DataJpaTest Spring Boot 2.1.0更新失败 - Failed to update using DataJpaTest spring boot 2.1.0
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM