sparsick commented on code in PR #579:
URL: https://github.com/apache/maven-war-plugin/pull/579#discussion_r2560579668
##########
src/test/java/org/apache/maven/plugins/war/WarExplodedMojoFilteringTest.java:
##########
@@ -37,47 +37,63 @@
* under the License.
*/
+import org.apache.maven.api.di.Provides;
+import org.apache.maven.api.plugin.testing.InjectMojo;
+import org.apache.maven.api.plugin.testing.MojoTest;
+import org.apache.maven.execution.MavenSession;
+import org.apache.maven.plugins.war.stub.MavenProjectBasicStub;
+import org.apache.maven.plugins.war.stub.ResourceStub;
+import org.codehaus.plexus.util.FileUtils;
+import org.junit.jupiter.api.Test;
+
+import javax.inject.Inject;
import java.io.BufferedReader;
import java.io.File;
import java.io.StringReader;
-import java.util.LinkedList;
+import java.util.ArrayList;
import java.util.List;
+import java.util.Properties;
-import org.apache.maven.execution.MavenSession;
-import org.apache.maven.plugins.war.stub.MavenProjectBasicStub;
-import org.apache.maven.plugins.war.stub.ResourceStub;
-import org.codehaus.plexus.util.FileUtils;
+import static org.apache.maven.api.plugin.testing.MojoExtension.getBasedir;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.mockito.Mockito.when;
/**
* @author Olivier Lamy
* @since 21 juil. 2008
*/
-public class WarExplodedMojoFilteringTest extends AbstractWarExplodedMojoTest {
+@MojoTest
+public class WarExplodedMojoFilteringTest {
- protected File getPomFile() {
- return new File(getBasedir(),
"/target/test-classes/unit/warexplodedmojo/plugin-config.xml");
- }
+ @Inject
Review Comment:
in this case, I found out, that I can put a simple String and is convert to
a List with a single element
##########
src/test/java/org/apache/maven/plugins/war/WarExplodedMojoFilteringTest.java:
##########
@@ -37,47 +37,63 @@
* under the License.
*/
+import org.apache.maven.api.di.Provides;
+import org.apache.maven.api.plugin.testing.InjectMojo;
+import org.apache.maven.api.plugin.testing.MojoTest;
+import org.apache.maven.execution.MavenSession;
+import org.apache.maven.plugins.war.stub.MavenProjectBasicStub;
+import org.apache.maven.plugins.war.stub.ResourceStub;
+import org.codehaus.plexus.util.FileUtils;
+import org.junit.jupiter.api.Test;
+
+import javax.inject.Inject;
import java.io.BufferedReader;
import java.io.File;
import java.io.StringReader;
-import java.util.LinkedList;
+import java.util.ArrayList;
import java.util.List;
+import java.util.Properties;
-import org.apache.maven.execution.MavenSession;
-import org.apache.maven.plugins.war.stub.MavenProjectBasicStub;
-import org.apache.maven.plugins.war.stub.ResourceStub;
-import org.codehaus.plexus.util.FileUtils;
+import static org.apache.maven.api.plugin.testing.MojoExtension.getBasedir;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.mockito.Mockito.when;
/**
* @author Olivier Lamy
* @since 21 juil. 2008
*/
-public class WarExplodedMojoFilteringTest extends AbstractWarExplodedMojoTest {
+@MojoTest
+public class WarExplodedMojoFilteringTest {
- protected File getPomFile() {
- return new File(getBasedir(),
"/target/test-classes/unit/warexplodedmojo/plugin-config.xml");
- }
+ @Inject
Review Comment:
in this case, I found out, that I can put a simple String and is convert to
a List with a single element via MojoParameter
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]