Add javaodcs about @IntegrationTest to SpringApplicationContextLoader

See gh-499
pull/508/head
Dave Syer 11 years ago
parent b8c472007a
commit 0f8d00b3a8

@ -30,7 +30,7 @@ import org.springframework.test.context.transaction.TransactionalTestExecutionLi
/** /**
* Test class annotation signifying that the tests are integration tests (and therefore * 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 * @author Dave Syer
*/ */

@ -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 * 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, * normally startup using {@link SpringApplication}). Normally never starts an embedded
* but detects the {@link WebAppConfiguration @WebAppConfiguration} annotation on the test * web server, but detects the {@link WebAppConfiguration @WebAppConfiguration} annotation
* class and only creates a web application context if it is present. Non-web features, * on the test class and only creates a web application context if it is present. Non-web
* like a repository layer, can be tested cleanly by simply <em>not</em> marking the test * features, like a repository layer, can be tested cleanly by simply <em>not</em> marking
* class <code>@WebAppConfiguration</code>. * the test class <code>@WebAppConfiguration</code>.
* <p>
* If you <em>want</em> to start a web server, mark the test class as
* <code>@WebAppConfiguration @IntegrationTest</code>. This is useful for testing HTTP
* endpoints using {@link RestTemplates} (for instance), especially since you can
* <code>@Autowired</code> application context components into your test case to see the
* internal effects of HTTP requests directly.
* <p> * <p>
* If <code>@ActiveProfiles</code> are provided in the test class they will be used to * If <code>@ActiveProfiles</code> are provided in the test class they will be used to
* create the application context. * create the application context.

Loading…
Cancel
Save