Split spring boot features into multiple sections

See gh-27132
This commit is contained in:
Madhura Bhave
2021-06-22 18:06:49 -07:00
parent f06b784d6e
commit 32a1644cca
60 changed files with 1544 additions and 1287 deletions

View File

@@ -195,7 +195,7 @@ Testing within a mocked environment is usually faster than running with a full S
However, since mocking occurs at the Spring MVC layer, code that relies on lower-level Servlet container behavior cannot be directly tested with MockMvc.
For example, Spring Boot's error handling is based on the "`error page`" support provided by the Servlet container.
This means that, whilst you can test your MVC layer throws and handles exceptions as expected, you cannot directly test that a specific <<features#features.developing-web-applications.spring-mvc.error-handling.error-pages, custom error page>> is rendered.
This means that, whilst you can test your MVC layer throws and handles exceptions as expected, you cannot directly test that a specific <<web#web.servlet.spring-mvc.error-handling.error-pages, custom error page>> is rendered.
If you need to test these lower-level concerns, you can start a fully running server as described in the next section.
====
@@ -451,7 +451,7 @@ You can use `@DataCassandraTest` to test Cassandra applications.
By default, it configures a `CassandraTemplate`, scans for `@Table` classes, and configures Spring Data Cassandra repositories.
Regular `@Component` and `@ConfigurationProperties` beans are not scanned when the `@DataCassandraTest` annotation is used.
`@EnableConfigurationProperties` can be used to include `@ConfigurationProperties` beans.
(For more about using Cassandra with Spring Boot, see "<<features#features.nosql.cassandra>>", earlier in this chapter.)
(For more about using Cassandra with Spring Boot, see "<<data#data.nosql.cassandra>>", earlier in this chapter.)
TIP: A list of the auto-configuration settings that are enabled by `@DataCassandraTest` can be <<test-auto-configuration#test-auto-configuration,found in the appendix>>.
@@ -552,7 +552,7 @@ If you prefer your test to run against a real database, you can use the `@AutoCo
You can use `@JooqTest` in a similar fashion as `@JdbcTest` but for jOOQ-related tests.
As jOOQ relies heavily on a Java-based schema that corresponds with the database schema, the existing `DataSource` is used.
If you want to replace it with an in-memory database, you can use `@AutoConfigureTestDatabase` to override those settings.
(For more about using jOOQ with Spring Boot, see "<<features#features.sql.jooq>>", earlier in this chapter.)
(For more about using jOOQ with Spring Boot, see "<<data#data.sql.jooq>>", earlier in this chapter.)
Regular `@Component` and `@ConfigurationProperties` beans are not scanned when the `@JooqTest` annotation is used.
`@EnableConfigurationProperties` can be used to include `@ConfigurationProperties` beans.
@@ -577,7 +577,7 @@ You can use `@DataMongoTest` to test MongoDB applications.
By default, it configures an in-memory embedded MongoDB (if available), configures a `MongoTemplate`, scans for `@Document` classes, and configures Spring Data MongoDB repositories.
Regular `@Component` and `@ConfigurationProperties` beans are not scanned when the `@DataMongoTest` annotation is used.
`@EnableConfigurationProperties` can be used to include `@ConfigurationProperties` beans.
(For more about using MongoDB with Spring Boot, see "<<features#features.nosql.mongodb>>", earlier in this chapter.)
(For more about using MongoDB with Spring Boot, see "<<data#data.nosql.mongodb>>", earlier in this chapter.)
TIP: A list of the auto-configuration settings that are enabled by `@DataMongoTest` can be <<test-auto-configuration#test-auto-configuration,found in the appendix>>.
@@ -604,7 +604,7 @@ You can use `@DataNeo4jTest` to test Neo4j applications.
By default, it scans for `@Node` classes, and configures Spring Data Neo4j repositories.
Regular `@Component` and `@ConfigurationProperties` beans are not scanned when the `@DataNeo4jTest` annotation is used.
`@EnableConfigurationProperties` can be used to include `@ConfigurationProperties` beans.
(For more about using Neo4J with Spring Boot, see "<<features#features.nosql.neo4j>>", earlier in this chapter.)
(For more about using Neo4J with Spring Boot, see "<<data#data.nosql.neo4j>>", earlier in this chapter.)
TIP: A list of the auto-configuration settings that are enabled by `@DataNeo4jTest` can be <<test-auto-configuration#test-auto-configuration,found in the appendix>>.
@@ -635,7 +635,7 @@ You can use `@DataRedisTest` to test Redis applications.
By default, it scans for `@RedisHash` classes and configures Spring Data Redis repositories.
Regular `@Component` and `@ConfigurationProperties` beans are not scanned when the `@DataRedisTest` annotation is used.
`@EnableConfigurationProperties` can be used to include `@ConfigurationProperties` beans.
(For more about using Redis with Spring Boot, see "<<features#features.nosql.redis>>", earlier in this chapter.)
(For more about using Redis with Spring Boot, see "<<data#data.nosql.redis>>", earlier in this chapter.)
TIP: A list of the auto-configuration settings that are enabled by `@DataRedisTest` can be <<test-auto-configuration#test-auto-configuration,found in the appendix>>.
@@ -654,7 +654,7 @@ You can use `@DataLdapTest` to test LDAP applications.
By default, it configures an in-memory embedded LDAP (if available), configures an `LdapTemplate`, scans for `@Entry` classes, and configures Spring Data LDAP repositories.
Regular `@Component` and `@ConfigurationProperties` beans are not scanned when the `@DataLdapTest` annotation is used.
`@EnableConfigurationProperties` can be used to include `@ConfigurationProperties` beans.
(For more about using LDAP with Spring Boot, see "<<features#features.nosql.ldap>>", earlier in this chapter.)
(For more about using LDAP with Spring Boot, see "<<data#data.nosql.ldap>>", earlier in this chapter.)
TIP: A list of the auto-configuration settings that are enabled by `@DataLdapTest` can be <<test-auto-configuration#test-auto-configuration,found in the appendix>>.
@@ -773,7 +773,7 @@ include::{docs-java}/features/testing/springbootapplications/autoconfiguredsprin
==== Auto-configured Spring Web Services Tests
You can use `@WebServiceClientTest` to test applications that use call web services using the Spring Web Services project.
By default, it configures a mock `WebServiceServer` bean and automatically customizes your `WebServiceTemplateBuilder`.
(For more about using Web Services with Spring Boot, see "<<features#features.webservices>>", earlier in this chapter.)
(For more about using Web Services with Spring Boot, see "<<io#io.webservices>>", earlier in this chapter.)
TIP: A list of the auto-configuration settings that are enabled by `@WebServiceClientTest` can be <<test-auto-configuration#test-auto-configuration,found in the appendix>>.