]> source.dussan.org Git - archiva.git/commitdiff
fix unit tests
authorOlivier Lamy <olamy@apache.org>
Wed, 13 Jun 2012 12:15:50 +0000 (12:15 +0000)
committerOlivier Lamy <olamy@apache.org>
Wed, 13 Jun 2012 12:15:50 +0000 (12:15 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1349786 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/utils/ArtifactDownloadInfoBuilder.java
archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/archiva/web/action/ShowArtifactActionTest.java

index e90c1bd1417a30e5052c3605ee45663cee3d193e..8f9f1e1bed6c78b3c92e0d2b2e3311ba6529e74a 100644 (file)
@@ -62,7 +62,7 @@ public class ArtifactDownloadInfoBuilder
     public Artifact build()
     {
         ArtifactReference ref = new ArtifactReference();
-        ref.setArtifactId( artifactMetadata.getProject() );
+        ref.setArtifactId( artifactMetadata.getId() );
         ref.setGroupId( artifactMetadata.getNamespace() );
         ref.setVersion( artifactMetadata.getVersion() );
 
@@ -82,6 +82,7 @@ public class ArtifactDownloadInfoBuilder
         String extension = FilenameUtils.getExtension( file.getName() );
 
         Artifact artifact = new Artifact( ref.getGroupId(), ref.getArtifactId(), ref.getVersion() );
+        artifact.setRepositoryId( artifactMetadata.getRepositoryId() );
         artifact.setClassifier( classifier );
         artifact.setPackaging( type );
         artifact.setFileExtension( extension );
index 108d9dcb8d423aa3dfeeee988d7ef58f53b6b4d9..00814525d3705d98a39093b5f9468f0dc6cdbb9c 100644 (file)
@@ -567,7 +567,8 @@ public class ShowArtifactActionTest
             Artifact actual = list.get( 0 );
             assertEquals( artifact.getNamespace(), actual.getGroupId() );
             assertEquals( artifact.getId(), actual.getArtifactId() );
-            assertEquals( artifact.getProject(), actual.getGroupId() );
+            // olamy test has no more sense as we reuse an other object now
+            //assertEquals( artifact.getProject(), actual.getGroupId() );
             assertEquals( artifact.getRepositoryId(), actual.getRepositoryId() );
             assertEquals( artifact.getVersion(), actual.getVersion() );
             assertEquals( TEST_TYPE, actual.getPackaging() );