Rework test slice annotation javadoc to reflect JUnit 5 default

Closes gh-18178
pull/18270/head
Andy Wilkinson 5 years ago
parent 0a2ae89470
commit 6534047fcf

@ -40,8 +40,7 @@ import org.springframework.test.context.junit.jupiter.SpringExtension;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
/** /**
* Annotation that can be used in combination with {@code @RunWith(SpringRunner.class)} * Annotation that can be used for a Data JDBC test that focuses <strong>only</strong> on
* for a typical Data JDBC test. Can be used when a test focuses <strong>only</strong> on
* Data JDBC components. * Data JDBC components.
* <p> * <p>
* Using this annotation will disable full auto-configuration and instead apply only * Using this annotation will disable full auto-configuration and instead apply only
@ -57,6 +56,9 @@ import org.springframework.transaction.annotation.Transactional;
* database, you should consider {@link SpringBootTest @SpringBootTest} combined with * database, you should consider {@link SpringBootTest @SpringBootTest} combined with
* {@link AutoConfigureTestDatabase @AutoConfigureTestDatabase} rather than this * {@link AutoConfigureTestDatabase @AutoConfigureTestDatabase} rather than this
* annotation. * annotation.
* <p>
* When using JUnit 4, this annotation should be used in combination with
* {@code @RunWith(SpringRunner.class)}.
* *
* @author Andy Wilkinson * @author Andy Wilkinson
* @since 2.1.0 * @since 2.1.0

@ -37,8 +37,7 @@ import org.springframework.test.context.BootstrapWith;
import org.springframework.test.context.junit.jupiter.SpringExtension; import org.springframework.test.context.junit.jupiter.SpringExtension;
/** /**
* Annotation that can be used in combination with {@code @RunWith(SpringRunner.class)} * Annotation that can be used for an LDAP test that focuses <strong>only</strong> on LDAP
* for a typical LDAP test. Can be used when a test focuses <strong>only</strong> on LDAP
* components. * components.
* <p> * <p>
* Using this annotation will disable full auto-configuration and instead apply only * Using this annotation will disable full auto-configuration and instead apply only
@ -46,6 +45,9 @@ import org.springframework.test.context.junit.jupiter.SpringExtension;
* <p> * <p>
* By default, tests annotated with {@code @DataLdapTest} will use an embedded in-memory * By default, tests annotated with {@code @DataLdapTest} will use an embedded in-memory
* LDAP process (if available). * LDAP process (if available).
* <p>
* When using JUnit 4, this annotation should be used in combination with
* {@code @RunWith(SpringRunner.class)}.
* *
* @author Eddú Meléndez * @author Eddú Meléndez
* @author Artsiom Yudovin * @author Artsiom Yudovin

@ -37,8 +37,7 @@ import org.springframework.test.context.BootstrapWith;
import org.springframework.test.context.junit.jupiter.SpringExtension; import org.springframework.test.context.junit.jupiter.SpringExtension;
/** /**
* Annotation that can be used in combination with {@code @RunWith(SpringRunner.class)} * Annotation that can be used for a MongoDB test that focuses <strong>only</strong> on
* for a typical MongoDB test. Can be used when a test focuses <strong>only</strong> on
* MongoDB components. * MongoDB components.
* <p> * <p>
* Using this annotation will disable full auto-configuration and instead apply only * Using this annotation will disable full auto-configuration and instead apply only
@ -46,6 +45,9 @@ import org.springframework.test.context.junit.jupiter.SpringExtension;
* <p> * <p>
* By default, tests annotated with {@code @DataMongoTest} will use an embedded in-memory * By default, tests annotated with {@code @DataMongoTest} will use an embedded in-memory
* MongoDB process (if available). * MongoDB process (if available).
* <p>
* When using JUnit 4, this annotation should be used in combination with
* {@code @RunWith(SpringRunner.class)}.
* *
* @author Michael Simons * @author Michael Simons
* @author Stephane Nicoll * @author Stephane Nicoll

@ -38,8 +38,7 @@ import org.springframework.test.context.junit.jupiter.SpringExtension;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
/** /**
* Annotation that can be used in combination with {@code @RunWith(SpringRunner.class)} * Annotation that can be used for a Neo4j test that focuses <strong>only</strong> on
* for a typical Neo4j test. Can be used when a test focuses <strong>only</strong> on
* Neo4j components. * Neo4j components.
* <p> * <p>
* Using this annotation will disable full auto-configuration and instead apply only * Using this annotation will disable full auto-configuration and instead apply only
@ -48,6 +47,9 @@ import org.springframework.transaction.annotation.Transactional;
* By default, tests annotated with {@code @DataNeo4jTest} will use an embedded in-memory * By default, tests annotated with {@code @DataNeo4jTest} will use an embedded in-memory
* Neo4j process (if available). They will also be transactional with the usual * Neo4j process (if available). They will also be transactional with the usual
* test-related semantics (i.e. rollback by default). * test-related semantics (i.e. rollback by default).
* <p>
* When using JUnit 4, this annotation should be used in combination with
* {@code @RunWith(SpringRunner.class)}.
* *
* @author Eddú Meléndez * @author Eddú Meléndez
* @author Stephane Nicoll * @author Stephane Nicoll

@ -37,12 +37,14 @@ import org.springframework.test.context.BootstrapWith;
import org.springframework.test.context.junit.jupiter.SpringExtension; import org.springframework.test.context.junit.jupiter.SpringExtension;
/** /**
* Annotation that can be used in combination with {@code @RunWith(SpringRunner.class)} * Annotation for a Data Redis test that focuses <strong>only</strong> on Redis
* for a typical Data Redis test. Can be used when a test focuses <strong>only</strong> on * components.
* Redis components.
* <p> * <p>
* Using this annotation will disable full auto-configuration and instead apply only * Using this annotation will disable full auto-configuration and instead apply only
* configuration relevant to Redis tests. * configuration relevant to Redis tests.
* <p>
* When using JUnit 4, this annotation should be used in combination with
* {@code @RunWith(SpringRunner.class)}.
* *
* @author Jayaram Pradhan * @author Jayaram Pradhan
* @author Artsiom Yudovin * @author Artsiom Yudovin

@ -39,12 +39,10 @@ import org.springframework.test.context.junit.jupiter.SpringExtension;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
/** /**
* Annotation that can be used in combination with {@code @RunWith(SpringRunner.class)} * Annotation for a JDBC test that focuses <strong>only</strong> on JDBC-based components.
* for a typical jdbc test. Can be used when a test focuses <strong>only</strong> on
* jdbc-based components.
* <p> * <p>
* Using this annotation will disable full auto-configuration and instead apply only * Using this annotation will disable full auto-configuration and instead apply only
* configuration relevant to jdbc tests. * configuration relevant to JDBC tests.
* <p> * <p>
* By default, tests annotated with {@code @JdbcTest} are transactional and roll back at * 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 * the end of each test. They also use an embedded in-memory database (replacing any
@ -56,6 +54,9 @@ import org.springframework.transaction.annotation.Transactional;
* database, you should consider {@link SpringBootTest @SpringBootTest} combined with * database, you should consider {@link SpringBootTest @SpringBootTest} combined with
* {@link AutoConfigureTestDatabase @AutoConfigureTestDatabase} rather than this * {@link AutoConfigureTestDatabase @AutoConfigureTestDatabase} rather than this
* annotation. * annotation.
* <p>
* When using JUnit 4, this annotation should be used in combination with
* {@code @RunWith(SpringRunner.class)}.
* *
* @author Stephane Nicoll * @author Stephane Nicoll
* @author Artsiom Yudovin * @author Artsiom Yudovin

@ -39,9 +39,7 @@ import org.springframework.test.context.junit.jupiter.SpringExtension;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
/** /**
* Annotation that can be used in combination with {@code @RunWith(SpringRunner.class)} * Annotation for a jOOQ test that focuses <strong>only</strong> on jOOQ-based components.
* for a typical jOOQ test. Can be used when a test focuses <strong>only</strong> on
* jOOQ-based components.
* <p> * <p>
* Using this annotation will disable full auto-configuration and instead apply only * Using this annotation will disable full auto-configuration and instead apply only
* configuration relevant to jOOQ tests. * configuration relevant to jOOQ tests.
@ -50,6 +48,9 @@ import org.springframework.transaction.annotation.Transactional;
* want to replace any explicit or usually auto-configured DataSource by an embedded * want to replace any explicit or usually auto-configured DataSource by an embedded
* in-memory database, the {@link AutoConfigureTestDatabase @AutoConfigureTestDatabase} * in-memory database, the {@link AutoConfigureTestDatabase @AutoConfigureTestDatabase}
* annotation can be used to override these settings. * annotation can be used to override these settings.
* <p>
* When using JUnit 4, this annotation should be used in combination with
* {@code @RunWith(SpringRunner.class)}.
* *
* @author Michael Simons * @author Michael Simons
* @author Stephane Nicoll * @author Stephane Nicoll

@ -40,9 +40,7 @@ import org.springframework.test.context.BootstrapWith;
import org.springframework.test.context.junit.jupiter.SpringExtension; import org.springframework.test.context.junit.jupiter.SpringExtension;
/** /**
* Annotation that can be used in combination with {@code @RunWith(SpringRunner.class)} * Annotation for a JSON test that focuses <strong>only</strong> on JSON serialization.
* for a typical JSON test. Can be used when a test focuses <strong>only</strong> on JSON
* serialization.
* <p> * <p>
* Using this annotation will disable full auto-configuration and instead apply only * Using this annotation will disable full auto-configuration and instead apply only
* configuration relevant to JSON tests (i.e. {@code @JsonComponent}, Jackson * configuration relevant to JSON tests (i.e. {@code @JsonComponent}, Jackson
@ -52,6 +50,9 @@ import org.springframework.test.context.junit.jupiter.SpringExtension;
* {@link JacksonTester}, {@link JsonbTester} and {@link GsonTester} fields. More * {@link JacksonTester}, {@link JsonbTester} and {@link GsonTester} fields. More
* fine-grained control can be provided via the * fine-grained control can be provided via the
* {@link AutoConfigureJsonTesters @AutoConfigureJsonTesters} annotation. * {@link AutoConfigureJsonTesters @AutoConfigureJsonTesters} annotation.
* <p>
* When using JUnit 4, this annotation should be used in combination with
* {@code @RunWith(SpringRunner.class)}.
* *
* @author Phillip Webb * @author Phillip Webb
* @author Artsiom Yudovin * @author Artsiom Yudovin

@ -41,9 +41,7 @@ import org.springframework.test.context.junit.jupiter.SpringExtension;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
/** /**
* Annotation that can be used in combination with {@code @RunWith(SpringRunner.class)} * Annotation for a JPA test that focuses <strong>only</strong> on JPA components.
* for a typical JPA test. Can be used when a test focuses <strong>only</strong> on JPA
* components.
* <p> * <p>
* Using this annotation will disable full auto-configuration and instead apply only * Using this annotation will disable full auto-configuration and instead apply only
* configuration relevant to JPA tests. * configuration relevant to JPA tests.
@ -58,6 +56,9 @@ import org.springframework.transaction.annotation.Transactional;
* database, you should consider {@link SpringBootTest @SpringBootTest} combined with * database, you should consider {@link SpringBootTest @SpringBootTest} combined with
* {@link AutoConfigureTestDatabase @AutoConfigureTestDatabase} rather than this * {@link AutoConfigureTestDatabase @AutoConfigureTestDatabase} rather than this
* annotation. * annotation.
* <p>
* When using JUnit 4, this annotation should be used in combination with
* {@code @RunWith(SpringRunner.class)}.
* *
* @author Phillip Webb * @author Phillip Webb
* @author Artsiom Yudovin * @author Artsiom Yudovin

@ -41,9 +41,8 @@ import org.springframework.test.web.client.MockRestServiceServer;
import org.springframework.web.client.RestTemplate; import org.springframework.web.client.RestTemplate;
/** /**
* Annotation that can be used in combination with {@code @RunWith(SpringRunner.class)} * Annotation for a Spring rest client test that focuses <strong>only</strong> on beans
* for a typical Spring rest client test. Can be used when a test focuses * that use {@link RestTemplateBuilder}.
* <strong>only</strong> on beans that use {@link RestTemplateBuilder}.
* <p> * <p>
* Using this annotation will disable full auto-configuration and instead apply only * 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 * configuration relevant to rest client tests (i.e. Jackson or GSON auto-configuration
@ -57,6 +56,9 @@ import org.springframework.web.client.RestTemplate;
* If you are testing a bean that doesn't use {@link RestTemplateBuilder} but instead * If you are testing a bean that doesn't use {@link RestTemplateBuilder} but instead
* injects a {@link RestTemplate} directly, you can add * injects a {@link RestTemplate} directly, you can add
* {@code @AutoConfigureWebClient(registerRestTemplate=true)}. * {@code @AutoConfigureWebClient(registerRestTemplate=true)}.
* <p>
* When using JUnit 4, this annotation should be used in combination with
* {@code @RunWith(SpringRunner.class)}.
* *
* @author Stephane Nicoll * @author Stephane Nicoll
* @author Phillip Webb * @author Phillip Webb

@ -42,8 +42,7 @@ import org.springframework.test.context.junit.jupiter.SpringExtension;
import org.springframework.test.web.reactive.server.WebTestClient; import org.springframework.test.web.reactive.server.WebTestClient;
/** /**
* Annotation that can be used in combination with {@code @RunWith(SpringRunner.class)} * Annotation that can be used for a Spring WebFlux test that focuses
* for a typical Spring WebFlux test. Can be used when a test focuses
* <strong>only</strong> on Spring WebFlux components. * <strong>only</strong> on Spring WebFlux components.
* <p> * <p>
* Using this annotation will disable full auto-configuration and instead apply only * Using this annotation will disable full auto-configuration and instead apply only
@ -64,6 +63,9 @@ import org.springframework.test.web.reactive.server.WebTestClient;
* you should consider {@link SpringBootTest @SpringBootTest} combined with * you should consider {@link SpringBootTest @SpringBootTest} combined with
* {@link AutoConfigureWebTestClient @AutoConfigureWebTestClient} rather than this * {@link AutoConfigureWebTestClient @AutoConfigureWebTestClient} rather than this
* annotation. * annotation.
* <p>
* When using JUnit 4, this annotation should be used in combination with
* {@code @RunWith(SpringRunner.class)}.
* *
* @author Stephane Nicoll * @author Stephane Nicoll
* @author Artsiom Yudovin * @author Artsiom Yudovin

@ -41,8 +41,7 @@ import org.springframework.test.context.junit.jupiter.SpringExtension;
import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.MockMvc;
/** /**
* Annotation that can be used in combination with {@code @RunWith(SpringRunner.class)} * Annotation that can be used for a Spring MVC test that focuses <strong>only</strong> on
* for a typical Spring MVC test. Can be used when a test focuses <strong>only</strong> on
* Spring MVC components. * Spring MVC components.
* <p> * <p>
* Using this annotation will disable full auto-configuration and instead apply only * Using this annotation will disable full auto-configuration and instead apply only
@ -64,6 +63,9 @@ import org.springframework.test.web.servlet.MockMvc;
* If you are looking to load your full application configuration and use MockMVC, you * If you are looking to load your full application configuration and use MockMVC, you
* should consider {@link SpringBootTest @SpringBootTest} combined with * should consider {@link SpringBootTest @SpringBootTest} combined with
* {@link AutoConfigureMockMvc @AutoConfigureMockMvc} rather than this annotation. * {@link AutoConfigureMockMvc @AutoConfigureMockMvc} rather than this annotation.
* <p>
* When using JUnit 4, this annotation should be used in combination with
* {@code @RunWith(SpringRunner.class)}.
* *
* @author Phillip Webb * @author Phillip Webb
* @author Artsiom Yudovin * @author Artsiom Yudovin

Loading…
Cancel
Save