AssertJLongRules

SUGGESTION

Simplification

View source code on GitHub

Suppression

Disable all rules by adding -XepOpt:Refaster:NamePattern=^(?!AssertJLongRules\$).* as compiler argument.

Table of contents
  1. AbstractLongAssertIsEqualTo
  2. AbstractLongAssertIsNotEqualTo
  3. AbstractLongAssertIsEqualToZero
  4. AbstractLongAssertIsNotEqualToZero
  5. AbstractLongAssertIsEqualToOne

AbstractLongAssertIsEqualTo

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("AbstractLongAssertIsEqualTo") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!AssertJLongRules\$AbstractLongAssertIsEqualTo).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 ImmutableSet<AbstractLongAssert<?>> testAbstractLongAssertIsEqualTo() {
-  return ImmutableSet.of(
-      assertThat(0L).isCloseTo(1, offset(0L)), assertThat(0L).isCloseTo(2, withPercentage(0)));
+  return ImmutableSet.of(assertThat(0L).isEqualTo(1), assertThat(0L).isEqualTo(2));
 }

AbstractLongAssertIsNotEqualTo

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("AbstractLongAssertIsNotEqualTo") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!AssertJLongRules\$AbstractLongAssertIsNotEqualTo).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 ImmutableSet<AbstractLongAssert<?>> testAbstractLongAssertIsNotEqualTo() {
-  return ImmutableSet.of(
-      assertThat(0L).isNotCloseTo(1, offset(0L)),
-      assertThat(0L).isNotCloseTo(2, withPercentage(0)));
+  return ImmutableSet.of(assertThat(0L).isNotEqualTo(1), assertThat(0L).isNotEqualTo(2));
 }

AbstractLongAssertIsEqualToZero

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("AbstractLongAssertIsEqualToZero") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!AssertJLongRules\$AbstractLongAssertIsEqualToZero).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 AbstractLongAssert<?> testAbstractLongAssertIsEqualToZero() {
-  return assertThat(0L).isZero();
+  return assertThat(0L).isEqualTo(0);
 }

AbstractLongAssertIsNotEqualToZero

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("AbstractLongAssertIsNotEqualToZero") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!AssertJLongRules\$AbstractLongAssertIsNotEqualToZero).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 AbstractLongAssert<?> testAbstractLongAssertIsNotEqualToZero() {
-  return assertThat(0L).isNotZero();
+  return assertThat(0L).isNotEqualTo(0);
 }

AbstractLongAssertIsEqualToOne

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("AbstractLongAssertIsEqualToOne") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!AssertJLongRules\$AbstractLongAssertIsEqualToOne).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 AbstractLongAssert<?> testAbstractLongAssertIsEqualToOne() {
-  return assertThat(0L).isOne();
+  return assertThat(0L).isEqualTo(1);
 }

Copyright © 2017-2026 Picnic Technologies BV