Commit Graph

45 Commits (742153fc22a4798674cc5b821656a57165dac13c)

Author SHA1 Message Date
Brian Clozel f2e77e46cd Auto-configure codecs in WebTestClient
This commit applies what's been done in gh-9166 for WebFlux client and
server, but for the `WebTestClient` auto-configuration.

`WebTestClient` can be configured for mock or integration tests and this
change applies `CodecCustomizer` beans to the client being built.

Closes gh-9577
7 years ago
Phillip Webb b94bb00fa1 Remove need for attached test-jar artifacts
Remove test-jar artifacts from Maven projects and relocate classes. The
majority of utilities now live in the `spring-boot-testsupport` module.

This update will help us to deploy artifacts using the standard Maven
deploy plugin in the future (which doesn't support the filtering of
individual artifacts).

Fixes gh-9493
8 years ago
Andy Wilkinson 61a1798296 Merge branch '1.5.x' 8 years ago
Andy Wilkinson 21a5ab7875 Log a warning during tests when multiple JSONOjects on the class path
Closes gh-9248
8 years ago
Spring Buildmaster 9768b0a8c2 Next Development Version 8 years ago
Spring Buildmaster d23fa24340 Next Development Version 8 years ago
Stephane Nicoll 12397edbd4 Expose a WebTestClient with `@SpringBootTest`
This commit exposes a `WebTestClient` automatically in a reactive
integration test that uses an embedded web server. This is similar to
what we do with `TestRestTemplate` for servlet based integration tests.

Closes gh-8399
8 years ago
Stephane Nicoll 54939e8e3c Start a reactive web application if necessary
This commit makes sure that `@SpringBootTest` with a reactive setup
starts a web application if necessary.

If both a servlet and a reactive environment are available, a servlet
environment is bootstraped. This commit also adds a way to force a
reactive environment by specifying the `spring.main.web-application-type`
property of the test (e.g. `@TestPropertySource`).

Closes gh-8383
8 years ago
Spring Buildmaster 5c12500366 Next Development Version 8 years ago
Spring Buildmaster a2696bf873 Next Development Version 8 years ago
Stephane Nicoll fab43f343d Merge branch '1.5.x' 8 years ago
Stephane Nicoll 6293033e1b Remove useless dependency 8 years ago
Stephane Nicoll 816c236e5b Merge branch '1.5.x' 8 years ago
Stephane Nicoll ee72e788ed Rename `spring-boot-junit-runners` to `spring-boot-test-support`
Closes gh-7421
8 years ago
Andy Wilkinson 304fff1bee Merge branch '1.5.x' 8 years ago
Andy Wilkinson 3ac22e7cdf Merge branch '1.4.x' into 1.5.x 8 years ago
Andy Wilkinson d9b8fc960c Correct the scope of the spock-core dependency in spring-boot-test
See gh-7524
8 years ago
Andy Wilkinson 881eaab601 Merge branch '1.5.x' 8 years ago
Andy Wilkinson 1d476b375f Merge branch '1.4.x' into 1.5.x 8 years ago
Andy Wilkinson 45d672f5b3 Ignore Spock annotations when creating test context cache key
Closes gh-7524
8 years ago
Phillip Webb 20d7dd5747 Merge branch '1.5.x' 8 years ago
Phillip Webb 1657120286 Move ModifiedClassPathRunner to its own module
Migrate `ModifiedClassPathRunner` from `spring-boot` test source to
its own module.

Fixes gh-7420
8 years ago
Andy Wilkinson 9273b1789b Merge branch '1.5.x' 8 years ago
Andy Wilkinson 1cd781b242 Make spring-boot-test compatible with Mockito 2.1 and 2.2
We use some internal Mockito classes and some  breaking API changes
have been made to them in Mockito 2. This commit introduces a utility
class, SpringBootMockUtil, to shield our code from these differences.
Mockito 1 is called directly and Mockito 2 is called via reflection.

To allow these changes to be tested, FilteredClassPathRunner has been
enhanced to also support overriding a dependency on the class path.
As a result it has been renamed to ModifiedClassPathRunner. The new
ClassPathOverrides annotation can be used to provide the Maven
coordinates of one or more dependencies that should be resolved and
added to the class path. Such additions are added to the start of
the class path so that they override any existing dependency that
contains the same classes.

Closes gh-6520
8 years ago
Spring Buildmaster e712a9ba8c Next Development Version 8 years ago
Andy Wilkinson 86034e5c5c Merge branch '1.5.x' 8 years ago
Andy Wilkinson 3ea09d2e04 Merge branch '1.4.x' into 1.5.x 8 years ago
Andy Wilkinson 02e89acd1e Add managed version for kotlin-runtime to spring-boot-parent
See gh-7101
8 years ago
Andy Wilkinson b1026db330 Merge branch '1.5.x' 8 years ago
Andy Wilkinson f942fe4947 Merge branch '1.4.x' into 1.5.x 8 years ago
Andy Wilkinson 64d32191cf Ignore Kotlin annotations when creating test context cache key
Every classes that's compiled by Kotlin is annotated with
kotlin.Metadata. The attributes of this annotation always differ so
if they are used in the cache key, context caching will effectively
be disabled.

This commit updates the key used by ImportsContextCustomizer to
ignore the kotlin.Metadata annotation. Additionally, to align with
with Java where annotations in java.lang.annotation are ignored,
annotations in kotlin.annotation are also ignored.

Closes gh-7101
8 years ago
Stephane Nicoll 6643ec3713 Next development version 8 years ago
Stephane Nicoll 6bd670edbc Initiate 1.4.x branch 8 years ago
Spring Buildmaster 7e9ed5e1a7 Next Development Version 8 years ago
Phillip Webb ebb08c3655 Generate property meta-data for test projects
Add annotation processor to `spring-boot-test` and
`spring-boot-test-autoconfigure`.

Fixes gh-6893
8 years ago
Spring Buildmaster 334baaeffd Next development version 8 years ago
Phillip Webb 05ff4ed4e0 Upgrade to Tomcat 8.5.4 & remove tomcat-juli
Upgrade the managed Tomcat dependency to 8.5.4 and remove `tomcat-juli`
since it's now included in `tomcat-embed-core`.

Fixes gh-6192
8 years ago
Andy Wilkinson f28e3d54c5 Upgrade to Tomcat 8.5.3
This commit changes the default version of Tomcat to 8.5.3 while
also retaining support for Tomcat 8.0 and 7.0. The main difference
in 8.5 is that the ServerSocketFactory abstraction that allowed the
TrustStore and KeyStore to be configured programatically no longer
exists. This logic has been replaced with the use of a custom URL
protocol (springbootssl) that provides access to the key store and
trust store of an SslStoreProvider. In addition to working with 8.5,
this approach has the advantage of also working with 8.0 and 7.0.

Closes gh-6164
9 years ago
Johnny Lim 06143195d0 Make json-path and selenium-api optional
Make json-path and selenium-api optional in spring-boot-test and
spring-boot-test-autoconfigure.

Fixes gh-5828
9 years ago
Andy Wilkinson 35270e939f Update dependency management for Selenium and its HTMLUnit Driver
Closes gh-5705
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 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
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