From 5048c898ecd5398f14f600200298eb6196886d08 Mon Sep 17 00:00:00 2001 From: chrisly42 Date: Tue, 30 Jul 2019 19:39:16 +0200 Subject: [PATCH] Fixed broken code in test classes (missing imports, undefined variables). --- .../inspections/BinaryExpression/BinaryExpressionAfter.java | 3 ++- .../inspections/BinaryExpression/BinaryExpressionBefore.java | 3 ++- .../inspections/BooleanCondition/BooleanConditionAfter.java | 3 ++- .../inspections/BooleanCondition/BooleanConditionBefore.java | 3 ++- .../CollectionMapExpression/CollectionMapExpressionAfter.java | 3 ++- .../CollectionMapExpression/CollectionMapExpressionBefore.java | 3 ++- .../inspections/EnumerableIsEmpty/EnumerableIsEmptyAfter.java | 3 ++- .../inspections/EnumerableIsEmpty/EnumerableIsEmptyBefore.java | 3 ++- .../inspections/GuavaOptional/GuavaOptionalAfter.java | 3 ++- .../inspections/GuavaOptional/GuavaOptionalBefore.java | 3 ++- .../inspections/ImplicitAssertion/ImplicitAssertionAfter.java | 3 ++- .../inspections/ImplicitAssertion/ImplicitAssertionBefore.java | 3 ++- src/test/resources/inspections/InstanceOf/InstanceOfAfter.java | 3 ++- .../resources/inspections/InstanceOf/InstanceOfBefore.java | 3 ++- .../InvertedBooleanConditionAfter.java | 3 ++- .../InvertedBooleanConditionBefore.java | 3 ++- .../inspections/Java8Optional/Java8OptionalAfter.java | 3 ++- .../inspections/Java8Optional/Java8OptionalBefore.java | 3 ++- .../inspections/JoinStatements/JoinStatementsAfter.java | 2 +- .../inspections/JoinStatements/JoinStatementsBefore.java | 2 +- .../inspections/ObjectExpression/ObjectExpressionAfter.java | 1 + .../inspections/ObjectExpression/ObjectExpressionBefore.java | 1 + .../ObjectIsNullOrNotNull/ObjectIsNullOrNotNullAfter.java | 3 ++- .../ObjectIsNullOrNotNull/ObjectIsNullOrNotNullBefore.java | 3 ++- src/test/resources/inspections/Size/SizeAfter.java | 3 ++- src/test/resources/inspections/Size/SizeBefore.java | 3 ++- .../inspections/StringExpression/StringExpressionAfter.java | 3 ++- .../inspections/StringExpression/StringExpressionBefore.java | 3 ++- .../inspections/StringIsEmpty/StringIsEmptyAfter.java | 3 ++- .../inspections/StringIsEmpty/StringIsEmptyBefore.java | 3 ++- 30 files changed, 56 insertions(+), 28 deletions(-) diff --git a/src/test/resources/inspections/BinaryExpression/BinaryExpressionAfter.java b/src/test/resources/inspections/BinaryExpression/BinaryExpressionAfter.java index dffb361..2f4fb36 100644 --- a/src/test/resources/inspections/BinaryExpression/BinaryExpressionAfter.java +++ b/src/test/resources/inspections/BinaryExpression/BinaryExpressionAfter.java @@ -1,4 +1,5 @@ import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.fail; public class BinaryExpression { @@ -196,7 +197,7 @@ public class BinaryExpression { assertThat(numberObjAct.equals(numberObjExp)).as("doh!").isTrue().isEqualTo(true); - org.junit.Assert.assertThat(foo, null); + org.junit.Assert.assertThat(stringAct, null); fail("oh no!"); } } diff --git a/src/test/resources/inspections/BinaryExpression/BinaryExpressionBefore.java b/src/test/resources/inspections/BinaryExpression/BinaryExpressionBefore.java index 9ff13dd..76440f0 100644 --- a/src/test/resources/inspections/BinaryExpression/BinaryExpressionBefore.java +++ b/src/test/resources/inspections/BinaryExpression/BinaryExpressionBefore.java @@ -1,4 +1,5 @@ import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.fail; public class BinaryExpression { @@ -196,7 +197,7 @@ public class BinaryExpression { assertThat(numberObjAct.equals(numberObjExp)).as("doh!").isTrue().isEqualTo(true); - org.junit.Assert.assertThat(foo, null); + org.junit.Assert.assertThat(stringAct, null); fail("oh no!"); } } diff --git a/src/test/resources/inspections/BooleanCondition/BooleanConditionAfter.java b/src/test/resources/inspections/BooleanCondition/BooleanConditionAfter.java index 5cef929..05fa452 100644 --- a/src/test/resources/inspections/BooleanCondition/BooleanConditionAfter.java +++ b/src/test/resources/inspections/BooleanCondition/BooleanConditionAfter.java @@ -1,4 +1,5 @@ import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.fail; public class BooleanCondition { @@ -32,7 +33,7 @@ public class BooleanCondition { assertThat(primitive).isTrue().as("foo").isTrue().as("bar").isTrue().isFalse(); assertThat(object).isEqualTo(Boolean.TYPE); - org.junit.Assert.assertThat(foo, null); + org.junit.Assert.assertThat(object, null); fail("oh no!"); } } diff --git a/src/test/resources/inspections/BooleanCondition/BooleanConditionBefore.java b/src/test/resources/inspections/BooleanCondition/BooleanConditionBefore.java index f75ba6a..a7beee0 100644 --- a/src/test/resources/inspections/BooleanCondition/BooleanConditionBefore.java +++ b/src/test/resources/inspections/BooleanCondition/BooleanConditionBefore.java @@ -1,4 +1,5 @@ import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.fail; public class BooleanCondition { @@ -32,7 +33,7 @@ public class BooleanCondition { assertThat(primitive).isEqualTo(Boolean.TRUE).as("foo").isEqualTo(true).as("bar").isTrue().isFalse(); assertThat(object).isEqualTo(Boolean.TYPE); - org.junit.Assert.assertThat(foo, null); + org.junit.Assert.assertThat(object, null); fail("oh no!"); } } diff --git a/src/test/resources/inspections/CollectionMapExpression/CollectionMapExpressionAfter.java b/src/test/resources/inspections/CollectionMapExpression/CollectionMapExpressionAfter.java index 101f10f..91f3cb5 100644 --- a/src/test/resources/inspections/CollectionMapExpression/CollectionMapExpressionAfter.java +++ b/src/test/resources/inspections/CollectionMapExpression/CollectionMapExpressionAfter.java @@ -1,4 +1,5 @@ import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.fail; import java.util.*; @@ -41,7 +42,7 @@ public class CollectionMapExpression { assertThat(stringList.isEmpty()).as("foo").isEqualTo(false).as("bar").isTrue(); assertThat(stringList.isEmpty()).as("foo").satisfies(it -> it.booleanValue()).as("bar").isFalse(); - org.junit.Assert.assertThat(foo, null); + org.junit.Assert.assertThat(stringList, null); fail("oh no!"); } } diff --git a/src/test/resources/inspections/CollectionMapExpression/CollectionMapExpressionBefore.java b/src/test/resources/inspections/CollectionMapExpression/CollectionMapExpressionBefore.java index 86f817c..cfc5230 100644 --- a/src/test/resources/inspections/CollectionMapExpression/CollectionMapExpressionBefore.java +++ b/src/test/resources/inspections/CollectionMapExpression/CollectionMapExpressionBefore.java @@ -1,4 +1,5 @@ import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.fail; import java.util.*; @@ -41,7 +42,7 @@ public class CollectionMapExpression { assertThat(stringList.isEmpty()).as("foo").isEqualTo(false).as("bar").isTrue(); assertThat(stringList.isEmpty()).as("foo").satisfies(it -> it.booleanValue()).as("bar").isFalse(); - org.junit.Assert.assertThat(foo, null); + org.junit.Assert.assertThat(stringList, null); fail("oh no!"); } } diff --git a/src/test/resources/inspections/EnumerableIsEmpty/EnumerableIsEmptyAfter.java b/src/test/resources/inspections/EnumerableIsEmpty/EnumerableIsEmptyAfter.java index 8aa223a..17ef42c 100644 --- a/src/test/resources/inspections/EnumerableIsEmpty/EnumerableIsEmptyAfter.java +++ b/src/test/resources/inspections/EnumerableIsEmpty/EnumerableIsEmptyAfter.java @@ -1,6 +1,7 @@ import java.util.ArrayList; import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.fail; public class EnumerableIsEmpty { @@ -17,7 +18,7 @@ public class EnumerableIsEmpty { assertThat("string").as("foo").hasSize(0).hasSameSizeAs("foo").isEmpty(); - org.junit.Assert.assertThat(foo, null); + org.junit.Assert.assertThat("foo", null); fail("oh no!"); } } diff --git a/src/test/resources/inspections/EnumerableIsEmpty/EnumerableIsEmptyBefore.java b/src/test/resources/inspections/EnumerableIsEmpty/EnumerableIsEmptyBefore.java index 1df5e78..51d8de8 100644 --- a/src/test/resources/inspections/EnumerableIsEmpty/EnumerableIsEmptyBefore.java +++ b/src/test/resources/inspections/EnumerableIsEmpty/EnumerableIsEmptyBefore.java @@ -1,6 +1,7 @@ import java.util.ArrayList; import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.fail; public class EnumerableIsEmpty { @@ -17,7 +18,7 @@ public class EnumerableIsEmpty { assertThat("string").as("foo").hasSize(0).hasSameSizeAs("foo").hasSize(0); - org.junit.Assert.assertThat(foo, null); + org.junit.Assert.assertThat("foo", null); fail("oh no!"); } } diff --git a/src/test/resources/inspections/GuavaOptional/GuavaOptionalAfter.java b/src/test/resources/inspections/GuavaOptional/GuavaOptionalAfter.java index 21eea9e..97ff821 100644 --- a/src/test/resources/inspections/GuavaOptional/GuavaOptionalAfter.java +++ b/src/test/resources/inspections/GuavaOptional/GuavaOptionalAfter.java @@ -1,6 +1,7 @@ import com.google.common.base.Optional; import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.fail; import static org.assertj.guava.api.Assertions.assertThat; public class GuavaOptional { @@ -59,7 +60,7 @@ public class GuavaOptional { assertThat(opt.orNull()).as("foo").isEqualTo(null).isNotNull(); - org.junit.Assert.assertThat(foo, null); + org.junit.Assert.assertThat(opt, null); fail("oh no!"); } } diff --git a/src/test/resources/inspections/GuavaOptional/GuavaOptionalBefore.java b/src/test/resources/inspections/GuavaOptional/GuavaOptionalBefore.java index 81fde45..a4428dd 100644 --- a/src/test/resources/inspections/GuavaOptional/GuavaOptionalBefore.java +++ b/src/test/resources/inspections/GuavaOptional/GuavaOptionalBefore.java @@ -1,6 +1,7 @@ import com.google.common.base.Optional; import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.fail; import static org.assertj.guava.api.Assertions.assertThat; public class GuavaOptional { @@ -59,7 +60,7 @@ public class GuavaOptional { assertThat(opt.orNull()).as("foo").isEqualTo(null).isNotNull(); - org.junit.Assert.assertThat(foo, null); + org.junit.Assert.assertThat(opt, null); fail("oh no!"); } } diff --git a/src/test/resources/inspections/ImplicitAssertion/ImplicitAssertionAfter.java b/src/test/resources/inspections/ImplicitAssertion/ImplicitAssertionAfter.java index 8503ed1..ca4e9e7 100644 --- a/src/test/resources/inspections/ImplicitAssertion/ImplicitAssertionAfter.java +++ b/src/test/resources/inspections/ImplicitAssertion/ImplicitAssertionAfter.java @@ -6,6 +6,7 @@ import java.util.Optional; import java.util.function.Consumer; import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.fail; import static org.assertj.guava.api.Assertions.assertThat; public class ImplicitAssertion { @@ -285,7 +286,7 @@ public class ImplicitAssertion { assertThat(guavaOptional).extractingValue().isEqualTo("foo"); assertThat(guavaOptional).extractingCharSequence().isEqualTo("foo"); - org.junit.Assert.assertThat(foo, null); + org.junit.Assert.assertThat(string, null); fail("oh no!"); } } diff --git a/src/test/resources/inspections/ImplicitAssertion/ImplicitAssertionBefore.java b/src/test/resources/inspections/ImplicitAssertion/ImplicitAssertionBefore.java index f3b8726..e687b80 100644 --- a/src/test/resources/inspections/ImplicitAssertion/ImplicitAssertionBefore.java +++ b/src/test/resources/inspections/ImplicitAssertion/ImplicitAssertionBefore.java @@ -6,6 +6,7 @@ import java.util.Optional; import java.util.function.Consumer; import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.fail; import static org.assertj.guava.api.Assertions.assertThat; public class ImplicitAssertion { @@ -285,7 +286,7 @@ public class ImplicitAssertion { assertThat(guavaOptional).isPresent().extractingValue().isEqualTo("foo"); assertThat(guavaOptional).isPresent().extractingCharSequence().isEqualTo("foo"); - org.junit.Assert.assertThat(foo, null); + org.junit.Assert.assertThat(string, null); fail("oh no!"); } } diff --git a/src/test/resources/inspections/InstanceOf/InstanceOfAfter.java b/src/test/resources/inspections/InstanceOf/InstanceOfAfter.java index 4af0f5b..e2d7946 100644 --- a/src/test/resources/inspections/InstanceOf/InstanceOfAfter.java +++ b/src/test/resources/inspections/InstanceOf/InstanceOfAfter.java @@ -1,4 +1,5 @@ import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.fail; public class InstanceOf { @@ -22,7 +23,7 @@ public class InstanceOf { assertThat(object).as("foo").isInstanceOf(Boolean.class).as("bar").isInstanceOf(Boolean.class); assertThat(object instanceof Boolean).as("foo").isEqualTo(Boolean.TRUE).as("bar").isEqualTo(false); - org.junit.Assert.assertThat(foo, null); + org.junit.Assert.assertThat(object, null); fail("oh no!"); } } diff --git a/src/test/resources/inspections/InstanceOf/InstanceOfBefore.java b/src/test/resources/inspections/InstanceOf/InstanceOfBefore.java index 2ed6697..eff11ef 100644 --- a/src/test/resources/inspections/InstanceOf/InstanceOfBefore.java +++ b/src/test/resources/inspections/InstanceOf/InstanceOfBefore.java @@ -1,4 +1,5 @@ import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.fail; public class InstanceOf { @@ -22,7 +23,7 @@ public class InstanceOf { assertThat(object instanceof Boolean).as("foo").isEqualTo(Boolean.TRUE).as("bar").isEqualTo(true); assertThat(object instanceof Boolean).as("foo").isEqualTo(Boolean.TRUE).as("bar").isEqualTo(false); - org.junit.Assert.assertThat(foo, null); + org.junit.Assert.assertThat(object, null); fail("oh no!"); } } diff --git a/src/test/resources/inspections/InvertedBooleanCondition/InvertedBooleanConditionAfter.java b/src/test/resources/inspections/InvertedBooleanCondition/InvertedBooleanConditionAfter.java index 37c5833..1e34718 100644 --- a/src/test/resources/inspections/InvertedBooleanCondition/InvertedBooleanConditionAfter.java +++ b/src/test/resources/inspections/InvertedBooleanCondition/InvertedBooleanConditionAfter.java @@ -1,4 +1,5 @@ import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.fail; public class InvertedBooleanCondition { @@ -36,7 +37,7 @@ public class InvertedBooleanCondition { assertThat(primitive).as("foo").isFalse().as("bar").isFalse(); assertThat(primitive).as("foo").isFalse().as("bar").isTrue(); - org.junit.Assert.assertThat(foo, null); + org.junit.Assert.assertThat(object, null); fail("oh no!"); } } diff --git a/src/test/resources/inspections/InvertedBooleanCondition/InvertedBooleanConditionBefore.java b/src/test/resources/inspections/InvertedBooleanCondition/InvertedBooleanConditionBefore.java index acbe698..1376716 100644 --- a/src/test/resources/inspections/InvertedBooleanCondition/InvertedBooleanConditionBefore.java +++ b/src/test/resources/inspections/InvertedBooleanCondition/InvertedBooleanConditionBefore.java @@ -1,4 +1,5 @@ import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.fail; public class InvertedBooleanCondition { @@ -36,7 +37,7 @@ public class InvertedBooleanCondition { assertThat(!primitive).as("foo").isEqualTo(Boolean.TRUE).as("bar").isNotEqualTo(false); assertThat(!primitive).as("foo").isEqualTo(Boolean.TRUE).as("bar").isNotEqualTo(true); - org.junit.Assert.assertThat(foo, null); + org.junit.Assert.assertThat(object, null); fail("oh no!"); } } diff --git a/src/test/resources/inspections/Java8Optional/Java8OptionalAfter.java b/src/test/resources/inspections/Java8Optional/Java8OptionalAfter.java index 6a1fa14..9b51356 100644 --- a/src/test/resources/inspections/Java8Optional/Java8OptionalAfter.java +++ b/src/test/resources/inspections/Java8Optional/Java8OptionalAfter.java @@ -1,6 +1,7 @@ import java.util.Optional; import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.fail; public class Java8Optional { @@ -46,7 +47,7 @@ public class Java8Optional { assertThat(opt.orElse(null)).as("foo").isEqualTo(null).isNotNull(); - org.junit.Assert.assertThat(foo, null); + org.junit.Assert.assertThat(opt, null); fail("oh no!"); } } diff --git a/src/test/resources/inspections/Java8Optional/Java8OptionalBefore.java b/src/test/resources/inspections/Java8Optional/Java8OptionalBefore.java index 43f4bf9..98e492a 100644 --- a/src/test/resources/inspections/Java8Optional/Java8OptionalBefore.java +++ b/src/test/resources/inspections/Java8Optional/Java8OptionalBefore.java @@ -1,6 +1,7 @@ import java.util.Optional; import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.fail; public class Java8Optional { @@ -46,7 +47,7 @@ public class Java8Optional { assertThat(opt.orElse(null)).as("foo").isEqualTo(null).isNotNull(); - org.junit.Assert.assertThat(foo, null); + org.junit.Assert.assertThat(opt, null); fail("oh no!"); } } diff --git a/src/test/resources/inspections/JoinStatements/JoinStatementsAfter.java b/src/test/resources/inspections/JoinStatements/JoinStatementsAfter.java index faf5497..7a0ec3a 100644 --- a/src/test/resources/inspections/JoinStatements/JoinStatementsAfter.java +++ b/src/test/resources/inspections/JoinStatements/JoinStatementsAfter.java @@ -66,7 +66,7 @@ public class JoinStatements { assertThat(list.get(--i)).isEqualTo("foo"); assertThat(list.get(--i)).isEqualTo("foo"); - org.junit.Assert.assertThat(foo, null); + org.junit.Assert.assertThat(list, null); fail("oh no!"); } } diff --git a/src/test/resources/inspections/JoinStatements/JoinStatementsBefore.java b/src/test/resources/inspections/JoinStatements/JoinStatementsBefore.java index 1834ad6..0e5ab90 100644 --- a/src/test/resources/inspections/JoinStatements/JoinStatementsBefore.java +++ b/src/test/resources/inspections/JoinStatements/JoinStatementsBefore.java @@ -63,7 +63,7 @@ public class JoinStatements { assertThat(list.get(--i)).isEqualTo("foo"); assertThat(list.get(--i)).isEqualTo("foo"); - org.junit.Assert.assertThat(foo, null); + org.junit.Assert.assertThat(list, null); fail("oh no!"); } } diff --git a/src/test/resources/inspections/ObjectExpression/ObjectExpressionAfter.java b/src/test/resources/inspections/ObjectExpression/ObjectExpressionAfter.java index ea08db4..1168f42 100644 --- a/src/test/resources/inspections/ObjectExpression/ObjectExpressionAfter.java +++ b/src/test/resources/inspections/ObjectExpression/ObjectExpressionAfter.java @@ -1,4 +1,5 @@ import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.fail; public class ObjectExpression { diff --git a/src/test/resources/inspections/ObjectExpression/ObjectExpressionBefore.java b/src/test/resources/inspections/ObjectExpression/ObjectExpressionBefore.java index a996ba9..e9b17cc 100644 --- a/src/test/resources/inspections/ObjectExpression/ObjectExpressionBefore.java +++ b/src/test/resources/inspections/ObjectExpression/ObjectExpressionBefore.java @@ -1,4 +1,5 @@ import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.fail; public class ObjectExpression { diff --git a/src/test/resources/inspections/ObjectIsNullOrNotNull/ObjectIsNullOrNotNullAfter.java b/src/test/resources/inspections/ObjectIsNullOrNotNull/ObjectIsNullOrNotNullAfter.java index 612035f..3187a21 100644 --- a/src/test/resources/inspections/ObjectIsNullOrNotNull/ObjectIsNullOrNotNullAfter.java +++ b/src/test/resources/inspections/ObjectIsNullOrNotNull/ObjectIsNullOrNotNullAfter.java @@ -1,4 +1,5 @@ import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.fail; public class ObjectIsNull { @@ -14,7 +15,7 @@ public class ObjectIsNull { assertThat(new Object()).as("foo").isNotNull().as("bar").isEqualTo(new Object()).as("etc").isNull(); assertThat(new Object()).as("foo").isEqualTo(null).as("bar").isEqualTo(new Object()).as("etc").isNotNull(); - org.junit.Assert.assertThat(foo, null); + org.junit.Assert.assertThat("foo", null); fail("oh no!"); } } diff --git a/src/test/resources/inspections/ObjectIsNullOrNotNull/ObjectIsNullOrNotNullBefore.java b/src/test/resources/inspections/ObjectIsNullOrNotNull/ObjectIsNullOrNotNullBefore.java index 627bfaf..f41e657 100644 --- a/src/test/resources/inspections/ObjectIsNullOrNotNull/ObjectIsNullOrNotNullBefore.java +++ b/src/test/resources/inspections/ObjectIsNullOrNotNull/ObjectIsNullOrNotNullBefore.java @@ -1,4 +1,5 @@ import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.fail; public class ObjectIsNull { @@ -14,7 +15,7 @@ public class ObjectIsNull { assertThat(new Object()).as("foo").isNotEqualTo(null).as("bar").isEqualTo(new Object()).as("etc").isEqualTo(null); assertThat(new Object()).as("foo").isEqualTo(null).as("bar").isEqualTo(new Object()).as("etc").isNotEqualTo(null); - org.junit.Assert.assertThat(foo, null); + org.junit.Assert.assertThat("foo", null); fail("oh no!"); } } diff --git a/src/test/resources/inspections/Size/SizeAfter.java b/src/test/resources/inspections/Size/SizeAfter.java index 63a5835..09561ec 100644 --- a/src/test/resources/inspections/Size/SizeAfter.java +++ b/src/test/resources/inspections/Size/SizeAfter.java @@ -1,6 +1,7 @@ import java.util.ArrayList; import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.fail; public class Size { @@ -104,7 +105,7 @@ public class Size { assertThat(foo).isEqualTo(0); assertThat(string.length()).isPositive(); - org.junit.Assert.assertThat(foo, null); + org.junit.Assert.assertThat(string, null); fail("oh no!"); } } diff --git a/src/test/resources/inspections/Size/SizeBefore.java b/src/test/resources/inspections/Size/SizeBefore.java index f273b3b..c708f3e 100644 --- a/src/test/resources/inspections/Size/SizeBefore.java +++ b/src/test/resources/inspections/Size/SizeBefore.java @@ -1,6 +1,7 @@ import java.util.ArrayList; import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.fail; public class Size { @@ -104,7 +105,7 @@ public class Size { assertThat(foo).isEqualTo(0); assertThat(string.length()).isPositive(); - org.junit.Assert.assertThat(foo, null); + org.junit.Assert.assertThat(string, null); fail("oh no!"); } } diff --git a/src/test/resources/inspections/StringExpression/StringExpressionAfter.java b/src/test/resources/inspections/StringExpression/StringExpressionAfter.java index fc2a125..67bdbfd 100644 --- a/src/test/resources/inspections/StringExpression/StringExpressionAfter.java +++ b/src/test/resources/inspections/StringExpression/StringExpressionAfter.java @@ -1,4 +1,5 @@ import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.fail; public class StringExpression { @@ -50,7 +51,7 @@ public class StringExpression { assertThat(string.endsWith("foo")).as("foo").isEqualTo(false).as("bar").isTrue(); assertThat(string.endsWith("foo")).as("foo").satisfies(it -> it.booleanValue()).as("bar").isFalse(); - org.junit.Assert.assertThat(foo, null); + org.junit.Assert.assertThat(string, null); fail("oh no!"); } } diff --git a/src/test/resources/inspections/StringExpression/StringExpressionBefore.java b/src/test/resources/inspections/StringExpression/StringExpressionBefore.java index 3342081..ea569cf 100644 --- a/src/test/resources/inspections/StringExpression/StringExpressionBefore.java +++ b/src/test/resources/inspections/StringExpression/StringExpressionBefore.java @@ -1,4 +1,5 @@ import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.fail; public class StringExpression { @@ -50,7 +51,7 @@ public class StringExpression { assertThat(string.endsWith("foo")).as("foo").isEqualTo(false).as("bar").isTrue(); assertThat(string.endsWith("foo")).as("foo").satisfies(it -> it.booleanValue()).as("bar").isFalse(); - org.junit.Assert.assertThat(foo, null); + org.junit.Assert.assertThat(string, null); fail("oh no!"); } } diff --git a/src/test/resources/inspections/StringIsEmpty/StringIsEmptyAfter.java b/src/test/resources/inspections/StringIsEmpty/StringIsEmptyAfter.java index cb9f834..ffbe7e0 100644 --- a/src/test/resources/inspections/StringIsEmpty/StringIsEmptyAfter.java +++ b/src/test/resources/inspections/StringIsEmpty/StringIsEmptyAfter.java @@ -1,4 +1,5 @@ import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.fail; public class StringIsEmpty { @@ -19,7 +20,7 @@ public class StringIsEmpty { assertThat(string).as("foo").isEqualTo("").as("bar").hasSize(0).hasSameSizeAs("foo").isEmpty(); assertThat(string).as("foo").isEqualTo("").as("bar").hasSize(0).hasSameSizeAs("foo").isEmpty(); - org.junit.Assert.assertThat(foo, null); + org.junit.Assert.assertThat(string, null); fail("oh no!"); } } diff --git a/src/test/resources/inspections/StringIsEmpty/StringIsEmptyBefore.java b/src/test/resources/inspections/StringIsEmpty/StringIsEmptyBefore.java index 4f62bd2..f2148a2 100644 --- a/src/test/resources/inspections/StringIsEmpty/StringIsEmptyBefore.java +++ b/src/test/resources/inspections/StringIsEmpty/StringIsEmptyBefore.java @@ -1,4 +1,5 @@ import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.fail; public class StringIsEmpty { @@ -19,7 +20,7 @@ public class StringIsEmpty { assertThat(string).as("foo").isEqualTo("").as("bar").hasSize(0).hasSameSizeAs("foo").isEqualTo(""); assertThat(string).as("foo").isEqualTo("").as("bar").hasSize(0).hasSameSizeAs("foo").hasSize(0); - org.junit.Assert.assertThat(foo, null); + org.junit.Assert.assertThat(string, null); fail("oh no!"); } }