]> source.dussan.org Git - archiva.git/commitdiff
Moving to new repository content API
authorMartin Stockhammer <martin_s@apache.org>
Tue, 21 Apr 2020 17:34:22 +0000 (19:34 +0200)
committerMartin Stockhammer <martin_s@apache.org>
Tue, 21 Apr 2020 17:34:22 +0000 (19:34 +0200)
archiva-modules/archiva-maven/archiva-maven-repository/src/test/java/org/apache/archiva/repository/maven/content/ManagedDefaultRepositoryContentTest.java

index 7587be30d129234e3bc3afb18fb9a6c4437ea608..05e45f99a23752d76dbd850b87e9f9d350c6207d 100644 (file)
@@ -44,6 +44,7 @@ import org.apache.archiva.repository.maven.MavenManagedRepository;
 import org.apache.archiva.repository.maven.metadata.storage.ArtifactMappingProvider;
 import org.apache.archiva.repository.storage.StorageAsset;
 import org.apache.commons.io.FileUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.junit.Before;
 import org.junit.Test;
 
@@ -182,34 +183,15 @@ public class ManagedDefaultRepositoryContentTest
     private void assertVersions( String artifactId, String version, String[] expectedVersions )
         throws Exception
     {
-        VersionedReference reference = new VersionedReference();
-        reference.setGroupId( "org.apache.archiva.metadata.tests" );
-        reference.setArtifactId( artifactId );
-        reference.setVersion( version );
-
         // Use the test metadata-repository, which is already setup for
         // These kind of version tests.
         Path repoDir = getRepositoryPath( "metadata-repository" );
         ((EditableManagedRepository)repoContent.getRepository()).setLocation( repoDir.toAbsolutePath().toUri() );
 
         // Request the versions.
-        Set<String> testedVersionSet = repoContent.getVersions( reference );
 
         // Sort the list (for asserts later)
         final VersionComparator comparator = new VersionComparator( );
-        List<String> testedVersions = new ArrayList<>();
-        testedVersions.addAll( testedVersionSet );
-        Collections.sort( testedVersions, comparator );
-
-        // Test the expected array of versions, to the actual tested versions
-        assertEquals( "Assert Versions: length/size", expectedVersions.length, testedVersions.size() );
-
-        for ( int i = 0; i < expectedVersions.length; i++ )
-        {
-            String actualVersion = testedVersions.get( i );
-            assertEquals( "Versions[" + i + "]", expectedVersions[i], actualVersion );
-        }
-
 
         ItemSelector selector = ArchivaItemSelector.builder( )
             .withNamespace( "org.apache.archiva.metadata.tests" )