Migrate TestNG assertions to AssertJ
Migrate all existing TestNG based assertions to AssertJ and add Checkstyle rules to ensure they don't return. See gh-23022
This commit is contained in:
@@ -98,7 +98,7 @@
|
||||
<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\.jupiter\.api\.Assertions$,^org\.junit\.Assert\.assertThat,^org\.junit\.Assume\.assumeThat,^org\.junit\.rules\.ExpectedException,^org\.slf4j\.LoggerFactory" />
|
||||
value="^reactor\.core\.support\.Assert,^junit\.framework\..+,^org\.junit\.Assert$,^org\.junit\.Assume$,^org\.junit\.jupiter\.api\.Assertions$,^org\.junit\.Assert\.assertThat,^org\.junit\.Assume\.assumeThat,^org\.testng\.Assert$,^org\.testng\.AssertJUnit$,^org\.junit\.rules\.ExpectedException,^org\.slf4j\.LoggerFactory" />
|
||||
</module>
|
||||
<module name="com.puppycrawl.tools.checkstyle.checks.imports.IllegalImportCheck">
|
||||
<property name="id" value="bannedHamcrestImports"/>
|
||||
@@ -194,6 +194,14 @@
|
||||
<property name="message" value="Please use AssertJ assertions." />
|
||||
<property name="ignoreComments" value="true" />
|
||||
</module>
|
||||
<module name="com.puppycrawl.tools.checkstyle.checks.regexp.RegexpSinglelineJavaCheck">
|
||||
<property name="id" value="testNGAssertions"/>
|
||||
<property name="maximum" value="0"/>
|
||||
<!-- should cover org.testng.Assert and org.testng.AssertJUnit -->
|
||||
<property name="format" value="org\.testng\.Assert(JUnit)?\.assert" />
|
||||
<property name="message" value="Please use AssertJ assertions." />
|
||||
<property name="ignoreComments" value="true" />
|
||||
</module>
|
||||
|
||||
<!-- Spring Conventions -->
|
||||
<module name="io.spring.javaformat.checkstyle.check.SpringLambdaCheck">
|
||||
|
||||
Reference in New Issue
Block a user