Closed zacscoding closed 11 months ago
I am using
import org.junit.jupiter.api.Test; import org.openrewrite.java.ChangeAnnotationAttributeName; import org.openrewrite.java.JavaParser; import org.openrewrite.kotlin.KotlinParser; import org.openrewrite.test.RewriteTest; import static org.openrewrite.java.Assertions.java; import static org.openrewrite.kotlin.Assertions.kotlin; public class ChangeAnnotationAttributeNameTest implements RewriteTest { @Test public void run() { rewriteRun( spec -> spec.recipe(new ChangeAnnotationAttributeName( "org.junit.jupiter.api.Tag", "value", "newValue" )) .parser(KotlinParser.builder().classpath("junit-jupiter-api")), kotlin( """ package sample import org.junit.jupiter.api.Tag import org.junit.jupiter.api.Tags class SampleTest { @Tags( value = [ Tag(value = "Sample01"), Tag(value = "Sample02"), ] ) fun run() { } } """, """ package sample import org.junit.jupiter.api.Tag import org.junit.jupiter.api.Tags class SampleTest { @Tags( value = [ Tag(newValue = "Sample01"), Tag(newValue = "Sample02"), ] ) fun run() { } } """ ) ); } }
@zacscoding thank you for reporting the issue! I'll take a look :)
What version of OpenRewrite are you using?
I am using
What is the smallest, simplest way to reproduce the problem?