diff --git a/spring-boot/src/main/java/org/springframework/boot/test/IntegrationTest.java b/spring-boot/src/main/java/org/springframework/boot/test/IntegrationTest.java index 7b2b1bd7e0c..9eeea3c552f 100644 --- a/spring-boot/src/main/java/org/springframework/boot/test/IntegrationTest.java +++ b/spring-boot/src/main/java/org/springframework/boot/test/IntegrationTest.java @@ -30,7 +30,7 @@ import org.springframework.test.context.transaction.TransactionalTestExecutionLi /** * Test class annotation signifying that the tests are integration tests (and therefore - * require an application to startup "fully leaded" and listening on their normal ports). + * require an application to startup "fully leaded" and listening on its normal ports). * * @author Dave Syer */ diff --git a/spring-boot/src/main/java/org/springframework/boot/test/SpringApplicationContextLoader.java b/spring-boot/src/main/java/org/springframework/boot/test/SpringApplicationContextLoader.java index 477750b158b..28ec1a1fbe2 100644 --- a/spring-boot/src/main/java/org/springframework/boot/test/SpringApplicationContextLoader.java +++ b/spring-boot/src/main/java/org/springframework/boot/test/SpringApplicationContextLoader.java @@ -44,11 +44,17 @@ import org.springframework.web.context.support.GenericWebApplicationContext; /** * A {@link ContextLoader} that can be used to test Spring Boot applications (those that - * normally startup using {@link SpringApplication}). Never starts an embedded web server, - * but detects the {@link WebAppConfiguration @WebAppConfiguration} annotation on the test - * class and only creates a web application context if it is present. Non-web features, - * like a repository layer, can be tested cleanly by simply not marking the test - * class @WebAppConfiguration. + * normally startup using {@link SpringApplication}). Normally never starts an embedded + * web server, but detects the {@link WebAppConfiguration @WebAppConfiguration} annotation + * on the test class and only creates a web application context if it is present. Non-web + * features, like a repository layer, can be tested cleanly by simply not marking + * the test class @WebAppConfiguration. + *

+ * If you want to start a web server, mark the test class as + * @WebAppConfiguration @IntegrationTest. This is useful for testing HTTP + * endpoints using {@link RestTemplates} (for instance), especially since you can + * @Autowired application context components into your test case to see the + * internal effects of HTTP requests directly. *

* If @ActiveProfiles are provided in the test class they will be used to * create the application context.