Migrate TestNG assertions to AssertJ
MSALConvert assertions from org.testng.Assert to org.assertj.core.api.Assertions.
org. openrewrite. java. testing. testng. TestNgToAssertjmod run . --recipe= org. openrewrite. java. testing. testng. TestNgToAssertjInstall it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.
Recipe list
It runs these recipes, in this order.
- Add Gradle or Maven dependency
org.assertj:assertj-core:3.x - Refaster rules that replace TestNG APIs with AssertJ equivalents
- TestNG
assertEqualsto AssertJ - TestNG
assertNotEqualsto AssertJ - TestNG
assertEqualsNoOrderto AssertJ - TestNG
assertEqualsDeep/assertNotEqualsDeepto AssertJ - TestNG
assertSameto AssertJ - TestNG
assertNotSameto AssertJ - TestNG
assertThrows/expectThrowsto AssertJ - TestNG
assertList*to AssertJ - TestNG
Assertionto AssertJ - TestNG
SoftAssertto AssertJSoftAssertions - Change type
SoftAsserttoSoftAssertions - Use static import
org.assertj.core.api.Assertions *(..)