]> source.dussan.org Git - archiva.git/commitdiff
improve test
authorOlivier Lamy <olamy@apache.org>
Fri, 1 Jun 2012 23:46:25 +0000 (23:46 +0000)
committerOlivier Lamy <olamy@apache.org>
Fri, 1 Jun 2012 23:46:25 +0000 (23:46 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1345393 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/RepositoriesServiceTest.java

index 13a68befaa17fceb341b257da5c2f9ca2ca59245..111653350a28be06bd60ba51414f2af5cc226aac 100644 (file)
@@ -22,12 +22,15 @@ package org.apache.archiva.rest.services;
 import org.apache.archiva.admin.model.beans.ManagedRepository;
 import org.apache.archiva.common.utils.FileUtil;
 import org.apache.archiva.rest.api.model.Artifact;
+import org.apache.archiva.rest.api.services.BrowseService;
 import org.apache.archiva.rest.api.services.ManagedRepositoriesService;
 import org.apache.archiva.rest.api.services.RepositoriesService;
 import org.apache.cxf.jaxrs.client.ServerWebApplicationException;
+import org.fest.assertions.Assertions;
 import org.junit.Test;
 
 import java.io.File;
+import java.util.List;
 
 /**
  * @author Olivier Lamy
@@ -127,6 +130,16 @@ public class RepositoriesServiceTest
         throws Exception
     {
         initSourceTargetRepo();
+
+        BrowseService browseService = getBrowseService( authorizationHeader, false );
+
+        List<Artifact> artifacts =
+            browseService.getArtifactDownloadInfos( "commons-logging", "commons-logging", "1.0.1", SOURCE_REPO_ID );
+
+        Assertions.assertThat( artifacts ).isNotNull().isNotEmpty().hasSize( 3 );
+
+        log.info( "artifacts.size: {}", artifacts.size() );
+
         try
         {
             File artifactFile =
@@ -147,6 +160,11 @@ public class RepositoriesServiceTest
 
             assertFalse( "artifact not deleted exists:" + artifactFile.getPath(), artifactFile.exists() );
 
+            artifacts =
+                browseService.getArtifactDownloadInfos( "commons-logging", "commons-logging", "1.0.1", SOURCE_REPO_ID );
+
+            Assertions.assertThat( artifacts ).isNotNull().isEmpty();
+
         }
         finally
         {