Skip to content

Commit d101004

Browse files
committed
Document @DataR2dbcTest support
Closes gh-35014
1 parent 1ca763e commit d101004

File tree

1 file changed

+16
-0
lines changed
  • spring-boot-project/spring-boot-docs/src/docs/asciidoc/features

1 file changed

+16
-0
lines changed

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -585,6 +585,22 @@ If you prefer your test to run against a real database, you can use the `@AutoCo
585585

586586

587587

588+
[[features.testing.spring-boot-applications.autoconfigured-spring-data-r2dbc]]
589+
==== Auto-configured Data R2DBC Tests
590+
`@DataR2dbcTest` is similar to `@DataJdbcTest` but is for tests that use Spring Data R2DBC repositories.
591+
By default, it configures an in-memory embedded database, a `R2dbcEntityTemplate`, and Spring Data R2DBC repositories.
592+
Regular `@Component` and `@ConfigurationProperties` beans are not scanned when the `@DataR2dbcTest` annotation is used.
593+
`@EnableConfigurationProperties` can be used to include `@ConfigurationProperties` beans.
594+
595+
TIP: A list of the auto-configurations that are enabled by `@DataR2dbcTest` can be <<test-auto-configuration#appendix.test-auto-configuration,found in the appendix>>.
596+
597+
By default, Data R2DBC tests are not transactional.
598+
599+
If you prefer your test to run against a real database, you can use the `@AutoConfigureTestDatabase` annotation in the same way as for `DataJpaTest`.
600+
(See "<<features#features.testing.spring-boot-applications.autoconfigured-spring-data-jpa>>".)
601+
602+
603+
588604
[[features.testing.spring-boot-applications.autoconfigured-jooq]]
589605
==== Auto-configured jOOQ Tests
590606
You can use `@JooqTest` in a similar fashion as `@JdbcTest` but for jOOQ-related tests.

0 commit comments

Comments
 (0)