Skip to content

Commit fd6ad5b

Browse files
committed
Merge branch '2.3.x' into 2.4.x
Closes gh-26024
2 parents b2d167c + 7286c33 commit fd6ad5b

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

spring-boot-project/spring-boot-docs/src/docs/asciidoc/spring-boot-features.adoc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7522,6 +7522,9 @@ The following example shows a typical setup for using Cassandra tests in Spring
75227522
You can use the `@DataJpaTest` annotation to test JPA applications.
75237523
By default, it scans for `@Entity` classes and configures Spring Data JPA repositories.
75247524
If an embedded database is available on the classpath, it configures one as well.
7525+
SQL queries are logged by default by setting the `spring.jpa.show-sql` property to `true`.
7526+
This can be disabled using the `showSql()` attribute of the annotation.
7527+
75257528
Regular `@Component` and `@ConfigurationProperties` beans are not scanned when the `@DataJpaTest` annotation is used.
75267529
`@EnableConfigurationProperties` can be used to include `@ConfigurationProperties` beans.
75277530

spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/orm/jpa/DataJpaTest.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@
5353
* {@link AutoConfigureTestDatabase @AutoConfigureTestDatabase} annotation can be used to
5454
* override these settings.
5555
* <p>
56+
* SQL queries are logged by default by setting the {@code spring.jpa.show-sql} property
57+
* to {@code true}. This can be disabled using the {@link DataJpaTest#showSql() showSql}
58+
* attribute.
59+
* <p>
5660
* If you are looking to load your full application configuration, but use an embedded
5761
* database, you should consider {@link SpringBootTest @SpringBootTest} combined with
5862
* {@link AutoConfigureTestDatabase @AutoConfigureTestDatabase} rather than this

0 commit comments

Comments
 (0)