diff --git a/src/test/java/org/openrewrite/kotlin/tree/AnnotationTest.java b/src/test/java/org/openrewrite/kotlin/tree/AnnotationTest.java index 96496e962..7a745e48c 100644 --- a/src/test/java/org/openrewrite/kotlin/tree/AnnotationTest.java +++ b/src/test/java/org/openrewrite/kotlin/tree/AnnotationTest.java @@ -29,7 +29,7 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.openrewrite.kotlin.Assertions.kotlin; -@SuppressWarnings({"RedundantSuppression", "RedundantNullableReturnType", "RedundantVisibilityModifier", "UnusedReceiverParameter", "SortModifiers"}) +@SuppressWarnings({"RedundantSuppression", "RedundantNullableReturnType", "RedundantVisibilityModifier", "UnusedReceiverParameter", "SortModifiers", "TrailingComma"}) class AnnotationTest implements RewriteTest { @Language("kotlin") @@ -158,8 +158,7 @@ void fullyQualifiedAnnotation() { kotlin( """ @java.lang.Deprecated - class A { - } + class A """ ) ); @@ -504,8 +503,7 @@ void collectionLiteralExpression() { @JsonSubTypes(value = [ JsonSubTypes . Type(value = Employee::class, name = "Employee") ]) - public sealed interface Person { - } + public sealed interface Person """ ) ); diff --git a/src/test/java/org/openrewrite/kotlin/tree/AnonymousFunctionTest.java b/src/test/java/org/openrewrite/kotlin/tree/AnonymousFunctionTest.java index a2cd29d98..a2d0cb7ac 100644 --- a/src/test/java/org/openrewrite/kotlin/tree/AnonymousFunctionTest.java +++ b/src/test/java/org/openrewrite/kotlin/tree/AnonymousFunctionTest.java @@ -23,13 +23,6 @@ class AnonymousFunctionTest implements RewriteTest { -// @Override -// public void defaults(RecipeSpec spec) { -// spec -// .recipe(Recipe.noop()) -// .allSources(spaceConscious()); -// } - @Test @Issue("https://github.com/openrewrite/rewrite-kotlin/issues/287") void noArgs() { @@ -38,7 +31,6 @@ void noArgs() { """ val alwaysTrue = fun ( ) = true """ -// , spec -> spec.afterRecipe(spaceConscious(spec)) ) ); } @@ -68,5 +60,4 @@ void nestedWithWhitespace() { ) ); } - } diff --git a/src/test/java/org/openrewrite/kotlin/tree/FunctionTypeTest.java b/src/test/java/org/openrewrite/kotlin/tree/FunctionTypeTest.java index 1314934de..f66a714fc 100644 --- a/src/test/java/org/openrewrite/kotlin/tree/FunctionTypeTest.java +++ b/src/test/java/org/openrewrite/kotlin/tree/FunctionTypeTest.java @@ -22,6 +22,7 @@ import static org.openrewrite.kotlin.Assertions.kotlin; +@SuppressWarnings("unused") class FunctionTypeTest implements RewriteTest { @Issue("https://github.com/openrewrite/rewrite-kotlin/issues/326") @@ -32,9 +33,8 @@ void functionWithFunctionTypeParameter() { """ class GradleSpigotDependencyLoaderTestBuilder( var init: TestInitializer.() -> Unit = {} - ) { - } - + ) + class TestInitializer( val resourcesDir: String ) @@ -94,6 +94,7 @@ void parenthesizedNullableType() { ); } + @SuppressWarnings("UNUSED_PARAMETER") @ExpectedToFail @Test @Issue("https://github.com/openrewrite/rewrite-kotlin/issues/292") diff --git a/src/test/java/org/openrewrite/kotlin/tree/MethodDeclarationTest.java b/src/test/java/org/openrewrite/kotlin/tree/MethodDeclarationTest.java index 3fc400559..9fef0d7f2 100644 --- a/src/test/java/org/openrewrite/kotlin/tree/MethodDeclarationTest.java +++ b/src/test/java/org/openrewrite/kotlin/tree/MethodDeclarationTest.java @@ -166,8 +166,12 @@ void genericTypeParameters() { @Test void receiverType() { rewriteRun( - kotlin("class Test"), - kotlin("fun Test . method ( ) { }") + kotlin( + """ + class Test + fun Test . method ( ) { } + """ + ) ); } @@ -180,10 +184,7 @@ class Test { fun build ( s : ( ) -> String ) { } } - """ - ), - kotlin( - """ + fun Test . method ( ) = build { "42" } @@ -198,6 +199,7 @@ void nullableReturnType() { kotlin( """ fun method ( ) : Array < Int > ? { + return null } """ )