Skip to content

Commit 27763da

Browse files
refactor: OpenRewrite Recipe best practices
Use this link to re-run the recipe: https://app.moderne.io/recipes/org.openrewrite.recipes.rewrite.OpenRewriteRecipeBestPractices?organizationId=T3BlblJld3JpdGU%3D Co-authored-by: Moderne <team@moderne.io>
1 parent d7f131a commit 27763da

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/test/java/org/openrewrite/rewrite/RecipeTest.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,25 @@
1616
package org.openrewrite.rewrite;
1717

1818
import org.junit.jupiter.api.Test;
19+
import org.openrewrite.DocumentExample;
1920
import org.openrewrite.marker.SearchResult;
2021
import org.openrewrite.test.RecipeSpec;
2122
import org.openrewrite.test.RewriteTest;
2223

2324
import static org.openrewrite.java.Assertions.java;
2425
import static org.openrewrite.yaml.Assertions.yaml;
2526

26-
public class RecipeTest implements RewriteTest {
27+
class RecipeTest implements RewriteTest {
2728

2829
@Override
2930
public void defaults(RecipeSpec spec) {
3031
spec.recipe(RewriteTest.toRecipe(() -> new Recipe.Matcher().asVisitor(recipe ->
3132
SearchResult.found(recipe.getTree(), recipe.getDisplayName() + "=" + recipe.getDescription()))));
3233
}
3334

34-
@Test
35-
void classDefinedRecipe() {
35+
@DocumentExample
36+
@Test
37+
void classDefinedRecipe() {
3638
rewriteRun(
3739
//language=java
3840
java(

0 commit comments

Comments
 (0)