AssertJCharSequenceRules
SUGGESTION
Simplification
Suppression
Disable all rules by adding
-XepOpt:Refaster:NamePattern=^(?!AssertJCharSequenceRules\$).*
as compiler argument.
Table of contents
AssertThatCharSequenceIsEmpty
SUGGESTION
Simplification
Suppression
Suppress false positives by adding the suppression annotation
@SuppressWarnings("AssertThatCharSequenceIsEmpty")
to the enclosing element.Disable this rule by adding
-XepOpt:Refaster:NamePattern=^(?!AssertJCharSequenceRules\$AssertThatCharSequenceIsEmpty).*
as compiler argument.
Samples
Shows the difference in example code before and after the Refaster rule is applied.
void testAssertThatCharSequenceIsEmpty() {
- assertThat("foo".isEmpty()).isTrue();
- assertThat("bar".length()).isEqualTo(0L);
- assertThat("baz".length()).isNotPositive();
+ assertThat("foo").isEmpty();
+ assertThat("bar").isEmpty();
+ assertThat("baz").isEmpty();
}
AssertThatCharSequenceIsNotEmpty
SUGGESTION
Simplification
Suppression
Suppress false positives by adding the suppression annotation
@SuppressWarnings("AssertThatCharSequenceIsNotEmpty")
to the enclosing element.Disable this rule by adding
-XepOpt:Refaster:NamePattern=^(?!AssertJCharSequenceRules\$AssertThatCharSequenceIsNotEmpty).*
as compiler argument.
Samples
Shows the difference in example code before and after the Refaster rule is applied.
ImmutableSet<AbstractAssert<?, ?>> testAssertThatCharSequenceIsNotEmpty() {
return ImmutableSet.of(
- assertThat("foo".isEmpty()).isFalse(),
- assertThat("bar".length()).isNotEqualTo(0),
- assertThat("baz".length()).isPositive());
+ assertThat("foo").isNotEmpty(),
+ assertThat("bar").isNotEmpty(),
+ assertThat("baz").isNotEmpty());
}
AssertThatCharSequenceHasSize
SUGGESTION
Simplification
Suppression
Suppress false positives by adding the suppression annotation
@SuppressWarnings("AssertThatCharSequenceHasSize")
to the enclosing element.Disable this rule by adding
-XepOpt:Refaster:NamePattern=^(?!AssertJCharSequenceRules\$AssertThatCharSequenceHasSize).*
as compiler argument.
Samples
Shows the difference in example code before and after the Refaster rule is applied.
AbstractAssert<?, ?> testAssertThatCharSequenceHasSize() {
- return assertThat("foo".length()).isEqualTo(3);
+ return assertThat("foo").hasSize(3);
}