Commit Graph

267 Commits (10a5cef4ef33e7c86d18e1f92793c2aaa57d5a82)

Author SHA1 Message Date
Phillip Webb a3bfc29e6e Fix warnings 9 years ago
Phillip Webb ae1d352d34 Allow @Import to be used directly on test classes
Remove the need for a nested @Configuration class when writing a test
that need to @Import configuration.

Primarily added to allow @ImportAutoConfiguration to be used directly
on test classes.

Fixes gh-5473
9 years ago
Phillip Webb ab7b48de84 Provide TestRestTemplate for @WebIntegrationTests
Add a ContextCustomizerFactory to provide TestRestTemplate as a bean for
tests annotated with WebIntegrationTests. Additionally provide support
for automatically expanding URLs of the form `/example` to
`http://localhost:${local.server.port}/example`.

Fixes gh-5227
9 years ago
Phillip Webb cbea16ec01 Support HtmlUnit and Selenium localhost resolution
Provide variants of `WebClient` and `WebConnectionHtmlUnitDriver` that
automatically resolve relative URLs to "localhost:${local.server.port}".

Fixes gh-5472
9 years ago
Phillip Webb 24ab2bd891 Add utilities to help with JSON testing
Add Jackson, Gson and Basic String helper classes that allow AssertJ
assertions to be used to test JSON.

Fixes gh-5471
9 years ago
Phillip Webb 45c4f5f3f1 Add @MockBean support
Add a `@MockBean` annotation which can be used to setup and inject mocks
into an application context. The annotation can be used on test classes,
test fields, configuration classes or configuration fields. When used on
a field the annotation also acts as an injection point.

Fixes gh-5042
9 years ago
Phillip Webb 0829a1bde8 Drop superfluous annotations
Update internal tests to drop annotations that can now
be inferred.

Fixes gh-5470
9 years ago
Phillip Webb 7dffb702b5 Unify use of @BootStrapWith
Update @IntegrationTest to use @BootstrapWith rather than an explicitly
defined set of test execution listeners.

Also introduce a new @SpringApplicationTest annotation that is similar
to  @SpringApplicationConfiguration but a bootstrapper.

Fixes gh-5230
9 years ago
Phillip Webb 90950cfb1c Automatically find test configurations
Allow detection of `@SpringBootConfiguration` classes for both standard
spring tests and bootstrap (@IntegrationTest @WebIntegrationTest) based
tests.

Closes gh-5295
9 years ago
Phillip Webb 600a06af83 Auto-exclude test components from scanning
Add TestTypeExcludeFilter which will automatically attempt to exclude
test only configurations. All `@Configuration` annotated inner-classes
of tests are automatically excluded. The `@TestConfiguration` annotation
can be used to explicitly if a configuration needs explicit exclusion.

See gh-5295
See gh-4901
9 years ago
Phillip Webb 40c2e24a58 Fix SpringApplicationContextLoader customizers
Update SpringApplicationContextLoader to call ContextCustomizers in the
same way as other classes in `spring-test`.

Fixes gh-5294
9 years ago
Phillip Webb c28f552883 Migrate SpringJUnit4ClassRunner to SpringRunner
Replace all existing SpringJUnit4ClassRunner references with the new
SpringRunner alias.

Fixes gh-5292
9 years ago
Phillip Webb aef7f4bcb1 Restructure spring-boot-test packages
Create a new package structure for `spring-boot-test` and deprecate
existing classes.

Fixes gh-5293
9 years ago
Stephane Nicoll 2526a54e31 Polish contribution
Closes gh-5337
9 years ago
Anand Shah f6a32a1d5a Add `@LocalServerPort`
Closes gh-5262
9 years ago
Andy Wilkinson 44ddfcc7fa Upgrade copyright headers of all files changed in 2016 9 years ago
Phillip Webb 89b7704977 Extract spring-boot-test.jar
Relocate the `org.springframework.boot.test` package from the
`spring-boot.jar` to `spring-boot-test.jar`.

Fixes gh-5184
9 years ago