Checking for the presence of a `ValidationProvider` resource is
unfortunately not enough to trigger the validation auto-configuration.
If `hibernate-validator` is added on the classpath without a `javax.el`
implementation, the former will blow up on startup. So far this was a
pilot error so we didn't have to care about it. Now that we have an
auto-configuration that may lead to this error, we need to be extra
careful and check that scenario ourselves.
This commit adds an extra condition that runs as late as possible and
attempt to actually initialize a `Validator`. If that fails for whatever
reason, the auto-configuration will now back off.
Several additional tests have been added to exercise this scenario.
Closes gh-6228
Previously, ResetMocksTestExecutionListener used getBean(name) to
retrieve each instantiated singleton. When the instantiated singleton
was a factory bean, this would cause getObject on the factory bean to
be called. If the factory bean was unable to produce its object, for
example due to test slicing excluding something, an exception would
be thrown.
The previous commit updated ResetMocksTestsExecutionListener to
use getSingleton(name) rather than getBean(name). This will retrieve
the factory bean itself rather than causing the factory bean to
attempt to create an object. This commit updates the tests to verify
the new behaviour.
Closes gh-7270
Previously, spring.profiles.active and spring.profiles.include were
looked up manually. This meant that configuration that used indexes
(for example spring.profiles.active[0]=dev) were not bound. As a
result, YAML lists did not work.
This commit updates ConfigFileApplicationListener to use a
RelaxedDataBinder to retrieve the values of spring.profiles.active
and spring.profiles.include, thereby reusing the data binding logic
that supports property names with indexes.
See gh-6995
This commit makes sure that the `skip` command-line property can be used
for all goals of the maven plugin.
A dedicated sample for integration tests has also been added as this
change may confuse users, especially those who wish to skip a certain
goal and not the plugin execution altogether.
Closes gh-7313
This commit deprecates `server.max-http-post-size` and introduces a
dedicated property for each supported container. In particular, Undertow
can now define a max size higher than 2GB.
Closes gh-7362
This commit auto-configures `MethodValidationPostProcessor` if necessary
when a JSR-303 validator implementation is detected on the classpath.
Closes gh-6228
If `OnBeanCondition` is used with a `String` literal representing the
fully qualified name of a bean and such type does not exist, it
gracefully manages it as if it was not found. Prior to this commit, an
exception would be thrown if any related class such as the parent
class does not exist.
This commit handles this additional case, catching `NoClassDefFoundError`
the same way it did handle `ClassNotFoundException`. That way, a
missing type will now be considered as absent if it's not on the
classpath.
Closes gh-7459
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 commit reverts 7e2d0fd so that the Couchbase auto-configuration can
work without Spring Data again. It also removes the `Class` reference to
a Spring Data class to a `String` reference to make sure the condition
operates properly when said class isn't on the classpath.
Closes gh-7453
Consider the following two URLs:
jar:file:/test.jar!/BOOT-INF/classes!/foo.txt
jar:file:/test.jar!/BOOT-INF/classes/foo.txt
They both reference the same foo.txt file in the BOOT-INF/classes
directory of test.jar, however the first URL does so via the
nested BOOT-INF/classes archive. Previously, this difference in the
URLs would lead to PathMatchingResourcePatternResolver returning two
resources for foo.txt when asked to find all resources matching the
pattern classpath*:/**/*.txt.
This commit updates our Handler that is used for jar: URLs to consider
the two URLs above to be equivalent such that url1 is equal to url2
and the two urls will produce the same hash code.
Closes gh-7449