Created
April 11, 2024 11:06
-
-
Save Bit-Flipper/2d5eb7a601cf43d4ecf0c0093f3e0f7f to your computer and use it in GitHub Desktop.
This file contains 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 dev.bitflippers; | |
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 TestAddDummyAnnotation implements RewriteTest { | |
@Override | |
public void defaults(RecipeSpec spec) { | |
spec.recipe(new AddDummyAnnotation()); | |
} | |
@Test | |
public void getMethodIsReplacedWithLombokAnnotation() { | |
rewriteRun( | |
spec -> spec.expectedCyclesThatMakeChanges(1) | |
.cycles(3), | |
java( | |
//language=java | |
""" | |
public class TestClass { | |
public String foo = "foo"; | |
public int a = 10; | |
} | |
""", | |
//language=java | |
""" | |
import com.google.common.annotations.Beta; | |
public class TestClass { | |
@Beta | |
public String foo = "foo"; | |
@Beta | |
public int a = 10; | |
} | |
""" | |
) | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment