-
Notifications
You must be signed in to change notification settings - Fork 89
Open
PicnicSupermarket/error-prone-support
#1872Labels
Description
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
Are you interested in contributing this recipe to OpenRewrite?
Not ATM.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
In Progress