diff --git a/maven-plugin-testing-harness/pom.xml b/maven-plugin-testing-harness/pom.xml
index 3d9a9b40..5ddc46d2 100644
--- a/maven-plugin-testing-harness/pom.xml
+++ b/maven-plugin-testing-harness/pom.xml
@@ -31,21 +31,10 @@ under the License.
The Maven Plugin Testing Harness provides mechanisms to manage tests on Mojo.
+ 5.13.0
3.5.3
-
-
-
- org.junit
- junit-bom
- 5.13.0
- pom
- import
-
-
-
-
diff --git a/maven-plugin-testing-harness/src/test/java/org/apache/maven/plugin/testing/ParametersMojo.java b/maven-plugin-testing-harness/src/test/java/org/apache/maven/plugin/testing/ParametersMojo.java
index 77e52d9c..438b46f4 100644
--- a/maven-plugin-testing-harness/src/test/java/org/apache/maven/plugin/testing/ParametersMojo.java
+++ b/maven-plugin-testing-harness/src/test/java/org/apache/maven/plugin/testing/ParametersMojo.java
@@ -19,20 +19,51 @@
package org.apache.maven.plugin.testing;
import org.apache.maven.plugin.AbstractMojo;
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugin.MojoFailureException;
public class ParametersMojo extends AbstractMojo {
- public String plain;
- public String withProperty;
+ private String plain;
- public String withDefault;
+ private String withProperty;
- public String withPropertyAndDefault;
+ private String withDefault;
+
+ private String withPropertyAndDefault;
@Override
- public void execute() throws MojoExecutionException, MojoFailureException {
+ public void execute() {
getLog().info("Plain value = " + plain);
}
+
+ public String getPlain() {
+ return plain;
+ }
+
+ public void setPlain(String plain) {
+ this.plain = plain;
+ }
+
+ public String getWithProperty() {
+ return withProperty;
+ }
+
+ public void setWithProperty(String withProperty) {
+ this.withProperty = withProperty;
+ }
+
+ public String getWithDefault() {
+ return withDefault;
+ }
+
+ public void setWithDefault(String withDefault) {
+ this.withDefault = withDefault;
+ }
+
+ public String getWithPropertyAndDefault() {
+ return withPropertyAndDefault;
+ }
+
+ public void setWithPropertyAndDefault(String withPropertyAndDefault) {
+ this.withPropertyAndDefault = withPropertyAndDefault;
+ }
}
diff --git a/maven-plugin-testing-harness/src/test/java/org/apache/maven/plugin/testing/ParametersMojoTest.java b/maven-plugin-testing-harness/src/test/java/org/apache/maven/plugin/testing/ParametersMojoTest.java
index ce7869c0..90cb4df9 100644
--- a/maven-plugin-testing-harness/src/test/java/org/apache/maven/plugin/testing/ParametersMojoTest.java
+++ b/maven-plugin-testing-harness/src/test/java/org/apache/maven/plugin/testing/ParametersMojoTest.java
@@ -36,10 +36,10 @@ public void testDefault() throws Exception {
ParametersMojo mojo = (ParametersMojo) lookupConfiguredMojo(project, "parameters");
- assertNull(mojo.plain);
- assertNull(mojo.withProperty);
- assertEquals("default", mojo.withDefault);
- assertEquals("default", mojo.withPropertyAndDefault);
+ assertNull(mojo.getPlain());
+ assertNull(mojo.getWithProperty());
+ assertEquals("default", mojo.getWithDefault());
+ assertEquals("default", mojo.getWithPropertyAndDefault());
}
public void testExplicit() throws Exception {
@@ -47,10 +47,10 @@ public void testExplicit() throws Exception {
ParametersMojo mojo = (ParametersMojo) lookupConfiguredMojo(project, "parameters");
- assertEquals("explicitValue", mojo.plain);
- assertEquals("explicitWithPropertyValue", mojo.withProperty);
- assertEquals("explicitWithDefaultValue", mojo.withDefault);
- assertEquals("explicitWithPropertyAndDefaultValue", mojo.withPropertyAndDefault);
+ assertEquals("explicitValue", mojo.getPlain());
+ assertEquals("explicitWithPropertyValue", mojo.getWithProperty());
+ assertEquals("explicitWithDefaultValue", mojo.getWithDefault());
+ assertEquals("explicitWithPropertyAndDefaultValue", mojo.getWithPropertyAndDefault());
}
public void testDefaultWithProperty() throws Exception {
@@ -61,10 +61,10 @@ public void testDefaultWithProperty() throws Exception {
session.getUserProperties().put("property", "propertyValue");
ParametersMojo mojo = (ParametersMojo) lookupConfiguredMojo(session, execution);
- assertNull(mojo.plain);
- assertEquals("propertyValue", mojo.withProperty);
- assertEquals("default", mojo.withDefault);
- assertEquals("propertyValue", mojo.withPropertyAndDefault);
+ assertNull(mojo.getPlain());
+ assertEquals("propertyValue", mojo.getWithProperty());
+ assertEquals("default", mojo.getWithDefault());
+ assertEquals("propertyValue", mojo.getWithPropertyAndDefault());
}
public void testExplicitWithProperty() throws Exception {
@@ -75,10 +75,10 @@ public void testExplicitWithProperty() throws Exception {
session.getUserProperties().put("property", "propertyValue");
ParametersMojo mojo = (ParametersMojo) lookupConfiguredMojo(session, execution);
- assertEquals("explicitValue", mojo.plain);
- assertEquals("explicitWithPropertyValue", mojo.withProperty);
- assertEquals("explicitWithDefaultValue", mojo.withDefault);
- assertEquals("explicitWithPropertyAndDefaultValue", mojo.withPropertyAndDefault);
+ assertEquals("explicitValue", mojo.getPlain());
+ assertEquals("explicitWithPropertyValue", mojo.getWithProperty());
+ assertEquals("explicitWithDefaultValue", mojo.getWithDefault());
+ assertEquals("explicitWithPropertyAndDefaultValue", mojo.getWithPropertyAndDefault());
}
protected MavenProject readMavenProject(File basedir) throws ProjectBuildingException, Exception {
diff --git a/maven-plugin-testing-harness/src/test/java/org/apache/maven/plugin/testing/junit5/Junit5Test.java b/maven-plugin-testing-harness/src/test/java/org/apache/maven/plugin/testing/junit5/Junit5Test.java
index 9da00360..caab8f41 100644
--- a/maven-plugin-testing-harness/src/test/java/org/apache/maven/plugin/testing/junit5/Junit5Test.java
+++ b/maven-plugin-testing-harness/src/test/java/org/apache/maven/plugin/testing/junit5/Junit5Test.java
@@ -56,8 +56,8 @@ void simpleMojo(ParametersMojo mojo) {
@MojoParameter(name = "plain", value = "plainValue")
@MojoParameter(name = "withDefault", value = "withDefaultValue")
void simpleMojoWithParameters(ParametersMojo mojo) {
- assertEquals("plainValue", mojo.plain);
- assertEquals("withDefaultValue", mojo.withDefault);
+ assertEquals("plainValue", mojo.getPlain());
+ assertEquals("withDefaultValue", mojo.getWithDefault());
assertDoesNotThrow(mojo::execute);
}
@@ -65,7 +65,7 @@ void simpleMojoWithParameters(ParametersMojo mojo) {
@InjectMojo(goal = "test:test-plugin:0.0.1-SNAPSHOT:parameters", pom = POM)
@MojoParameter(name = "plain", value = "plainValue")
void simpleMojoWithParameter(ParametersMojo mojo) {
- assertEquals("plainValue", mojo.plain);
+ assertEquals("plainValue", mojo.getPlain());
assertDoesNotThrow(mojo::execute);
}
}
diff --git a/maven-plugin-testing-harness/src/test/java/org/apache/maven/plugin/testing/resources/TestResourcesTest.java b/maven-plugin-testing-harness/src/test/java/org/apache/maven/plugin/testing/resources/TestResourcesTest.java
index 8ce1ecbf..98637630 100644
--- a/maven-plugin-testing-harness/src/test/java/org/apache/maven/plugin/testing/resources/TestResourcesTest.java
+++ b/maven-plugin-testing-harness/src/test/java/org/apache/maven/plugin/testing/resources/TestResourcesTest.java
@@ -21,7 +21,8 @@
import org.junit.Test;
public class TestResourcesTest {
- public TestResources resources = new TestResources();
+
+ private final TestResources resources = new TestResources();
@Test(expected = IllegalStateException.class)
public void testNoRuleAnnotation() throws Exception {
diff --git a/pom.xml b/pom.xml
index 14a9a9d9..6a4bfcab 100644
--- a/pom.xml
+++ b/pom.xml
@@ -23,7 +23,7 @@ under the License.
org.apache.maven
maven-parent
- 43
+ 44
@@ -49,8 +49,8 @@ under the License.
https://github.com/apache/maven-plugin-testing/tree/${project.scm.tag}
- jira
- https://issues.apache.org/jira/browse/MPLUGINTESTING
+ GitHub
+ https://github.com/apache/maven-plugin-testing/issues
Jenkins