Migrate Hamcrest assertions to AssertJ
Migrate all existing `assertThat(..., Matcher)` assertions to AssertJ and add checkstyle rules to ensure they don't return. See gh-23022
This commit is contained in:
@@ -64,6 +64,12 @@
|
||||
<suppress files="org[\\/]springframework[\\/]test[\\/]context[\\/]support[\\/]ContextLoaderUtilsContextHierarchyTests" checks="RegexpSinglelineJava" id="expectedExceptionAnnotation" />
|
||||
<suppress files="org[\\/]springframework[\\/]test[\\/]context[\\/]testng[\\/]transaction[\\/]programmatic/ProgrammaticTxMgmtTestNGTests" checks="RegexpSinglelineJava" id="expectedExceptionAnnotation" />
|
||||
<suppress files="org[\\/]springframework[\\/]test[\\/]context[\\/]transaction[\\/]programmatic[\\/]ProgrammaticTxMgmtTests" checks="RegexpSinglelineJava" id="expectedExceptionAnnotation" />
|
||||
<suppress files="JsonPathExpectationsHelper" checks="IllegalImport" id="bannedHamcrestImports" />
|
||||
<suppress files="XpathExpectationsHelper" checks="IllegalImport" id="bannedHamcrestImports" />
|
||||
<suppress files="DefaultWebTestClient" checks="IllegalImport" id="bannedHamcrestImports" />
|
||||
<suppress files="HeaderAssertions" checks="IllegalImport" id="bannedHamcrestImports" />
|
||||
<suppress files="StatusAssertions" checks="IllegalImport" id="bannedHamcrestImports" />
|
||||
<suppress files="JsonPathResultMatchers" checks="IllegalImport" id="bannedHamcrestImports" />
|
||||
|
||||
<!-- spring-web -->
|
||||
<suppress files="SpringHandlerInstantiator" checks="JavadocStyle" />
|
||||
|
||||
@@ -95,10 +95,17 @@
|
||||
<property name="sortStaticImportsAlphabetically" value="true" />
|
||||
</module>
|
||||
<module name="com.puppycrawl.tools.checkstyle.checks.imports.IllegalImportCheck">
|
||||
<property name="id" value="bannedImports"/>
|
||||
<property name="regexp" value="true" />
|
||||
<property name="illegalClasses"
|
||||
value="^reactor\.core\.support\.Assert,^junit\.framework\..+,^org\.junit\.Assert$,^org\.junit\.Assume$,^org\.junit\.Assert\.assertThat,^org\.junit\.Assume\.assumeThat,^org\.junit\.rules\.ExpectedException,^org\.slf4j\.LoggerFactory" />
|
||||
</module>
|
||||
<module name="com.puppycrawl.tools.checkstyle.checks.imports.IllegalImportCheck">
|
||||
<property name="id" value="bannedHamcrestImports"/>
|
||||
<property name="regexp" value="true" />
|
||||
<property name="illegalClasses"
|
||||
value="^org\.hamcrest\.MatcherAssert" />
|
||||
</module>
|
||||
|
||||
<!-- Javadoc Comments -->
|
||||
<module name="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocTypeCheck">
|
||||
|
||||
Reference in New Issue
Block a user