-
-
Save mike-solomon/9e13ae5acb6c60effaf6557176771785 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package org.yourorg.starter; | |
| import org.junit.jupiter.api.Test; | |
| import org.openrewrite.test.RecipeSpec; | |
| import org.openrewrite.test.RewriteTest; | |
| import static org.openrewrite.java.Assertions.java; | |
| public class SomeRecipeTest implements RewriteTest { | |
| @Override | |
| public void defaults(RecipeSpec spec) { | |
| spec.recipe(new SomeRecipe()); | |
| } | |
| @Test | |
| void example() { | |
| rewriteRun( | |
| //language=java | |
| java(""" | |
| package org.openrewrite; | |
| import java.util.ArrayList; | |
| import java.util.List; | |
| import java.util.stream.Collectors; | |
| @AnAnnotation | |
| public class A { | |
| List<Integer> a = new ArrayList<>(); | |
| int foo() { | |
| int a = 1 + 2, b = 3, c; | |
| this.a = this.a.stream() | |
| .map(it -> it + 1) | |
| .collect(Collectors.toList()); | |
| return a; | |
| } | |
| } | |
| @interface AnAnnotation {} | |
| """) | |
| ); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment