By default, `@DataJpaTest` (and `@AutoConfigureTestDatabase`) attempt to
replace any existing `DataSource` by an embedded one. Previously, if
there is was no embedded database on the classpath, the exception message
did not provide that context in the error message.
This commit clarifies the error message to conduct
`TestDatabaseAutoConfiguration` (that is replacing the existing
`DataSource`).
Closes gh-7797
Most of the config keys defined by the `spring-boot-test-autoconfigure`
module can't be overridden because they are mapped with `@PropertyMapping`
on an annotation. It is confusing that such keys are exposed in content
assistance as using them will have no effect.
This commit removes the annotation processor from the build so that the
`@ConfigurationProperties` beans aren't processed anymore. Instead, manual
metadata is written for the two only keys that are effectively used in
regular configuration.
As a result, the `additional-spring-configuration-metadata` file has been
renamed to `spring-configuration-metadata` since nothing is processing it
anymore.
Closes gh-7887
Update `@ImportAutoConfiguration` with support for an exclude attribute
that works in a similar way to `@EnableAutoConfiguration`.
Also update existing `@Test...` annotation with exclude attribute
aliases.
Fixes gh-6809
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