简体   繁体   中英

Hibernate messages when using @DataJpaTest with SpringBoot

I am doing @DataJpaTest on default spring boot settings. When I run the test, hibernate(?) is flooding console with schema creation messages like:

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.

/Annonymous

The @DataJpaTest by default show SQL output.

 * 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)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM