diff --git a/src/main/java/net/sghill/jenkins/rewrite/ChangeJenkinsVersion.java b/src/main/java/org/openrewrite/jenkins/ChangeJenkinsVersion.java similarity index 98% rename from src/main/java/net/sghill/jenkins/rewrite/ChangeJenkinsVersion.java rename to src/main/java/org/openrewrite/jenkins/ChangeJenkinsVersion.java index 6fb105d..7801473 100644 --- a/src/main/java/net/sghill/jenkins/rewrite/ChangeJenkinsVersion.java +++ b/src/main/java/org/openrewrite/jenkins/ChangeJenkinsVersion.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package net.sghill.jenkins.rewrite; +package org.openrewrite.jenkins; import lombok.EqualsAndHashCode; import lombok.Value; diff --git a/src/main/resources/META-INF/rewrite/rewrite.yml b/src/main/resources/META-INF/rewrite/rewrite.yml index aa4e2e5..0c58822 100644 --- a/src/main/resources/META-INF/rewrite/rewrite.yml +++ b/src/main/resources/META-INF/rewrite/rewrite.yml @@ -205,7 +205,7 @@ recipeList: type: specs.openrewrite.org/v1beta/recipe name: net.sghill.jenkins.ModernizePlugin recipeList: - - net.sghill.jenkins.rewrite.ChangeJenkinsVersion: + - org.openrewrite.jenkins.ChangeJenkinsVersion: parentPomVersion: "4.64" jenkinsVersion: "2.332.1" - net.sghill.jenkins.rewrite.AddPluginsBom: diff --git a/src/test/kotlin/net/sghill/jenkins/rewrite/ChangeJenkinsVersionTest.kt b/src/test/java/org/openrewrite/jenkins/ChangeJenkinsVersionTest.java similarity index 85% rename from src/test/kotlin/net/sghill/jenkins/rewrite/ChangeJenkinsVersionTest.kt rename to src/test/java/org/openrewrite/jenkins/ChangeJenkinsVersionTest.java index 6520845..4764392 100644 --- a/src/test/kotlin/net/sghill/jenkins/rewrite/ChangeJenkinsVersionTest.kt +++ b/src/test/java/org/openrewrite/jenkins/ChangeJenkinsVersionTest.java @@ -13,24 +13,24 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package net.sghill.jenkins.rewrite +package org.openrewrite.jenkins; -import org.junit.jupiter.api.Test -import org.openrewrite.maven.Assertions.pomXml -import org.openrewrite.test.RecipeSpec -import org.openrewrite.test.RewriteTest +import org.junit.jupiter.api.Test; +import org.openrewrite.test.RecipeSpec; +import org.openrewrite.test.RewriteTest; -class ChangeJenkinsVersionTest: RewriteTest { +import static org.openrewrite.maven.Assertions.pomXml; - override fun defaults(spec: RecipeSpec) { - spec - .recipe(ChangeJenkinsVersion("4.40", "2.303.3")) +class ChangeJenkinsVersionTest implements RewriteTest { + @Override + public void defaults(RecipeSpec spec) { + spec.recipe(new ChangeJenkinsVersion("4.40", "2.303.3")); } @Test - fun majorVersionUpgrade() = rewriteRun( - pomXml( - """ + void shouldDoMajorVersionUpgrade() { + rewriteRun(pomXml( + """ org.jenkins-ci.plugins @@ -49,7 +49,8 @@ fun majorVersionUpgrade() = rewriteRun( - """, """ + """.stripIndent(), + """ org.jenkins-ci.plugins @@ -68,14 +69,13 @@ fun majorVersionUpgrade() = rewriteRun( - """ - ) - ) - + """.stripIndent())); + } + @Test - fun addPropertyIfMissing() = rewriteRun( - pomXml( - """ + void shouldAddPropertyIfMissing() { + rewriteRun(pomXml( + """ org.jenkins-ci.plugins @@ -93,7 +93,8 @@ fun addPropertyIfMissing() = rewriteRun( - """, """ + """.stripIndent(), + """ org.jenkins-ci.plugins @@ -112,14 +113,14 @@ fun addPropertyIfMissing() = rewriteRun( - """ - ) - ) - + """.stripIndent() + )); + } + @Test - fun addPropertyIfNoProperties() = rewriteRun( - pomXml( - """ + void shouldAddPropertyIfNoProperties() { + rewriteRun(pomXml( + """ org.jenkins-ci.plugins @@ -135,7 +136,8 @@ fun addPropertyIfNoProperties() = rewriteRun( - """, """ + """.stripIndent(), + """ org.jenkins-ci.plugins @@ -154,7 +156,7 @@ fun addPropertyIfNoProperties() = rewriteRun( - """ - ) - ) + """.stripIndent() + )); + } }