Skip to content

Commit

Permalink
Relocate UpgradeParentPom_4_66
Browse files Browse the repository at this point in the history
Rewrite test in java. Issue #4
  • Loading branch information
sghill committed Jun 29, 2023
1 parent baa4b77 commit 706aace
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 24 deletions.
2 changes: 1 addition & 1 deletion src/main/resources/META-INF/rewrite/rewrite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ recipeList:
- net.sghill.jenkins.rewrite.UpgradeParentPom_4_66
---
type: specs.openrewrite.org/v1beta/recipe
name: net.sghill.jenkins.rewrite.UpgradeParentPom_4_66
name: org.openrewrite.jenkins.UpgradeParentPom_4_66
displayName: Migrate to Parent POM 4.66
description: Upgrade to Parent POM 4.66
recipeList:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,26 @@
* 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.Disabled
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.Disabled;
import org.junit.jupiter.api.Test;
import org.openrewrite.test.RecipeSpec;
import org.openrewrite.test.RewriteTest;

class UpgradeParentPom466Test : RewriteTest {
import static org.openrewrite.maven.Assertions.pomXml;

override fun defaults(spec: RecipeSpec) {
spec.recipeFromResource("/META-INF/rewrite/rewrite.yml", "net.sghill.jenkins.rewrite.UpgradeParentPom_4_66")
@Disabled
class UpgradeParentPom466Test implements RewriteTest {
@Override
public void defaults(RecipeSpec spec) {
spec.recipeFromResource("/META-INF/rewrite/rewrite.yml", "org.openrewrite.jenkins.UpgradeParentPom_4_66");
}

@Test
@Disabled
fun noHtmlUnit() = rewriteRun(
pomXml(
"""
void shouldHandleNoHtmlUnit() {
rewriteRun(pomXml(
"""
<project>
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
Expand All @@ -51,7 +52,8 @@ fun noHtmlUnit() = rewriteRun(
</repository>
</repositories>
</project>
""", """
""".stripIndent(),
"""
<project>
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
Expand All @@ -71,15 +73,14 @@ fun noHtmlUnit() = rewriteRun(
</repository>
</repositories>
</project>
"""
)
)
""".stripIndent()
));
}

@Test
@Disabled
fun doesNotDowngrade() = rewriteRun(
pomXml(
"""
void shouldNotDowngrade() {
rewriteRun(pomXml(
"""
<project>
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
Expand All @@ -99,6 +100,7 @@ fun doesNotDowngrade() = rewriteRun(
</repository>
</repositories>
</project>
""" )
)
""".stripIndent()
));
}
}

0 comments on commit 706aace

Please sign in to comment.