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
* 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
*/

@ -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 <em>not</em> marking the test
* class <code>@WebAppConfiguration</code>.
* 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 <em>not</em> marking
* 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>
* If <code>@ActiveProfiles</code> are provided in the test class they will be used to
* create the application context.

Loading…
Cancel
Save