You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by GitBox <gi...@apache.org> on 2020/12/21 04:10:29 UTC

[GitHub] [maven-ear-plugin] mabrarov commented on a change in pull request #32: remove deprecated methods by not stubbing value objects

mabrarov commented on a change in pull request #32:
URL: https://github.com/apache/maven-ear-plugin/pull/32#discussion_r546499679



##########
File path: src/test/java/org/apache/maven/plugins/ear/AbstractEarTestBase.java
##########
@@ -33,88 +35,42 @@
 
     public static final String DEFAULT_GROUPID = "eartest";
 
-    public static final String DEFAULT_TYPE = "jar";
+    private static final String DEFAULT_TYPE = "jar";
 
     protected void setUri( EarModule module, String uri )
     {
         ( (AbstractEarModule) module ).setUri( uri );
     }
 
-    protected Set<Artifact> createArtifacts( String[] artifactsId )
+    protected Set<Artifact> createArtifacts( String[] artifactIds )
     {
-        return createArtifacts( artifactsId, null );
+        return createArtifacts( artifactIds, null );
     }
 
-    protected Set<Artifact> createArtifacts( String[] artifactsId, String[] types )
-    {
-        return createArtifacts( artifactsId, types, null );
-    }
-
-    protected Set<Artifact> createArtifacts( String[] artifactsId, String[] types, String[] groupsId )
-    {
-        return createArtifacts( artifactsId, types, groupsId, null );
-    }
-
-    protected Set<Artifact> createArtifacts( String[] artifactsId, String[] types, String[] groupsId,
-                                             String[] classifiers )
+    protected Set<Artifact> createArtifacts( String[] artifactIds, String[] classifiers )
     {
         Set<Artifact> result = new TreeSet<Artifact>();
-        if ( artifactsId == null || artifactsId.length == 0 )
-        {
-            return result;
-        }
-        for ( int i = 0; i < artifactsId.length; i++ )
+        ArtifactHandlerTestStub artifactHandler = new ArtifactHandlerTestStub( "jar" );
+        for ( int i = 0; i < artifactIds.length; i++ )
         {
-            String artifactId = artifactsId[i];
-            String type = getData( types, i, DEFAULT_TYPE );
-            String groupId = getData( groupsId, i, DEFAULT_GROUPID );
-            String classifier = getData( classifiers, i, null );
-            result.add( new ArtifactTestStub( groupId, artifactId, type, classifier ) );
+            String artifactId = artifactIds[i];
+            String classifier = classifiers == null ? null : classifiers[i];
+            Artifact artifactTestStub = new DefaultArtifact(
+                DEFAULT_GROUPID, artifactId, "1.0", "compile", DEFAULT_TYPE, classifier, artifactHandler );
+            

Review comment:
       It looks like there are trailing spaces in this line.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org