Skip to content

Commit f1e5108

Browse files
committed
Improve Javadoc of slice test annotations
This commit harmonizes the phrasing that we use to describe what components are considered for scanning when a slice test is enabled. This makes the description of the default filter explicit, with an exhaustive description of the annotations and/or base classes. Closes gh-41914
1 parent 6fd1f0f commit f1e5108

File tree

17 files changed

+126
-63
lines changed

17 files changed

+126
-63
lines changed

spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/data/cassandra/DataCassandraTest.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2020 the original author or authors.
2+
* Copyright 2012-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -40,8 +40,9 @@
4040
* Annotation that can be used for a Cassandra test that focuses <strong>only</strong> on
4141
* Cassandra components.
4242
* <p>
43-
* Using this annotation will disable full auto-configuration and instead apply only
44-
* configuration relevant to Cassandra tests.
43+
* Using this annotation only enables auto-configuration that is relevant to Data Casandra
44+
* tests. Similarly, component scanning is limited to Cassandra repositories and entities
45+
* ({@code @Table}).
4546
* <p>
4647
* When using JUnit 4, this annotation should be used in combination with
4748
* {@code @RunWith(SpringRunner.class)}.

spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/data/couchbase/DataCouchbaseTest.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2022 the original author or authors.
2+
* Copyright 2012-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -40,8 +40,9 @@
4040
* Annotation that can be used for a Data Couchbase test that focuses
4141
* <strong>only</strong> on Data Couchbase components.
4242
* <p>
43-
* Using this annotation will disable full auto-configuration and instead apply only
44-
* configuration relevant to Data Couchbase tests.
43+
* Using this annotation only enables auto-configuration that is relevant to Data
44+
* Couchbase tests. Similarly, component scanning is limited to Couchbase repositories and
45+
* entities ({@code @Document}).
4546
* <p>
4647
* When using JUnit 4, this annotation should be used in combination with
4748
* {@code @RunWith(SpringRunner.class)}.

spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/data/elasticsearch/DataElasticsearchTest.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2022 the original author or authors.
2+
* Copyright 2012-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -40,8 +40,9 @@
4040
* Annotation that can be used for a Data Elasticsearch test that focuses
4141
* <strong>only</strong> on Data Elasticsearch components.
4242
* <p>
43-
* Using this annotation will disable full auto-configuration and instead apply only
44-
* configuration relevant to Data Elasticsearch tests.
43+
* Using this annotation only enables auto-configuration that is relevant to Data
44+
* Elasticsearch tests. Similarly, component scanning is limited to Elasticsearch
45+
* repositories and entities ({@code @Document}).
4546
* <p>
4647
* When using JUnit 4, this annotation should be used in combination with
4748
* {@code @RunWith(SpringRunner.class)}.

spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/data/jdbc/DataJdbcTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2022 the original author or authors.
2+
* Copyright 2012-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -43,9 +43,9 @@
4343
* Annotation that can be used for a Data JDBC test that focuses <strong>only</strong> on
4444
* Data JDBC components.
4545
* <p>
46-
* Using this annotation will disable full auto-configuration, scan for
47-
* {@code AbstractJdbcConfiguration} subclasses, and apply only configuration relevant to
48-
* Data JDBC tests.
46+
* Using this annotation only enables auto-configuration that is relevant to Data JDBC
47+
* tests. Similarly, component scanning is limited to JDBC repositories and entities
48+
* ({@code @Table}), as well as beans that implement {@code AbstractJdbcConfiguration}.
4949
* <p>
5050
* By default, tests annotated with {@code @DataJdbcTest} are transactional and roll back
5151
* at the end of each test. They also use an embedded in-memory database (replacing any

spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/data/ldap/DataLdapTest.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2019 the original author or authors.
2+
* Copyright 2012-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -40,8 +40,9 @@
4040
* Annotation that can be used for an LDAP test that focuses <strong>only</strong> on LDAP
4141
* components.
4242
* <p>
43-
* Using this annotation will disable full auto-configuration and instead apply only
44-
* configuration relevant to LDAP tests.
43+
* Using this annotation only enables auto-configuration that is relevant to Data LDAP
44+
* tests. Similarly, component scanning is limited to LDAP repositories and entities
45+
* ({@code @Entry}).
4546
* <p>
4647
* By default, tests annotated with {@code @DataLdapTest} will use an embedded in-memory
4748
* LDAP process (if available).

spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/data/mongo/DataMongoTest.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2022 the original author or authors.
2+
* Copyright 2012-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -40,8 +40,9 @@
4040
* Annotation that can be used for a MongoDB test that focuses <strong>only</strong> on
4141
* MongoDB components.
4242
* <p>
43-
* Using this annotation will disable full auto-configuration and instead apply only
44-
* configuration relevant to MongoDB tests.
43+
* Using this annotation only enables auto-configuration that is relevant to Data Mongo
44+
* tests. Similarly, component scanning is limited to Mongo repositories and entities
45+
* ({@code @Document}).
4546
* <p>
4647
* When using JUnit 4, this annotation should be used in combination with
4748
* {@code @RunWith(SpringRunner.class)}.

spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/data/neo4j/DataNeo4jTest.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2020 the original author or authors.
2+
* Copyright 2012-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -41,8 +41,9 @@
4141
* Annotation that can be used for a Neo4j test that focuses <strong>only</strong> on
4242
* Neo4j components.
4343
* <p>
44-
* Using this annotation will disable full auto-configuration and instead apply only
45-
* configuration relevant to Neo4j tests.
44+
* Using this annotation only enables auto-configuration that is relevant to Data Neo4j
45+
* tests. Similarly, component scanning is limited to Neo4j repositories and entities
46+
* ({@code @Node} and {@code @RelationshipProperties}).
4647
* <p>
4748
* By default, tests annotated with {@code @DataNeo4jTest} are transactional with the
4849
* usual test-related semantics (i.e. rollback by default). This feature is not supported

spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/data/r2dbc/DataR2dbcTest.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2020 the original author or authors.
2+
* Copyright 2012-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -39,8 +39,9 @@
3939
* Annotation that can be used for a R2DBC test that focuses <strong>only</strong> on Data
4040
* R2DBC components.
4141
* <p>
42-
* Using this annotation will disable full auto-configuration and instead apply only
43-
* configuration relevant to Data R2DBC tests.
42+
* Using this annotation only enables auto-configuration that is relevant to Data R2DBC
43+
* tests. Similarly, component scanning is limited to R2DBC repositories and entities
44+
* ({@code @Table}).
4445
* <p>
4546
* When using JUnit 4, this annotation should be used in combination with
4647
* {@code @RunWith(SpringRunner.class)}.

spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/data/redis/DataRedisTest.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2019 the original author or authors.
2+
* Copyright 2012-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -40,8 +40,9 @@
4040
* Annotation for a Data Redis test that focuses <strong>only</strong> on Redis
4141
* components.
4242
* <p>
43-
* Using this annotation will disable full auto-configuration and instead apply only
44-
* configuration relevant to Redis tests.
43+
* Using this annotation only enables auto-configuration that is relevant to Data Redis
44+
* tests. Similarly, component scanning is limited to Redis repositories and entities
45+
* ({@code @RedisHash}).
4546
* <p>
4647
* When using JUnit 4, this annotation should be used in combination with
4748
* {@code @RunWith(SpringRunner.class)}.

spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/jdbc/JdbcTest.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2019 the original author or authors.
2+
* Copyright 2012-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -41,8 +41,9 @@
4141
/**
4242
* Annotation for a JDBC test that focuses <strong>only</strong> on JDBC-based components.
4343
* <p>
44-
* Using this annotation will disable full auto-configuration and instead apply only
45-
* configuration relevant to JDBC tests.
44+
* Using this annotation only enables auto-configuration that is relevant to JDBC
45+
* tests. Similarly, component scanning is configured to skip regular components and
46+
* configuration properties.
4647
* <p>
4748
* By default, tests annotated with {@code @JdbcTest} are transactional and roll back at
4849
* the end of each test. They also use an embedded in-memory database (replacing any

0 commit comments

Comments
 (0)