fix unit test

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1340498 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Olivier Lamy 2012-05-19 15:11:11 +00:00
parent 3edace49c7
commit 206de319f7
1 changed files with 4 additions and 3 deletions

View File

@ -29,6 +29,7 @@ import org.apache.archiva.metadata.model.ProjectVersionMetadata;
import org.apache.archiva.metadata.model.ProjectVersionReference; import org.apache.archiva.metadata.model.ProjectVersionReference;
import org.apache.archiva.metadata.repository.MetadataRepository; import org.apache.archiva.metadata.repository.MetadataRepository;
import org.apache.archiva.metadata.repository.RepositorySession; import org.apache.archiva.metadata.repository.RepositorySession;
import org.apache.archiva.rest.api.model.ArtifactDownloadInfo;
import org.apache.archiva.webtest.memory.TestMetadataResolver; import org.apache.archiva.webtest.memory.TestMetadataResolver;
import org.apache.archiva.webtest.memory.TestRepositorySessionFactory; import org.apache.archiva.webtest.memory.TestRepositorySessionFactory;
import org.apache.archiva.metadata.repository.storage.maven2.MavenArtifactFacet; import org.apache.archiva.metadata.repository.storage.maven2.MavenArtifactFacet;
@ -555,15 +556,15 @@ public class ShowArtifactActionTest
} }
private void assertArtifacts( List<ArtifactMetadata> expectedArtifacts, private void assertArtifacts( List<ArtifactMetadata> expectedArtifacts,
Map<String, List<ShowArtifactAction.ArtifactDownloadInfo>> artifactMap ) Map<String, List<ArtifactDownloadInfo>> artifactMap )
{ {
// assuming only one of each version at this point // assuming only one of each version at this point
assertEquals( expectedArtifacts.size(), artifactMap.size() ); assertEquals( expectedArtifacts.size(), artifactMap.size() );
for ( ArtifactMetadata artifact : expectedArtifacts ) for ( ArtifactMetadata artifact : expectedArtifacts )
{ {
assertTrue( artifactMap.containsKey( artifact.getVersion() ) ); assertTrue( artifactMap.containsKey( artifact.getVersion() ) );
List<ShowArtifactAction.ArtifactDownloadInfo> list = artifactMap.get( artifact.getVersion() ); List<ArtifactDownloadInfo> list = artifactMap.get( artifact.getVersion() );
ShowArtifactAction.ArtifactDownloadInfo actual = list.get( 0 ); ArtifactDownloadInfo actual = list.get( 0 );
assertEquals( artifact.getNamespace(), actual.getNamespace() ); assertEquals( artifact.getNamespace(), actual.getNamespace() );
assertEquals( artifact.getId(), actual.getId() ); assertEquals( artifact.getId(), actual.getId() );
assertEquals( artifact.getProject(), actual.getProject() ); assertEquals( artifact.getProject(), actual.getProject() );