From 0b0df943a54565496f45a00b1c62f4ab4541d4b3 Mon Sep 17 00:00:00 2001 From: Knut Wannheden Date: Wed, 27 Sep 2023 22:04:12 +0200 Subject: [PATCH] Fix a few more missing types in tests --- .../openrewrite/java/ChangeFieldNameTest.java | 4 ++-- .../java/format/TabsAndIndentsTest.java | 2 ++ .../search/FindRepeatableAnnotationsTest.java | 17 +++++++++++++++-- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/rewrite-java-test/src/test/java/org/openrewrite/java/ChangeFieldNameTest.java b/rewrite-java-test/src/test/java/org/openrewrite/java/ChangeFieldNameTest.java index 6c3fd3f6934..badcfebe6c5 100644 --- a/rewrite-java-test/src/test/java/org/openrewrite/java/ChangeFieldNameTest.java +++ b/rewrite-java-test/src/test/java/org/openrewrite/java/ChangeFieldNameTest.java @@ -187,7 +187,7 @@ class Test { List collection = null; class Nested { Object collection = Test.this.collection; - Object collection2 = A.this.collection; + Object collection2 = new A().collection; } } """, @@ -197,7 +197,7 @@ class Test { List list = null; class Nested { Object collection = Test.this.list; - Object collection2 = A.this.collection; + Object collection2 = new A().collection; } } """ diff --git a/rewrite-java-test/src/test/java/org/openrewrite/java/format/TabsAndIndentsTest.java b/rewrite-java-test/src/test/java/org/openrewrite/java/format/TabsAndIndentsTest.java index 4a90cd7b334..90dd75b751e 100644 --- a/rewrite-java-test/src/test/java/org/openrewrite/java/format/TabsAndIndentsTest.java +++ b/rewrite-java-test/src/test/java/org/openrewrite/java/format/TabsAndIndentsTest.java @@ -26,6 +26,7 @@ import org.openrewrite.style.NamedStyles; import org.openrewrite.test.RecipeSpec; import org.openrewrite.test.RewriteTest; +import org.openrewrite.test.TypeValidation; import java.util.function.Consumer; import java.util.function.UnaryOperator; @@ -942,6 +943,7 @@ class Test { @Test void moreAnnotations() { rewriteRun( + spec -> spec.typeValidationOptions(TypeValidation.none()), java( """ import lombok.EqualsAndHashCode; diff --git a/rewrite-java-test/src/test/java/org/openrewrite/java/search/FindRepeatableAnnotationsTest.java b/rewrite-java-test/src/test/java/org/openrewrite/java/search/FindRepeatableAnnotationsTest.java index eb1ddfdd9ae..1832200080a 100644 --- a/rewrite-java-test/src/test/java/org/openrewrite/java/search/FindRepeatableAnnotationsTest.java +++ b/rewrite-java-test/src/test/java/org/openrewrite/java/search/FindRepeatableAnnotationsTest.java @@ -19,6 +19,7 @@ import org.openrewrite.DocumentExample; import org.openrewrite.test.RecipeSpec; import org.openrewrite.test.RewriteTest; +import org.openrewrite.test.SourceSpec; import static org.openrewrite.java.Assertions.java; @@ -75,7 +76,8 @@ void test() { String target(); } - """ + """, + SourceSpec::skip ), java( """ @@ -91,7 +93,18 @@ void test() { public @interface ValueMappings { ValueMapping[] value(); } - """ + """, + SourceSpec::skip + ), + java( + """ + package org.mapstruct; + + public class MappingConstants { + public static final String NULL = "null"; + } + """, + SourceSpec::skip ) ); }