What problem are you trying to solve?
Resolve Sonar issues of type "Chained AssertJ assertions should be simplified to the corresponding dedicated assertion java:S5838"
What precondition(s) should be checked before applying this recipe?
AssertJ must be present
Describe the situation before applying the recipe
class A {
void foo(List bar) {
assertThat(bar.size()).isEqualTo(5);
}
void foo2(List bar) {
assertThat(bar.size()).isEqualTo(0);
}
}
Describe the situation after applying the recipe
class A {
void foo(List bar) {
assertThat(bar).hasSize(5);
}
void foo2(List bar) {
assertThat(bar).isEmpty();
}
}
Have you considered any alternatives or workarounds?
IntelliJ IDEA is able to refactor these occurrences.
Any additional context
Not ATM.
What problem are you trying to solve?
Resolve Sonar issues of type "Chained AssertJ assertions should be simplified to the corresponding dedicated assertion java:S5838"
What precondition(s) should be checked before applying this recipe?
AssertJ must be present
Describe the situation before applying the recipe
Describe the situation after applying the recipe
Have you considered any alternatives or workarounds?
IntelliJ IDEA is able to refactor these occurrences.
Any additional context
Are you interested in contributing this recipe to OpenRewrite?
Not ATM.