From 404d6882607134cf0dca8d328718f9a41db04d37 Mon Sep 17 00:00:00 2001 From: Martin Stockhammer Date: Tue, 21 Apr 2020 19:34:22 +0200 Subject: [PATCH] Moving to new repository content API --- .../ManagedDefaultRepositoryContentTest.java | 20 +------------------ 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/archiva-modules/archiva-maven/archiva-maven-repository/src/test/java/org/apache/archiva/repository/maven/content/ManagedDefaultRepositoryContentTest.java b/archiva-modules/archiva-maven/archiva-maven-repository/src/test/java/org/apache/archiva/repository/maven/content/ManagedDefaultRepositoryContentTest.java index 7587be30d..05e45f99a 100644 --- a/archiva-modules/archiva-maven/archiva-maven-repository/src/test/java/org/apache/archiva/repository/maven/content/ManagedDefaultRepositoryContentTest.java +++ b/archiva-modules/archiva-maven/archiva-maven-repository/src/test/java/org/apache/archiva/repository/maven/content/ManagedDefaultRepositoryContentTest.java @@ -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 testedVersionSet = repoContent.getVersions( reference ); // Sort the list (for asserts later) final VersionComparator comparator = new VersionComparator( ); - List 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" ) -- 2.39.5