Skip to content

Commit 4f7af5a

Browse files
Fix after rebase
1 parent 05aad2c commit 4f7af5a

File tree

4 files changed

+31
-31
lines changed

4 files changed

+31
-31
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ target
44
.project
55
.settings
66
.checkstyle
7-
#idea
7+
idea
88
*.iml
99
.idea
1010
.java-version

maven-plugin-testing-harness/src/test/java/org/apache/maven/plugin/testing/ParametersMojoJUnit4Test.java

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -36,21 +36,21 @@ public void testDefault() throws Exception {
3636

3737
ParametersMojo mojo = (ParametersMojo) lookupConfiguredMojo(project, "parameters");
3838

39-
assertNull(mojo.plain);
40-
assertNull(mojo.withProperty);
41-
assertEquals("default", mojo.withDefault);
42-
assertEquals("default", mojo.withPropertyAndDefault);
39+
assertNull(mojo.getPlain());
40+
assertNull(mojo.getWithProperty());
41+
assertEquals("default", mojo.getWithDefault());
42+
assertEquals("default", mojo.getWithPropertyAndDefault());
4343
}
4444

4545
public void testExplicit() throws Exception {
4646
MavenProject project = readMavenProject(new File("src/test/projects/explicit"));
4747

4848
ParametersMojo mojo = (ParametersMojo) lookupConfiguredMojo(project, "parameters");
4949

50-
assertEquals("explicitValue", mojo.plain);
51-
assertEquals("explicitWithPropertyValue", mojo.withProperty);
52-
assertEquals("explicitWithDefaultValue", mojo.withDefault);
53-
assertEquals("explicitWithPropertyAndDefaultValue", mojo.withPropertyAndDefault);
50+
assertEquals("explicitValue", mojo.getPlain());
51+
assertEquals("explicitWithPropertyValue", mojo.getWithProperty());
52+
assertEquals("explicitWithDefaultValue", mojo.getWithDefault());
53+
assertEquals("explicitWithPropertyAndDefaultValue", mojo.getWithPropertyAndDefault());
5454
}
5555

5656
public void testDefaultWithProperty() throws Exception {
@@ -61,10 +61,10 @@ public void testDefaultWithProperty() throws Exception {
6161
session.getUserProperties().put("property", "propertyValue");
6262
ParametersMojo mojo = (ParametersMojo) lookupConfiguredMojo(session, execution);
6363

64-
assertNull(mojo.plain);
65-
assertEquals("propertyValue", mojo.withProperty);
66-
assertEquals("default", mojo.withDefault);
67-
assertEquals("propertyValue", mojo.withPropertyAndDefault);
64+
assertNull(mojo.getPlain());
65+
assertEquals("propertyValue", mojo.getWithProperty());
66+
assertEquals("default", mojo.getWithDefault());
67+
assertEquals("propertyValue", mojo.getWithPropertyAndDefault());
6868
}
6969

7070
public void testExplicitWithProperty() throws Exception {
@@ -75,10 +75,10 @@ public void testExplicitWithProperty() throws Exception {
7575
session.getUserProperties().put("property", "propertyValue");
7676
ParametersMojo mojo = (ParametersMojo) lookupConfiguredMojo(session, execution);
7777

78-
assertEquals("explicitValue", mojo.plain);
79-
assertEquals("explicitWithPropertyValue", mojo.withProperty);
80-
assertEquals("explicitWithDefaultValue", mojo.withDefault);
81-
assertEquals("explicitWithPropertyAndDefaultValue", mojo.withPropertyAndDefault);
78+
assertEquals("explicitValue", mojo.getPlain());
79+
assertEquals("explicitWithPropertyValue", mojo.getWithProperty());
80+
assertEquals("explicitWithDefaultValue", mojo.getWithDefault());
81+
assertEquals("explicitWithPropertyAndDefaultValue", mojo.getWithPropertyAndDefault());
8282
}
8383

8484
protected MavenProject readMavenProject(File basedir) throws ProjectBuildingException, Exception {

maven-plugin-testing-harness/src/test/java/org/apache/maven/plugin/testing/ParametersMojoTest.java

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,20 @@
2020

2121
import javax.inject.Inject;
2222

23-
import org.apache.maven.api.plugin.testing.*;
23+
import org.apache.maven.api.plugin.testing.Basedir;
24+
import org.apache.maven.api.plugin.testing.InjectMojo;
25+
import org.apache.maven.api.plugin.testing.MojoParameter;
2426
import org.apache.maven.api.plugin.testing.MojoParameters;
27+
import org.apache.maven.api.plugin.testing.MojoTest;
2528
import org.apache.maven.plugin.logging.Log;
2629
import org.junit.jupiter.api.Test;
27-
import org.slf4j.Logger;
28-
import org.slf4j.LoggerFactory;
2930

30-
import static org.junit.jupiter.api.Assertions.*;
31+
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
32+
import static org.junit.jupiter.api.Assertions.assertEquals;
3133

3234
@MojoTest
3335
public class ParametersMojoTest {
3436

35-
private static final Logger logger = LoggerFactory.getLogger(ParametersMojoTest.class);
36-
3737
private static final String POM_DOT_XML_FILE = "pom.xml";
3838

3939
private static final String DEFAULT_POM_DIR = "src/test/projects/default/";
@@ -54,7 +54,7 @@ void testDefaultPom(ParametersMojo mojo) {
5454
@Test
5555
@InjectMojo(goal = "test:test-plugin:0.0.1-SNAPSHOT:parameters", pom = EXPLICIT_POM_DIR + POM_DOT_XML_FILE)
5656
void testExplicitPom(ParametersMojo mojo) {
57-
assertEquals("explicitValue", mojo.plain);
57+
assertEquals("explicitValue", mojo.getPlain());
5858
assertDoesNotThrow(mojo::execute);
5959
}
6060

@@ -76,8 +76,8 @@ void simpleMojo(ParametersMojo mojo) {
7676
@MojoParameter(name = "plain", value = "plainValue")
7777
@MojoParameter(name = "withDefault", value = "withDefaultValue")
7878
void simpleMojoWithParameters(ParametersMojo mojo) {
79-
assertEquals("plainValue", mojo.plain);
80-
assertEquals("withDefaultValue", mojo.withDefault);
79+
assertEquals("plainValue", mojo.getPlain());
80+
assertEquals("withDefaultValue", mojo.getWithDefault());
8181
assertDoesNotThrow(mojo::execute);
8282
}
8383

@@ -88,32 +88,32 @@ void simpleMojoWithParameters(ParametersMojo mojo) {
8888
@MojoParameter(name = "withDefault", value = "withDefaultValue")
8989
})
9090
void simpleMojoWithParametersGroupingAnnotation(ParametersMojo mojo) {
91-
assertEquals("plainValue", mojo.plain);
92-
assertEquals("withDefaultValue", mojo.withDefault);
91+
assertEquals("plainValue", mojo.getPlain());
92+
assertEquals("withDefaultValue", mojo.getWithDefault());
9393
assertDoesNotThrow(mojo::execute);
9494
}
9595

9696
@Test
9797
@InjectMojo(goal = "test:test-plugin:0.0.1-SNAPSHOT:parameters", pom = DEFAULT_POM_DIR + POM_DOT_XML_FILE)
9898
@MojoParameter(name = "plain", value = "plainValue")
9999
void simpleMojoWithParameter(ParametersMojo mojo) {
100-
assertEquals("plainValue", mojo.plain);
100+
assertEquals("plainValue", mojo.getPlain());
101101
assertDoesNotThrow(mojo::execute);
102102
}
103103

104104
@Test
105105
@MojoParameter(name = "plain", value = "plainValue")
106106
@InjectMojo(goal = "test:test-plugin:0.0.1-SNAPSHOT:parameters", pom = EXPLICIT_POM_DIR + POM_DOT_XML_FILE)
107107
void simpleMojoWithParameterInjectionWinsOverConfig(ParametersMojo mojo) {
108-
assertEquals("plainValue", mojo.plain);
108+
assertEquals("plainValue", mojo.getPlain());
109109
assertDoesNotThrow(mojo::execute);
110110
}
111111

112112
@Test
113113
@Basedir("src/test/projects/basedir-set-by-annotation")
114114
@InjectMojo(goal = "test:test-plugin:0.0.1-SNAPSHOT:parameters", pom = POM_DOT_XML_FILE)
115115
void basedirInjectedWithBasedirAnnotation(ParametersMojo mojo) {
116-
assertEquals("i-have-a-basedir-set-by-annotation", mojo.plain);
116+
assertEquals("i-have-a-basedir-set-by-annotation", mojo.getPlain());
117117
assertDoesNotThrow(mojo::execute);
118118
}
119119
}

maven-plugin-testing-harness/src/test/java/org/apache/maven/plugin/testing/junit5/Junit5Test.java

Whitespace-only changes.

0 commit comments

Comments
 (0)