Skip to content

Commit

Permalink
Relocate IsJenkinsPlugin
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 f0fb5bb commit 0ce13dd
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 69 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@
* 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;
import net.sghill.jenkins.rewrite.Jenkins;
import org.openrewrite.*;
import org.openrewrite.marker.SearchResult;
import org.openrewrite.semver.Semver;
Expand Down
71 changes: 71 additions & 0 deletions src/test/java/org/openrewrite/jenkins/IsJenkinsPluginTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
/*
* Copyright 2023 the original author or authors.
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* https://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.openrewrite.jenkins;

import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.openrewrite.test.RecipeSpec;
import org.openrewrite.test.RewriteTest;

import static org.openrewrite.maven.Assertions.pomXml;

@Disabled
class IsJenkinsPluginTest implements RewriteTest {

@Override
public void defaults(RecipeSpec spec) {
spec.recipe(new IsJenkinsPlugin("*"));
}

@Test
void shouldKnowIfJenkinsPlugin() {
rewriteRun(pomXml(
"""
<project>
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>4.40</version>
</parent>
<artifactId>my-plugin</artifactId>
<version>0.1</version>
<repositories>
<repository>
<id>repo.jenkins-ci.org</id>
<url>https://repo.jenkins-ci.org/public/</url>
</repository>
</repositories>
</project>
""".stripIndent(),
"""
<!--~~(2.249)~~>--><project>
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>4.40</version>
</parent>
<artifactId>my-plugin</artifactId>
<version>0.1</version>
<repositories>
<repository>
<id>repo.jenkins-ci.org</id>
<url>https://repo.jenkins-ci.org/public/</url>
</repository>
</repositories>
</project>
""".stripIndent()));
}
}
68 changes: 0 additions & 68 deletions src/test/kotlin/net/sghill/jenkins/rewrite/IsJenkinsPluginTest.kt

This file was deleted.

0 comments on commit 0ce13dd

Please sign in to comment.