From d101004d5f75773c028f9fbd09754039d680c896 Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Fri, 4 Aug 2023 15:24:40 +0200 Subject: [PATCH] Document @DataR2dbcTest support Closes gh-35014 --- .../src/docs/asciidoc/features/testing.adoc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/features/testing.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/features/testing.adoc index 761ac0e033e..cfec4f5a20d 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/features/testing.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/features/testing.adoc @@ -585,6 +585,22 @@ If you prefer your test to run against a real database, you can use the `@AutoCo +[[features.testing.spring-boot-applications.autoconfigured-spring-data-r2dbc]] +==== Auto-configured Data R2DBC Tests +`@DataR2dbcTest` is similar to `@DataJdbcTest` but is for tests that use Spring Data R2DBC repositories. +By default, it configures an in-memory embedded database, a `R2dbcEntityTemplate`, and Spring Data R2DBC repositories. +Regular `@Component` and `@ConfigurationProperties` beans are not scanned when the `@DataR2dbcTest` annotation is used. +`@EnableConfigurationProperties` can be used to include `@ConfigurationProperties` beans. + +TIP: A list of the auto-configurations that are enabled by `@DataR2dbcTest` can be <>. + +By default, Data R2DBC tests are not transactional. + +If you prefer your test to run against a real database, you can use the `@AutoConfigureTestDatabase` annotation in the same way as for `DataJpaTest`. +(See "<>".) + + + [[features.testing.spring-boot-applications.autoconfigured-jooq]] ==== Auto-configured jOOQ Tests You can use `@JooqTest` in a similar fashion as `@JdbcTest` but for jOOQ-related tests.