Closed yeikel closed 2 years ago
Good idea!
Good idea!
Thank you for the quick turnaround!
In open source code we have already, found a few occurrences of this. https://app.moderne.io/recipes/org.openrewrite.java.testing.cleanup.AssertEqualsNullToAssertNull
In open source code we have already, found a few occurrences of this. https://app.moderne.io/recipes/org.openrewrite.java.testing.cleanup.AssertEqualsNullToAssertNull
That's awesome. Thank you for sharing about it
I have seen this within my projects as well and I am looking forward to test it
@jkschneider I forgot to mention it with the original issue, but the same applies to assertNotNull
. I can create a separate issue if you prefer that
@Test
void myTest(){
String a = null;
assertNotEquals(a, null);
}
@Test
void myTest(){
String a = null;
assertNotNull(a);
}
This could be a good transformation to add :
assertEquals(a, null)
Could be replaced with
assertNull(a)
Example :