Skip to content

Commit 494dd1e

Browse files
committed
chore: migrate AbstractMojoTestCase based test to use MojoTest
Signed-off-by: Sandra Parsick <[email protected]>
1 parent b14073c commit 494dd1e

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ under the License.
331331
<dependency>
332332
<groupId>org.apache.maven.plugin-testing</groupId>
333333
<artifactId>maven-plugin-testing-harness</artifactId>
334-
<version>4.0.0-alpha-2</version>
334+
<version>3.4.0</version> <!-- TODO check 4.0.0-alpha-2-->
335335
<scope>test</scope>
336336
</dependency>
337337
<dependency>

src/test/java/org/apache/maven/plugins/changes/jira/JiraChangesReportTest.java

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@
1818
*/
1919
package org.apache.maven.plugins.changes.jira;
2020

21-
import org.apache.maven.plugin.testing.AbstractMojoTestCase;
21+
import org.apache.maven.api.plugin.testing.InjectMojo;
22+
import org.apache.maven.api.plugin.testing.MojoParameter;
23+
import org.apache.maven.api.plugin.testing.MojoTest;
2224
import org.junit.jupiter.api.Test;
2325

2426
import static org.junit.jupiter.api.Assertions.assertFalse;
@@ -29,17 +31,19 @@
2931
* @author jrh3k5
3032
* @since 2.8
3133
*/
32-
public class JiraChangesReportTest extends AbstractMojoTestCase {
33-
private final JiraChangesReport mojo = new JiraChangesReport(null);
34+
@MojoTest
35+
public class JiraChangesReportTest {
3436

3537
/**
3638
* If the mojo has been marked to be skipped, then it should indicate that the report cannot be generated.
3739
*
3840
* @throws Exception If any errors occur during the test run.
3941
*/
42+
4043
@Test
41-
public void testCanGenerateReportSkipped() throws Exception {
42-
setVariableValueToObject(mojo, "skip", Boolean.TRUE);
44+
@InjectMojo(goal ="jira-changes")
45+
@MojoParameter(name= "skip", value = "true")
46+
public void testCanGenerateReportSkipped(JiraChangesReport mojo) {
4347
assertFalse(mojo.canGenerateReport());
4448
}
4549
}

0 commit comments

Comments
 (0)