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
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
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
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
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
Provide variants of `WebClient` and `WebConnectionHtmlUnitDriver` that
automatically resolve relative URLs to "localhost:${local.server.port}".
Fixes gh-5472
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