Skip to content

Commit aab4ee9

Browse files
committed
Merge branch '2.2.x' into 2.3.x
Closes gh-23243
2 parents e7e77a9 + e4691a4 commit aab4ee9

File tree

1 file changed

+22
-12
lines changed

1 file changed

+22
-12
lines changed

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

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6687,7 +6687,8 @@ assertThat(json.write(message))
66876687
==== Auto-configured Spring MVC Tests
66886688
To test whether Spring MVC controllers are working as expected, use the `@WebMvcTest` annotation.
66896689
`@WebMvcTest` auto-configures the Spring MVC infrastructure and limits scanned beans to `@Controller`, `@ControllerAdvice`, `@JsonComponent`, `Converter`, `GenericConverter`, `Filter`, `HandlerInterceptor`, `WebMvcConfigurer`, and `HandlerMethodArgumentResolver`.
6690-
Regular `@Component` beans are not scanned when using this annotation.
6690+
Regular `@Component` and `@ConfigurationProperties` beans are not scanned when the `@WebMvcTest` annotation is used.
6691+
`@EnableConfigurationProperties` can be used to include `@ConfigurationProperties` beans.
66916692

66926693
TIP: A list of the auto-configuration settings that are enabled by `@WebMvcTest` can be <<appendix-test-auto-configuration.adoc#test-auto-configuration,found in the appendix>>.
66936694

@@ -6787,7 +6788,8 @@ TIP: Sometimes writing Spring MVC tests is not enough; Spring Boot can help you
67876788
==== Auto-configured Spring WebFlux Tests
67886789
To test that {spring-framework-docs}/web-reactive.html[Spring WebFlux] controllers are working as expected, you can use the `@WebFluxTest` annotation.
67896790
`@WebFluxTest` auto-configures the Spring WebFlux infrastructure and limits scanned beans to `@Controller`, `@ControllerAdvice`, `@JsonComponent`, `Converter`, `GenericConverter`, `WebFilter`, and `WebFluxConfigurer`.
6790-
Regular `@Component` beans are not scanned when the `@WebFluxTest` annotation is used.
6791+
Regular `@Component` and `@ConfigurationProperties` beans are not scanned when the `@WebFluxTest` annotation is used.
6792+
`@EnableConfigurationProperties` can be used to include `@ConfigurationProperties` beans.
67916793

67926794
TIP: A list of the auto-configurations that are enabled by `@WebFluxTest` can be <<appendix-test-auto-configuration.adoc#test-auto-configuration,found in the appendix>>.
67936795

@@ -6848,7 +6850,8 @@ TIP: Sometimes writing Spring WebFlux tests is not enough; Spring Boot can help
68486850
You can use the `@DataJpaTest` annotation to test JPA applications.
68496851
By default, it scans for `@Entity` classes and configures Spring Data JPA repositories.
68506852
If an embedded database is available on the classpath, it configures one as well.
6851-
Regular `@Component` beans are not loaded into the `ApplicationContext`.
6853+
Regular `@Component` and `@ConfigurationProperties` beans are not scanned when the `@DataJpaTest` annotation is used.
6854+
`@EnableConfigurationProperties` can be used to include `@ConfigurationProperties` beans.
68526855

68536856
TIP: A list of the auto-configuration settings that are enabled by `@DataJpaTest` can be <<appendix-test-auto-configuration.adoc#test-auto-configuration,found in the appendix>>.
68546857

@@ -6922,7 +6925,8 @@ If, however, you prefer to run tests against a real database you can use the `@A
69226925
==== Auto-configured JDBC Tests
69236926
`@JdbcTest` is similar to `@DataJpaTest` but is for tests that only require a `DataSource` and do not use Spring Data JDBC.
69246927
By default, it configures an in-memory embedded database and a `JdbcTemplate`.
6925-
Regular `@Component` beans are not loaded into the `ApplicationContext`.
6928+
Regular `@Component` and `@ConfigurationProperties` beans are not scanned when the `@JdbcTest` annotation is used.
6929+
`@EnableConfigurationProperties` can be used to include `@ConfigurationProperties` beans.
69266930

69276931
TIP: A list of the auto-configurations that are enabled by `@JdbcTest` can be <<appendix-test-auto-configuration.adoc#test-auto-configuration,found in the appendix>>.
69286932

@@ -6953,7 +6957,8 @@ If you prefer your test to run against a real database, you can use the `@AutoCo
69536957
==== Auto-configured Data JDBC Tests
69546958
`@DataJdbcTest` is similar to `@JdbcTest` but is for tests that use Spring Data JDBC repositories.
69556959
By default, it configures an in-memory embedded database, a `JdbcTemplate`, and Spring Data JDBC repositories.
6956-
Regular `@Component` beans are not loaded into the `ApplicationContext`.
6960+
Regular `@Component` and `@ConfigurationProperties` beans are not scanned when the `@DataJdbcTest` annotation is used.
6961+
`@EnableConfigurationProperties` can be used to include `@ConfigurationProperties` beans.
69576962

69586963
TIP: A list of the auto-configurations that are enabled by `@DataJdbcTest` can be <<appendix-test-auto-configuration.adoc#test-auto-configuration,found in the appendix>>.
69596964

@@ -6972,12 +6977,12 @@ You can use `@JooqTest` in a similar fashion as `@JdbcTest` but for jOOQ-related
69726977
As jOOQ relies heavily on a Java-based schema that corresponds with the database schema, the existing `DataSource` is used.
69736978
If you want to replace it with an in-memory database, you can use `@AutoConfigureTestDatabase` to override those settings.
69746979
(For more about using jOOQ with Spring Boot, see "<<boot-features-jooq>>", earlier in this chapter.)
6975-
Regular `@Component` beans are not loaded into the `ApplicationContext`.
6980+
Regular `@Component` and `@ConfigurationProperties` beans are not scanned when the `@JooqTest` annotation is used.
6981+
`@EnableConfigurationProperties` can be used to include `@ConfigurationProperties` beans.
69766982

69776983
TIP: A list of the auto-configurations that are enabled by `@JooqTest` can be <<appendix-test-auto-configuration.adoc#test-auto-configuration,found in the appendix>>.
69786984

69796985
`@JooqTest` configures a `DSLContext`.
6980-
Regular `@Component` beans are not loaded into the `ApplicationContext`.
69816986
The following example shows the `@JooqTest` annotation in use:
69826987

69836988
[source,java,indent=0]
@@ -7003,7 +7008,8 @@ If that is not what you want, you can disable transaction management for a test
70037008
==== Auto-configured Data MongoDB Tests
70047009
You can use `@DataMongoTest` to test MongoDB applications.
70057010
By default, it configures an in-memory embedded MongoDB (if available), configures a `MongoTemplate`, scans for `@Document` classes, and configures Spring Data MongoDB repositories.
7006-
Regular `@Component` beans are not loaded into the `ApplicationContext`.
7011+
Regular `@Component` and `@ConfigurationProperties` beans are not scanned when the `@DataMongoTest` annotation is used.
7012+
`@EnableConfigurationProperties` can be used to include `@ConfigurationProperties` beans.
70077013
(For more about using MongoDB with Spring Boot, see "<<boot-features-mongodb>>", earlier in this chapter.)
70087014

70097015
TIP: A list of the auto-configuration settings that are enabled by `@DataMongoTest` can be <<appendix-test-auto-configuration.adoc#test-auto-configuration,found in the appendix>>.
@@ -7046,7 +7052,8 @@ If, however, you prefer to run tests against a real MongoDB server, you should e
70467052
==== Auto-configured Data Neo4j Tests
70477053
You can use `@DataNeo4jTest` to test Neo4j applications.
70487054
By default, it uses an in-memory embedded Neo4j (if the embedded driver is available), scans for `@NodeEntity` classes, and configures Spring Data Neo4j repositories.
7049-
Regular `@Component` beans are not loaded into the `ApplicationContext`.
7055+
Regular `@Component` and `@ConfigurationProperties` beans are not scanned when the `@DataNeo4jTest` annotation is used.
7056+
`@EnableConfigurationProperties` can be used to include `@ConfigurationProperties` beans.
70507057
(For more about using Neo4J with Spring Boot, see "<<boot-features-neo4j>>", earlier in this chapter.)
70517058

70527059
TIP: A list of the auto-configuration settings that are enabled by `@DataNeo4jTest` can be <<appendix-test-auto-configuration.adoc#test-auto-configuration,found in the appendix>>.
@@ -7091,7 +7098,8 @@ If that is not what you want, you can disable transaction management for a test
70917098
==== Auto-configured Data Redis Tests
70927099
You can use `@DataRedisTest` to test Redis applications.
70937100
By default, it scans for `@RedisHash` classes and configures Spring Data Redis repositories.
7094-
Regular `@Component` beans are not loaded into the `ApplicationContext`.
7101+
Regular `@Component` and `@ConfigurationProperties` beans are not scanned when the `@DataRedisTest` annotation is used.
7102+
`@EnableConfigurationProperties` can be used to include `@ConfigurationProperties` beans.
70957103
(For more about using Redis with Spring Boot, see "<<boot-features-redis>>", earlier in this chapter.)
70967104

70977105
TIP: A list of the auto-configuration settings that are enabled by `@DataRedisTest` can be <<appendix-test-auto-configuration.adoc#test-auto-configuration,found in the appendix>>.
@@ -7119,7 +7127,8 @@ The following example shows the `@DataRedisTest` annotation in use:
71197127
==== Auto-configured Data LDAP Tests
71207128
You can use `@DataLdapTest` to test LDAP applications.
71217129
By default, it configures an in-memory embedded LDAP (if available), configures an `LdapTemplate`, scans for `@Entry` classes, and configures Spring Data LDAP repositories.
7122-
Regular `@Component` beans are not loaded into the `ApplicationContext`.
7130+
Regular `@Component` and `@ConfigurationProperties` beans are not scanned when the `@DataLdapTest` annotation is used.
7131+
`@EnableConfigurationProperties` can be used to include `@ConfigurationProperties` beans.
71237132
(For more about using LDAP with Spring Boot, see "<<boot-features-ldap>>", earlier in this chapter.)
71247133

71257134
TIP: A list of the auto-configuration settings that are enabled by `@DataLdapTest` can be <<appendix-test-auto-configuration.adoc#test-auto-configuration,found in the appendix>>.
@@ -7162,7 +7171,8 @@ If, however, you prefer to run tests against a real LDAP server, you should excl
71627171
==== Auto-configured REST Clients
71637172
You can use the `@RestClientTest` annotation to test REST clients.
71647173
By default, it auto-configures Jackson, GSON, and Jsonb support, configures a `RestTemplateBuilder`, and adds support for `MockRestServiceServer`.
7165-
Regular `@Component` beans are not loaded into the `ApplicationContext`.
7174+
Regular `@Component` and `@ConfigurationProperties` beans are not scanned when the `@RestClientTest` annotation is used.
7175+
`@EnableConfigurationProperties` can be used to include `@ConfigurationProperties` beans.
71667176

71677177
TIP: A list of the auto-configuration settings that are enabled by `@RestClientTest` can be <<appendix-test-auto-configuration.adoc#test-auto-configuration,found in the appendix>>.
71687178

0 commit comments

Comments
 (0)