From 6bbe21aca19d4fe1c9bb9892acfc4ca4e3d86ac7 Mon Sep 17 00:00:00 2001 From: Tim te Beek Date: Tue, 23 Jul 2024 18:33:11 +0200 Subject: [PATCH] Further test fixes --- .../openrewrite/config/EnvironmentTest.java | 24 +++++++++++++++---- .../resources/META-INF/rewrite/rewrite.yml | 2 +- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/rewrite-test/src/test/java/org/openrewrite/config/EnvironmentTest.java b/rewrite-test/src/test/java/org/openrewrite/config/EnvironmentTest.java index cfebb015b1c..199ded1e891 100644 --- a/rewrite-test/src/test/java/org/openrewrite/config/EnvironmentTest.java +++ b/rewrite-test/src/test/java/org/openrewrite/config/EnvironmentTest.java @@ -45,6 +45,7 @@ void declarativeRecipesDontAddToEstimatedTimeFixed() { type: specs.openrewrite.org/v1beta/recipe name: test.ChangeTextToHello displayName: Change text to hello + description: Test. recipeList: - org.openrewrite.text.ChangeText: toText: Hello @@ -74,6 +75,7 @@ void listRecipes() { type: specs.openrewrite.org/v1beta/recipe name: test.ChangeTextToHello displayName: Change text to hello + description: Test. recipeList: - org.openrewrite.text.ChangeText: toText: Hello @@ -112,6 +114,7 @@ void activeRecipeNotFoundSuggestions() { type: specs.openrewrite.org/v1beta/recipe name: test.ChangeTextToHello displayName: Change text to hello + description: Test. recipeList: - org.openrewrite.text.ChangeText: toText: Hello @@ -119,6 +122,7 @@ void activeRecipeNotFoundSuggestions() { type: specs.openrewrite.org/v1beta/recipe name: test.ChangeTextToHelloWorld displayName: Change text to hello world + description: Test. recipeList: - org.openrewrite.text.ChangeText: toText: Hello @@ -147,6 +151,7 @@ void recipeWithoutRequiredConfiguration() { type: specs.openrewrite.org/v1beta/recipe name: test.ChangeTextToHello displayName: Change text to hello + description: Test. recipeList: - org.openrewrite.text.ChangeText """.getBytes() @@ -172,12 +177,14 @@ void recipeDependsOnOtherDeclarativeRecipe() { type: specs.openrewrite.org/v1beta/recipe name: test.TextMigration displayName: Text migration + description: Test. recipeList: - test.ChangeTextToHello --- type: specs.openrewrite.org/v1beta/recipe name: test.ChangeTextToHello displayName: Change text to hello + description: Test. recipeList: - org.openrewrite.text.ChangeText: toText: Hello @@ -213,6 +220,7 @@ void recipeDependsOnOtherDeclarativeRecipeSpecifiedInAnotherFile() { type: specs.openrewrite.org/v1beta/recipe name: test.TextMigration displayName: Text migration + description: Test. recipeList: - test.ChangeTextToHello """.getBytes() @@ -262,6 +270,7 @@ void recipeDependsOnNonExistentRecipe() { type: specs.openrewrite.org/v1beta/recipe name: test.TextMigration displayName: Text migration + description: Test. recipeList: - test.DoesNotExist """.getBytes() @@ -286,7 +295,8 @@ void declarativeRecipeListClassCastException() { """ type: specs.openrewrite.org/v1beta/recipe name: test.LicenseHeader - displayName: License header. + displayName: License header + description: Test. recipeList: - org.openrewrite.java.AddLicenseHeader: |- LicenseHeader @@ -312,6 +322,7 @@ void declarativeRecipeWrongPackage() { type: specs.openrewrite.org/v1beta/recipe name: test.ResultOfFileMkdirsIgnored displayName: Test + description: Test. recipeList: - org.openrewrite.java.ResultOfMethodCallIgnored: methodPattern: 'java.io.File mkdir*()' @@ -427,6 +438,7 @@ void preserveRecipeListOrder() { type: specs.openrewrite.org/v1beta/recipe name: test.FooOne displayName: Test + description: Test. recipeList: - org.openrewrite.config.RecipeAcceptingParameters: foo: "foo" @@ -459,6 +471,7 @@ void preserveRecipeListOrder() { type: specs.openrewrite.org/v1beta/recipe name: test.OrderPreserved displayName: Test + description: Test. recipeList: - org.openrewrite.config.RecipeNoParameters - test.FooOne @@ -474,7 +487,7 @@ void preserveRecipeListOrder() { new Properties() )) .build(); - var recipeList = env.activateRecipes("test.OrderPreserved").getRecipeList().get(0).getRecipeList(); + var recipeList = env.activateRecipes("test.OrderPreserved").getRecipeList(); assertThat(recipeList.get(0).getName()).isEqualTo("org.openrewrite.config.RecipeNoParameters"); assertThat(recipeList.get(1).getName()).isEqualTo("test.FooOne"); assertThat(recipeList.get(2).getName()).isEqualTo("org.openrewrite.config.RecipeAcceptingParameters"); @@ -493,17 +506,18 @@ void canCauseAnotherCycle() { type: specs.openrewrite.org/v1beta/recipe name: test.Foo displayName: Test + description: Test. causesAnotherCycle: true recipeList: - org.openrewrite.config.RecipeNoParameters - + """.getBytes() ), URI.create("rewrite.yml"), new Properties() )).build(); var recipe = env.activateRecipes("test.Foo"); - assertThat(recipe.getRecipeList().get(0).causesAnotherCycle()).isTrue(); + assertThat(recipe.causesAnotherCycle()).isTrue(); } @Test @@ -516,6 +530,7 @@ void willBeValidIfIncludesRecipesFromDependencies() { type: specs.openrewrite.org/v1beta/recipe name: test.Foo displayName: Test + description: Test. recipeList: - org.openrewrite.config.RecipeNoParameters """.getBytes() @@ -530,6 +545,7 @@ void willBeValidIfIncludesRecipesFromDependencies() { type: specs.openrewrite.org/v1beta/recipe name: org.openrewrite.config.RecipeNoParameters displayName: Test + description: Test. recipeList: - org.openrewrite.config.RecipeSomeParameters """.getBytes() diff --git a/rewrite-test/src/test/resources/META-INF/rewrite/rewrite.yml b/rewrite-test/src/test/resources/META-INF/rewrite/rewrite.yml index 0568f885fc1..b4ba1c9c208 100644 --- a/rewrite-test/src/test/resources/META-INF/rewrite/rewrite.yml +++ b/rewrite-test/src/test/resources/META-INF/rewrite/rewrite.yml @@ -17,7 +17,7 @@ type: specs.openrewrite.org/v1beta/recipe name: org.openrewrite.text.ChangeTextToJon displayName: Change Text To Jon -description: Changes Text to "Hello Jon!" +description: Changes Text to "Hello Jon!". tags: - testing - plain text