Prior to this commit, HeaderResultMatchers had a direct dependency on
org.junit.Assert which forces JUnit 4 to be present on the classpath.
This commit fixes this by introducing assertNotNull() in
org.springframework.test.util.AssertionErrors and delegating to that
instead.
Fixes gh-22932
Organize test imports to expand all '.*' static imports into
fully qualified imports.
This update will allow us to use additional checkstyle rules in
the future, and will also help if we migrate fully to AssertJ.
DefaultCacheAwareContextLoaderDelegate now logs the identity hash code
for an application context instance that was stored in or retrieved from
the context cache in the Spring TestContext Framework.
Closes gh-22925
* Add limited checkstyles to test code
Add a limited set of checkstyle rules to the test codebase to improve
code consistency.
* Fix checksyle violations in test code
* Organize imports to fix checkstyle for test code
* Migrate to assertThatExceptionOfType
Migrate aware from ExpectedException rules to AssertJ exception
assertions. Also include a checkstyle rules to ensure that the
the ExpectedException is not accidentally used in the future.
See gh-22894
Prior to this commit, dependency injection of all arguments in a test
class constructor invoked by JUnit Jupiter was only possible if the
constructor was explicitly annotated with @Autowired.
This commit introduces support for a configurable "test constructor
autowire" mode which defaults to false in order to remain backwards
compatible.
Specifically, this mode can be configured globally for an entire test
suite via a new "spring.test.constructor.autowire" JVM system property
that can alternatively be configured via the SpringProperties
mechanism. In addition, the global "test constructor autowire" mode can
be overridden locally on a per-class basis via the new @TestConstructor
annotation.
Closes gh-22286