Skip to content

Instantly share code, notes, and snippets.

@Bit-Flipper
Created April 11, 2024 11:06
Show Gist options
  • Save Bit-Flipper/2d5eb7a601cf43d4ecf0c0093f3e0f7f to your computer and use it in GitHub Desktop.
Save Bit-Flipper/2d5eb7a601cf43d4ecf0c0093f3e0f7f to your computer and use it in GitHub Desktop.
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