SpringTestRules

SUGGESTION

Simplification

View source code on GitHub

Suppression

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

Table of contents
  1. BodyContentSpecJsonJsonCompareModeLenient
  2. BodyContentSpecJsonJsonCompareModeStrict

BodyContentSpecJsonJsonCompareModeLenient

SUGGESTION

Simplification

Suppression

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

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

Samples

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

 @SuppressWarnings("deprecation" /* Rule rewrites deprecated method invocation. */)
 ImmutableSet<BodyContentSpec> testBodyContentSpecJsonJsonCompareModeLenient() {
   return ImmutableSet.of(
-      ((BodyContentSpec) null).json("foo"), ((BodyContentSpec) null).json("bar", false));
+      ((BodyContentSpec) null).json("foo", JsonCompareMode.LENIENT),
+      ((BodyContentSpec) null).json("bar", JsonCompareMode.LENIENT));
 }

BodyContentSpecJsonJsonCompareModeStrict

SUGGESTION

Simplification

Suppression

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

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

Samples

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

 @SuppressWarnings("deprecation" /* Rule rewrites deprecated method invocation. */)
 BodyContentSpec testBodyContentSpecJsonJsonCompareModeStrict() {
-  return ((BodyContentSpec) null).json("foo", true);
+  return ((BodyContentSpec) null).json("foo", JsonCompareMode.STRICT);
 }

Copyright © 2017-2026 Picnic Technologies BV