diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/data/cassandra/DataCassandraTest.java b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/data/cassandra/DataCassandraTest.java index 37dd6c13963..5b28d6724db 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/data/cassandra/DataCassandraTest.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/data/cassandra/DataCassandraTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -40,8 +40,9 @@ import org.springframework.test.context.junit.jupiter.SpringExtension; * Annotation that can be used for a Cassandra test that focuses only on * Cassandra components. *
- * Using this annotation will disable full auto-configuration and instead apply only - * configuration relevant to Cassandra tests. + * Using this annotation only enables auto-configuration that is relevant to Data Casandra + * tests. Similarly, component scanning is limited to Cassandra repositories and entities + * ({@code @Table}). *
* When using JUnit 4, this annotation should be used in combination with * {@code @RunWith(SpringRunner.class)}. diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/data/couchbase/DataCouchbaseTest.java b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/data/couchbase/DataCouchbaseTest.java index 0e52d6f6617..5033e3051b0 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/data/couchbase/DataCouchbaseTest.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/data/couchbase/DataCouchbaseTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -40,8 +40,9 @@ import org.springframework.test.context.junit.jupiter.SpringExtension; * Annotation that can be used for a Data Couchbase test that focuses * only on Data Couchbase components. *
- * Using this annotation will disable full auto-configuration and instead apply only - * configuration relevant to Data Couchbase tests. + * Using this annotation only enables auto-configuration that is relevant to Data + * Couchbase tests. Similarly, component scanning is limited to Couchbase repositories and + * entities ({@code @Document}). *
* When using JUnit 4, this annotation should be used in combination with * {@code @RunWith(SpringRunner.class)}. diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/data/elasticsearch/DataElasticsearchTest.java b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/data/elasticsearch/DataElasticsearchTest.java index 336a3918beb..f992d9c24a0 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/data/elasticsearch/DataElasticsearchTest.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/data/elasticsearch/DataElasticsearchTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -40,8 +40,9 @@ import org.springframework.test.context.junit.jupiter.SpringExtension; * Annotation that can be used for a Data Elasticsearch test that focuses * only on Data Elasticsearch components. *
- * Using this annotation will disable full auto-configuration and instead apply only - * configuration relevant to Data Elasticsearch tests. + * Using this annotation only enables auto-configuration that is relevant to Data + * Elasticsearch tests. Similarly, component scanning is limited to Elasticsearch + * repositories and entities ({@code @Document}). *
* When using JUnit 4, this annotation should be used in combination with * {@code @RunWith(SpringRunner.class)}. diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/data/jdbc/DataJdbcTest.java b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/data/jdbc/DataJdbcTest.java index 02bb3699495..70d75f8f39b 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/data/jdbc/DataJdbcTest.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/data/jdbc/DataJdbcTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -43,9 +43,9 @@ import org.springframework.transaction.annotation.Transactional; * Annotation that can be used for a Data JDBC test that focuses only on * Data JDBC components. *
- * Using this annotation will disable full auto-configuration, scan for - * {@code AbstractJdbcConfiguration} subclasses, and apply only configuration relevant to - * Data JDBC tests. + * Using this annotation only enables auto-configuration that is relevant to Data JDBC + * tests. Similarly, component scanning is limited to JDBC repositories and entities + * ({@code @Table}), as well as beans that implement {@code AbstractJdbcConfiguration}. *
* By default, tests annotated with {@code @DataJdbcTest} are transactional and roll back * at the end of each test. They also use an embedded in-memory database (replacing any diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/data/ldap/DataLdapTest.java b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/data/ldap/DataLdapTest.java index 5f27b47072c..43fe1750cef 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/data/ldap/DataLdapTest.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/data/ldap/DataLdapTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -40,8 +40,9 @@ import org.springframework.test.context.junit.jupiter.SpringExtension; * Annotation that can be used for an LDAP test that focuses only on LDAP * components. *
- * Using this annotation will disable full auto-configuration and instead apply only - * configuration relevant to LDAP tests. + * Using this annotation only enables auto-configuration that is relevant to Data LDAP + * tests. Similarly, component scanning is limited to LDAP repositories and entities + * ({@code @Entry}). *
* By default, tests annotated with {@code @DataLdapTest} will use an embedded in-memory * LDAP process (if available). diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/data/mongo/DataMongoTest.java b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/data/mongo/DataMongoTest.java index 61bbc7225ba..c857448bbc0 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/data/mongo/DataMongoTest.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/data/mongo/DataMongoTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -40,8 +40,9 @@ import org.springframework.test.context.junit.jupiter.SpringExtension; * Annotation that can be used for a MongoDB test that focuses only on * MongoDB components. *
- * Using this annotation will disable full auto-configuration and instead apply only - * configuration relevant to MongoDB tests. + * Using this annotation only enables auto-configuration that is relevant to Data Mongo + * tests. Similarly, component scanning is limited to Mongo repositories and entities + * ({@code @Document}). *
* When using JUnit 4, this annotation should be used in combination with * {@code @RunWith(SpringRunner.class)}. diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/data/neo4j/DataNeo4jTest.java b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/data/neo4j/DataNeo4jTest.java index 15bc29bf6a5..668391c76b6 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/data/neo4j/DataNeo4jTest.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/data/neo4j/DataNeo4jTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -41,8 +41,9 @@ import org.springframework.transaction.annotation.Transactional; * Annotation that can be used for a Neo4j test that focuses only on * Neo4j components. *
- * Using this annotation will disable full auto-configuration and instead apply only - * configuration relevant to Neo4j tests. + * Using this annotation only enables auto-configuration that is relevant to Data Neo4j + * tests. Similarly, component scanning is limited to Neo4j repositories and entities + * ({@code @Node} and {@code @RelationshipProperties}). *
* By default, tests annotated with {@code @DataNeo4jTest} are transactional with the * usual test-related semantics (i.e. rollback by default). This feature is not supported diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/data/r2dbc/DataR2dbcTest.java b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/data/r2dbc/DataR2dbcTest.java index d49bbb805a4..9cd00b36e9f 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/data/r2dbc/DataR2dbcTest.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/data/r2dbc/DataR2dbcTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -39,8 +39,9 @@ import org.springframework.test.context.junit.jupiter.SpringExtension; * Annotation that can be used for a R2DBC test that focuses only on Data * R2DBC components. *
- * Using this annotation will disable full auto-configuration and instead apply only - * configuration relevant to Data R2DBC tests. + * Using this annotation only enables auto-configuration that is relevant to Data R2DBC + * tests. Similarly, component scanning is limited to R2DBC repositories and entities + * ({@code @Table}). *
* When using JUnit 4, this annotation should be used in combination with * {@code @RunWith(SpringRunner.class)}. diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/data/redis/DataRedisTest.java b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/data/redis/DataRedisTest.java index c15520ae96c..ab278f7b3b9 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/data/redis/DataRedisTest.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/data/redis/DataRedisTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -40,8 +40,9 @@ import org.springframework.test.context.junit.jupiter.SpringExtension; * Annotation for a Data Redis test that focuses only on Redis * components. *
- * Using this annotation will disable full auto-configuration and instead apply only - * configuration relevant to Redis tests. + * Using this annotation only enables auto-configuration that is relevant to Data Redis + * tests. Similarly, component scanning is limited to Redis repositories and entities + * ({@code @RedisHash}). *
* When using JUnit 4, this annotation should be used in combination with * {@code @RunWith(SpringRunner.class)}. diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/jdbc/JdbcTest.java b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/jdbc/JdbcTest.java index fa92db4e517..7de6d0e4f1c 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/jdbc/JdbcTest.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/jdbc/JdbcTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -41,8 +41,9 @@ import org.springframework.transaction.annotation.Transactional; /** * Annotation for a JDBC test that focuses only on JDBC-based components. *
- * Using this annotation will disable full auto-configuration and instead apply only - * configuration relevant to JDBC tests. + * Using this annotation only enables auto-configuration that is relevant to JDBC + * tests. Similarly, component scanning is configured to skip regular components and + * configuration properties. *
* By default, tests annotated with {@code @JdbcTest} are transactional and roll back at * the end of each test. They also use an embedded in-memory database (replacing any diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/jooq/JooqTest.java b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/jooq/JooqTest.java index 76270aa3534..3e9dc1caf69 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/jooq/JooqTest.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/jooq/JooqTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -41,8 +41,9 @@ import org.springframework.transaction.annotation.Transactional; /** * Annotation for a jOOQ test that focuses only on jOOQ-based components. *
- * Using this annotation will disable full auto-configuration and instead apply only - * configuration relevant to jOOQ tests. + * Using this annotation only enables auto-configuration that is relevant to jOOQ + * tests. Similarly, component scanning is configured to skip regular components and + * configuration properties. *
* By default, tests annotated with {@code @JooqTest} use the configured database. If you * want to replace any explicit or usually auto-configured DataSource by an embedded diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/json/JsonTest.java b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/json/JsonTest.java index 4a64e30c7e9..60cb5826de6 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/json/JsonTest.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/json/JsonTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -42,9 +42,16 @@ import org.springframework.test.context.junit.jupiter.SpringExtension; /** * Annotation for a JSON test that focuses only on JSON serialization. *
- * Using this annotation will disable full auto-configuration and instead apply only - * configuration relevant to JSON tests (i.e. {@code @JsonComponent}, Jackson - * {@code Module}) + * Using this annotation only enables auto-configuration that is relevant to JSON tests. + * Similarly, component scanning is limited to beans annotated with: + *
+ * as well as beans that implement: + *
* By default, tests annotated with {@code JsonTest} will also initialize * {@link JacksonTester}, {@link JsonbTester} and {@link GsonTester} fields. More diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/orm/jpa/DataJpaTest.java b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/orm/jpa/DataJpaTest.java index 26de93fdb15..de0b7171bed 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/orm/jpa/DataJpaTest.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/orm/jpa/DataJpaTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2021 the original author or authors. + * Copyright 2012-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -44,8 +44,9 @@ import org.springframework.transaction.annotation.Transactional; /** * Annotation for a JPA test that focuses only on JPA components. *
- * Using this annotation will disable full auto-configuration and instead apply only - * configuration relevant to JPA tests. + * Using this annotation only enables auto-configuration that is relevant to Data JPA + * tests. Similarly, component scanning is limited to JPA repositories and entities + * ({@code @Entity}). *
* By default, tests annotated with {@code @DataJpaTest} are transactional and roll back * at the end of each test. They also use an embedded in-memory database (replacing any diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/client/RestClientTest.java b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/client/RestClientTest.java index 31c2afcaa7b..0801f117acb 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/client/RestClientTest.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/client/RestClientTest.java @@ -34,7 +34,6 @@ import org.springframework.boot.web.client.RestTemplateBuilder; import org.springframework.context.annotation.ComponentScan; import org.springframework.core.annotation.AliasFor; import org.springframework.core.env.Environment; -import org.springframework.stereotype.Component; import org.springframework.test.context.BootstrapWith; import org.springframework.test.context.junit.jupiter.SpringExtension; import org.springframework.test.web.client.MockRestServiceServer; @@ -45,9 +44,16 @@ import org.springframework.web.client.RestTemplate; * Annotation for a Spring rest client test that focuses only on beans * that use {@link RestTemplateBuilder} or {@link Builder RestClient.Builder}. *
- * Using this annotation will disable full auto-configuration and instead apply only - * configuration relevant to rest client tests (i.e. Jackson or GSON auto-configuration - * and {@code @JsonComponent} beans, but not regular {@link Component @Component} beans). + * Using this annotation only enables auto-configuration that is relevant to rest client + * tests. Similarly, component scanning is limited to beans annotated with: + *
+ * as well as beans that implement: + *
* By default, tests annotated with {@code RestClientTest} will also auto-configure a * {@link MockRestServiceServer}. For more fine-grained control the diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/reactive/WebFluxTest.java b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/reactive/WebFluxTest.java index ece41ac642d..746ae2f51a4 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/reactive/WebFluxTest.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/reactive/WebFluxTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -44,11 +44,24 @@ import org.springframework.test.web.reactive.server.WebTestClient; * Annotation that can be used for a Spring WebFlux test that focuses * only on Spring WebFlux components. *
- * Using this annotation will disable full auto-configuration and instead apply only - * configuration relevant to WebFlux tests (i.e. {@code @Controller}, - * {@code @ControllerAdvice}, {@code @JsonComponent}, - * {@code Converter}/{@code GenericConverter}, and {@code WebFluxConfigurer} beans but not - * {@code @Component}, {@code @Service} or {@code @Repository} beans). + * Using this annotation only enables auto-configuration that is relevant to WebFlux + * tests. Similarly, component scanning is limited to beans annotated with: + *
+ * as well as beans that implement: + *
* By default, tests annotated with {@code @WebFluxTest} will also auto-configure a * {@link WebTestClient}. For more fine-grained control of WebTestClient the diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/WebMvcTest.java b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/WebMvcTest.java index 57b53e2f2bf..1674e5926de 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/WebMvcTest.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/WebMvcTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -43,12 +43,32 @@ import org.springframework.test.web.servlet.MockMvc; * Annotation that can be used for a Spring MVC test that focuses only on * Spring MVC components. *
- * Using this annotation will disable full auto-configuration and instead apply only - * configuration relevant to MVC tests (i.e. {@code @Controller}, - * {@code @ControllerAdvice}, {@code @JsonComponent}, - * {@code Converter}/{@code GenericConverter}, {@code Filter}, {@code WebMvcConfigurer} - * and {@code HandlerMethodArgumentResolver} beans but not {@code @Component}, - * {@code @Service} or {@code @Repository} beans). + * Using this annotation only enables auto-configuration that is relevant to MVC tests. + * Similarly, component scanning is limited to beans annotated with: + *
+ * as well as beans that implement: + *
* By default, tests annotated with {@code @WebMvcTest} will also auto-configure Spring * Security and {@link MockMvc} (include support for HtmlUnit WebClient and Selenium diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/webservices/server/WebServiceServerTest.java b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/webservices/server/WebServiceServerTest.java index 442a2fb167c..eb3d6be22b9 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/webservices/server/WebServiceServerTest.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/webservices/server/WebServiceServerTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2021 the original author or authors. + * Copyright 2012-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -39,10 +39,16 @@ import org.springframework.test.context.junit.jupiter.SpringExtension; * Annotation that can be used for a typical Spring web service server test. Can be used * when a test focuses only on Spring WS endpoints. *
- * Using this annotation will disable full auto-configuration and instead apply only - * configuration relevant to Web Service server tests (i.e. {@code Endpoint} and - * {@code EndpointInterceptor} beans but not {@code @Component}, {@code @Service} or - * {@code @Repository} beans). + * Using this annotation only enables auto-configuration that is relevant to Web Service + * Server tests. Similarly, component scanning is limited to beans annotated with: + *
+ * as well as beans that implement: + *
* Typically {@code WebServiceServerTest} is used in combination with * {@link org.springframework.boot.test.mock.mockito.MockBean @MockBean} or