Previously, two or more `@DataJpaTest` tests in the same test suite were
sharing the same in-memory database instance. This commit makes sure
that `TestDatabaseAutoConfiguration` creates a unique embedded database
for each test it operates on.
Closes gh-7473
This commits makes sure that customizations on `DispatcherServlet` are
also applied to the `TestDispatcherServlet` that `MockMvc` is using
internally.
Closes gh-5891
Update `@AutoConfigureMockMvc` with a `printOnlyOnFailure` option which
allows errors to be printed only when tests fail. Defaults to `true`
meaning the logs are no longer cluttered with MVC results for passing
tests.
Fixes gh-6653
Update WebDriver support to ensure that the `.quit()` method is called
after each test method runs and that a new WebDriver instance is
injected each time.
Support is provided by introducing a new `Scope` which is applied by
a ContextCustomizerFactory and reset by a TestExecutionListener.
Fixes gh-6641
Update `@AutoConfigureTestDatabase` so that it always imports
`DataSourceAutoConfiguration`. Prior to this commit the annotation
could only be applied if something else also imported DataSource
auto-configuration.
Fixes gh-6897
Rename AutoConfigureReportTestExecutionListener to
SpringBootDependencyInjectionTestExecutionListener and ensure that it
replaces any existing DependencyInjectionTestExecutionListener.
Prior to this commit the registration of two DependencyInjection
listeners would cause @PostConstruct methods on tests to be called
twice.
In order to allow the standard DependencyInjectionTestExecutionListener
to be removed a new DefaultTestExecutionListenersPostProcessor interface
has been introduced.
Fixes gh-6874
Update RootUriRequestExpectationManager to only wrap requests when
they cannot be cast to MockClientHttpRequest. This prevents later
ClassCastExceptions from being thrown with @RestClientTests that
define expected body content.
Fixes gh-6845
This commit adds `JdbcTemplateAutoConfiguration` to the list of auto-
configurations that are applied with `DataJpaTest`. This effectively
allows to inject a `JdbcTemplate` in any `@DataJpaTest` test.
Closes gh-6802
This commit fixes the prefix for the WebClient and WebDriver auto-config
so that it complies with the prefix set on `AutoconfigureWebMvc`
Closes gh-6727
Update JsonTestersAutoConfiguration so that GSON and Jackson specific
configuration are inner classes. This should prevent ClassNotFound
exception when the libraries are not on the classpath.
Fixes gh-6502
This commit fixes the `@ConditionalOnClass` typo on the GsonTester
FactoryBean, which was testing for `ObjectMapper` instead of `Gson`.
This means that the next condition `@ConditionalOnBean(Gson.class)`
throws a `ClassNotFoundException: com.google.gson.Gson` since it's
trying to load that class to check for an existing Bean of that type.
Fixes gh-6502