Skip to content

Commit ce92644

Browse files
wilkinsonapull[bot]
authored andcommitted
Rework test slice annotation javadoc to reflect JUnit 5 default
Closes spring-projectsgh-18178
1 parent 2838ec4 commit ce92644

File tree

12 files changed

+51
-31
lines changed

12 files changed

+51
-31
lines changed

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

+4-2
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@
4040
import org.springframework.transaction.annotation.Transactional;
4141

4242
/**
43-
* Annotation that can be used in combination with {@code @RunWith(SpringRunner.class)}
44-
* for a typical Data JDBC test. Can be used when a test focuses <strong>only</strong> on
43+
* Annotation that can be used for a Data JDBC test that focuses <strong>only</strong> on
4544
* Data JDBC components.
4645
* <p>
4746
* Using this annotation will disable full auto-configuration and instead apply only
@@ -57,6 +56,9 @@
5756
* database, you should consider {@link SpringBootTest @SpringBootTest} combined with
5857
* {@link AutoConfigureTestDatabase @AutoConfigureTestDatabase} rather than this
5958
* annotation.
59+
* <p>
60+
* When using JUnit 4, this annotation should be used in combination with
61+
* {@code @RunWith(SpringRunner.class)}.
6062
*
6163
* @author Andy Wilkinson
6264
* @since 2.1.0

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

+4-2
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,17 @@
3737
import org.springframework.test.context.junit.jupiter.SpringExtension;
3838

3939
/**
40-
* Annotation that can be used in combination with {@code @RunWith(SpringRunner.class)}
41-
* for a typical LDAP test. Can be used when a test focuses <strong>only</strong> on LDAP
40+
* Annotation that can be used for an LDAP test that focuses <strong>only</strong> on LDAP
4241
* components.
4342
* <p>
4443
* Using this annotation will disable full auto-configuration and instead apply only
4544
* configuration relevant to LDAP tests.
4645
* <p>
4746
* By default, tests annotated with {@code @DataLdapTest} will use an embedded in-memory
4847
* LDAP process (if available).
48+
* <p>
49+
* When using JUnit 4, this annotation should be used in combination with
50+
* {@code @RunWith(SpringRunner.class)}.
4951
*
5052
* @author Eddú Meléndez
5153
* @author Artsiom Yudovin

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

+4-2
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,17 @@
3737
import org.springframework.test.context.junit.jupiter.SpringExtension;
3838

3939
/**
40-
* Annotation that can be used in combination with {@code @RunWith(SpringRunner.class)}
41-
* for a typical MongoDB test. Can be used when a test focuses <strong>only</strong> on
40+
* Annotation that can be used for a MongoDB test that focuses <strong>only</strong> on
4241
* MongoDB components.
4342
* <p>
4443
* Using this annotation will disable full auto-configuration and instead apply only
4544
* configuration relevant to MongoDB tests.
4645
* <p>
4746
* By default, tests annotated with {@code @DataMongoTest} will use an embedded in-memory
4847
* MongoDB process (if available).
48+
* <p>
49+
* When using JUnit 4, this annotation should be used in combination with
50+
* {@code @RunWith(SpringRunner.class)}.
4951
*
5052
* @author Michael Simons
5153
* @author Stephane Nicoll

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

+4-2
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@
3838
import org.springframework.transaction.annotation.Transactional;
3939

4040
/**
41-
* Annotation that can be used in combination with {@code @RunWith(SpringRunner.class)}
42-
* for a typical Neo4j test. Can be used when a test focuses <strong>only</strong> on
41+
* Annotation that can be used for a Neo4j test that focuses <strong>only</strong> on
4342
* Neo4j components.
4443
* <p>
4544
* Using this annotation will disable full auto-configuration and instead apply only
@@ -48,6 +47,9 @@
4847
* By default, tests annotated with {@code @DataNeo4jTest} will use an embedded in-memory
4948
* Neo4j process (if available). They will also be transactional with the usual
5049
* test-related semantics (i.e. rollback by default).
50+
* <p>
51+
* When using JUnit 4, this annotation should be used in combination with
52+
* {@code @RunWith(SpringRunner.class)}.
5153
*
5254
* @author Eddú Meléndez
5355
* @author Stephane Nicoll

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

+5-3
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,14 @@
3737
import org.springframework.test.context.junit.jupiter.SpringExtension;
3838

3939
/**
40-
* Annotation that can be used in combination with {@code @RunWith(SpringRunner.class)}
41-
* for a typical Data Redis test. Can be used when a test focuses <strong>only</strong> on
42-
* Redis components.
40+
* Annotation for a Data Redis test that focuses <strong>only</strong> on Redis
41+
* components.
4342
* <p>
4443
* Using this annotation will disable full auto-configuration and instead apply only
4544
* configuration relevant to Redis tests.
45+
* <p>
46+
* When using JUnit 4, this annotation should be used in combination with
47+
* {@code @RunWith(SpringRunner.class)}.
4648
*
4749
* @author Jayaram Pradhan
4850
* @author Artsiom Yudovin

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

+5-4
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,10 @@
3939
import org.springframework.transaction.annotation.Transactional;
4040

4141
/**
42-
* Annotation that can be used in combination with {@code @RunWith(SpringRunner.class)}
43-
* for a typical jdbc test. Can be used when a test focuses <strong>only</strong> on
44-
* jdbc-based components.
42+
* Annotation for a JDBC test that focuses <strong>only</strong> on JDBC-based components.
4543
* <p>
4644
* Using this annotation will disable full auto-configuration and instead apply only
47-
* configuration relevant to jdbc tests.
45+
* configuration relevant to JDBC tests.
4846
* <p>
4947
* By default, tests annotated with {@code @JdbcTest} are transactional and roll back at
5048
* the end of each test. They also use an embedded in-memory database (replacing any
@@ -56,6 +54,9 @@
5654
* database, you should consider {@link SpringBootTest @SpringBootTest} combined with
5755
* {@link AutoConfigureTestDatabase @AutoConfigureTestDatabase} rather than this
5856
* annotation.
57+
* <p>
58+
* When using JUnit 4, this annotation should be used in combination with
59+
* {@code @RunWith(SpringRunner.class)}.
5960
*
6061
* @author Stephane Nicoll
6162
* @author Artsiom Yudovin

spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/jooq/JooqTest.java

+4-3
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,7 @@
3939
import org.springframework.transaction.annotation.Transactional;
4040

4141
/**
42-
* Annotation that can be used in combination with {@code @RunWith(SpringRunner.class)}
43-
* for a typical jOOQ test. Can be used when a test focuses <strong>only</strong> on
44-
* jOOQ-based components.
42+
* Annotation for a jOOQ test that focuses <strong>only</strong> on jOOQ-based components.
4543
* <p>
4644
* Using this annotation will disable full auto-configuration and instead apply only
4745
* configuration relevant to jOOQ tests.
@@ -50,6 +48,9 @@
5048
* want to replace any explicit or usually auto-configured DataSource by an embedded
5149
* in-memory database, the {@link AutoConfigureTestDatabase @AutoConfigureTestDatabase}
5250
* annotation can be used to override these settings.
51+
* <p>
52+
* When using JUnit 4, this annotation should be used in combination with
53+
* {@code @RunWith(SpringRunner.class)}.
5354
*
5455
* @author Michael Simons
5556
* @author Stephane Nicoll

spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/json/JsonTest.java

+4-3
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,7 @@
4040
import org.springframework.test.context.junit.jupiter.SpringExtension;
4141

4242
/**
43-
* Annotation that can be used in combination with {@code @RunWith(SpringRunner.class)}
44-
* for a typical JSON test. Can be used when a test focuses <strong>only</strong> on JSON
45-
* serialization.
43+
* Annotation for a JSON test that focuses <strong>only</strong> on JSON serialization.
4644
* <p>
4745
* Using this annotation will disable full auto-configuration and instead apply only
4846
* configuration relevant to JSON tests (i.e. {@code @JsonComponent}, Jackson
@@ -52,6 +50,9 @@
5250
* {@link JacksonTester}, {@link JsonbTester} and {@link GsonTester} fields. More
5351
* fine-grained control can be provided via the
5452
* {@link AutoConfigureJsonTesters @AutoConfigureJsonTesters} annotation.
53+
* <p>
54+
* When using JUnit 4, this annotation should be used in combination with
55+
* {@code @RunWith(SpringRunner.class)}.
5556
*
5657
* @author Phillip Webb
5758
* @author Artsiom Yudovin

spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/orm/jpa/DataJpaTest.java

+4-3
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,7 @@
4141
import org.springframework.transaction.annotation.Transactional;
4242

4343
/**
44-
* Annotation that can be used in combination with {@code @RunWith(SpringRunner.class)}
45-
* for a typical JPA test. Can be used when a test focuses <strong>only</strong> on JPA
46-
* components.
44+
* Annotation for a JPA test that focuses <strong>only</strong> on JPA components.
4745
* <p>
4846
* Using this annotation will disable full auto-configuration and instead apply only
4947
* configuration relevant to JPA tests.
@@ -58,6 +56,9 @@
5856
* database, you should consider {@link SpringBootTest @SpringBootTest} combined with
5957
* {@link AutoConfigureTestDatabase @AutoConfigureTestDatabase} rather than this
6058
* annotation.
59+
* <p>
60+
* When using JUnit 4, this annotation should be used in combination with
61+
* {@code @RunWith(SpringRunner.class)}.
6162
*
6263
* @author Phillip Webb
6364
* @author Artsiom Yudovin

spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/client/RestClientTest.java

+5-3
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,8 @@
4141
import org.springframework.web.client.RestTemplate;
4242

4343
/**
44-
* Annotation that can be used in combination with {@code @RunWith(SpringRunner.class)}
45-
* for a typical Spring rest client test. Can be used when a test focuses
46-
* <strong>only</strong> on beans that use {@link RestTemplateBuilder}.
44+
* Annotation for a Spring rest client test that focuses <strong>only</strong> on beans
45+
* that use {@link RestTemplateBuilder}.
4746
* <p>
4847
* Using this annotation will disable full auto-configuration and instead apply only
4948
* configuration relevant to rest client tests (i.e. Jackson or GSON auto-configuration
@@ -57,6 +56,9 @@
5756
* If you are testing a bean that doesn't use {@link RestTemplateBuilder} but instead
5857
* injects a {@link RestTemplate} directly, you can add
5958
* {@code @AutoConfigureWebClient(registerRestTemplate=true)}.
59+
* <p>
60+
* When using JUnit 4, this annotation should be used in combination with
61+
* {@code @RunWith(SpringRunner.class)}.
6062
*
6163
* @author Stephane Nicoll
6264
* @author Phillip Webb

spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/reactive/WebFluxTest.java

+4-2
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,7 @@
4242
import org.springframework.test.web.reactive.server.WebTestClient;
4343

4444
/**
45-
* Annotation that can be used in combination with {@code @RunWith(SpringRunner.class)}
46-
* for a typical Spring WebFlux test. Can be used when a test focuses
45+
* Annotation that can be used for a Spring WebFlux test that focuses
4746
* <strong>only</strong> on Spring WebFlux components.
4847
* <p>
4948
* Using this annotation will disable full auto-configuration and instead apply only
@@ -64,6 +63,9 @@
6463
* you should consider {@link SpringBootTest @SpringBootTest} combined with
6564
* {@link AutoConfigureWebTestClient @AutoConfigureWebTestClient} rather than this
6665
* annotation.
66+
* <p>
67+
* When using JUnit 4, this annotation should be used in combination with
68+
* {@code @RunWith(SpringRunner.class)}.
6769
*
6870
* @author Stephane Nicoll
6971
* @author Artsiom Yudovin

spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/WebMvcTest.java

+4-2
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@
4141
import org.springframework.test.web.servlet.MockMvc;
4242

4343
/**
44-
* Annotation that can be used in combination with {@code @RunWith(SpringRunner.class)}
45-
* for a typical Spring MVC test. Can be used when a test focuses <strong>only</strong> on
44+
* Annotation that can be used for a Spring MVC test that focuses <strong>only</strong> on
4645
* Spring MVC components.
4746
* <p>
4847
* Using this annotation will disable full auto-configuration and instead apply only
@@ -64,6 +63,9 @@
6463
* If you are looking to load your full application configuration and use MockMVC, you
6564
* should consider {@link SpringBootTest @SpringBootTest} combined with
6665
* {@link AutoConfigureMockMvc @AutoConfigureMockMvc} rather than this annotation.
66+
* <p>
67+
* When using JUnit 4, this annotation should be used in combination with
68+
* {@code @RunWith(SpringRunner.class)}.
6769
*
6870
* @author Phillip Webb
6971
* @author Artsiom Yudovin

0 commit comments

Comments
 (0)