diff options
author | Martin Stockhammer <martin_s@apache.org> | 2020-06-07 14:42:43 +0200 |
---|---|---|
committer | Martin Stockhammer <martin_s@apache.org> | 2020-06-07 14:42:43 +0200 |
commit | bca678b5c03345808016c38d65e1b9b8993c6523 (patch) | |
tree | 18ba241a33581ad9550cebde77e81ff84ed59eb5 /archiva-modules/archiva-maven/archiva-maven-proxy | |
parent | dda90e3302715b65f0d0908e1997e7aaf32b6242 (diff) | |
download | archiva-bca678b5c03345808016c38d65e1b9b8993c6523.tar.gz archiva-bca678b5c03345808016c38d65e1b9b8993c6523.zip |
Changing tests for proxy API
Diffstat (limited to 'archiva-modules/archiva-maven/archiva-maven-proxy')
6 files changed, 48 insertions, 44 deletions
diff --git a/archiva-modules/archiva-maven/archiva-maven-proxy/src/test/java/org/apache/archiva/proxy/CacheFailuresTransferTest.java b/archiva-modules/archiva-maven/archiva-maven-proxy/src/test/java/org/apache/archiva/proxy/CacheFailuresTransferTest.java index 4f6019336..b2fdf14a6 100644 --- a/archiva-modules/archiva-maven/archiva-maven-proxy/src/test/java/org/apache/archiva/proxy/CacheFailuresTransferTest.java +++ b/archiva-modules/archiva-maven/archiva-maven-proxy/src/test/java/org/apache/archiva/proxy/CacheFailuresTransferTest.java @@ -157,7 +157,7 @@ public class CacheFailuresTransferTest setupTestableManagedRepository( path ); Path expectedFile = managedDefaultDir.resolve( path ); BaseRepositoryContentLayout layout = managedDefaultRepository.getLayout( BaseRepositoryContentLayout.class ); - ArtifactReference artifact = managedDefaultRepository.toArtifactReference( path ); + Artifact artifact = layout.getArtifact( path ); Files.deleteIfExists( expectedFile ); assertFalse( Files.exists( expectedFile ) ); diff --git a/archiva-modules/archiva-maven/archiva-maven-proxy/src/test/java/org/apache/archiva/proxy/ChecksumTransferTest.java b/archiva-modules/archiva-maven/archiva-maven-proxy/src/test/java/org/apache/archiva/proxy/ChecksumTransferTest.java index 8a32ac08d..a0d08bbd0 100644 --- a/archiva-modules/archiva-maven/archiva-maven-proxy/src/test/java/org/apache/archiva/proxy/ChecksumTransferTest.java +++ b/archiva-modules/archiva-maven/archiva-maven-proxy/src/test/java/org/apache/archiva/proxy/ChecksumTransferTest.java @@ -26,6 +26,7 @@ import org.apache.archiva.policies.ChecksumPolicy; import org.apache.archiva.policies.ReleasesPolicy; import org.apache.archiva.policies.SnapshotsPolicy; import org.apache.archiva.repository.BaseRepositoryContentLayout; +import org.apache.archiva.repository.content.Artifact; import org.apache.archiva.repository.storage.StorageAsset; import org.apache.maven.wagon.ResourceDoesNotExistException; import org.easymock.EasyMock; @@ -56,7 +57,7 @@ public class ChecksumTransferTest Path expectedFile = managedDefaultDir.resolve( path ); BaseRepositoryContentLayout layout = managedDefaultRepository.getLayout( BaseRepositoryContentLayout.class ); - ArtifactReference artifact = managedDefaultRepository.toArtifactReference( path ); + Artifact artifact = layout.getArtifact( path ); org.apache.archiva.common.utils.FileUtils.deleteDirectory( expectedFile.getParent( ) ); assertFalse( Files.exists( expectedFile ) ); @@ -79,7 +80,7 @@ public class ChecksumTransferTest Path expectedFile = managedDefaultDir.resolve( path ); BaseRepositoryContentLayout layout = managedDefaultRepository.getLayout( BaseRepositoryContentLayout.class ); - ArtifactReference artifact = managedDefaultRepository.toArtifactReference( path ); + Artifact artifact = layout.getArtifact( path ); org.apache.archiva.common.utils.FileUtils.deleteDirectory( expectedFile.getParent( ) ); assertFalse( Files.exists( expectedFile ) ); @@ -106,7 +107,7 @@ public class ChecksumTransferTest Path expectedFile = managedDefaultDir.resolve( path ); BaseRepositoryContentLayout layout = managedDefaultRepository.getLayout( BaseRepositoryContentLayout.class ); - ArtifactReference artifact = managedDefaultRepository.toArtifactReference( path ); + Artifact artifact = layout.getArtifact( path ); FileUtils.deleteDirectory( expectedFile.getParent( ) ); assertFalse( Files.exists( expectedFile ) ); @@ -133,7 +134,7 @@ public class ChecksumTransferTest Path expectedFile = managedDefaultDir.resolve( path ); BaseRepositoryContentLayout layout = managedDefaultRepository.getLayout( BaseRepositoryContentLayout.class ); - ArtifactReference artifact = managedDefaultRepository.toArtifactReference( path ); + Artifact artifact = layout.getArtifact( path ); FileUtils.deleteDirectory( expectedFile.getParent( ) ); assertFalse( Files.exists( expectedFile ) ); @@ -159,7 +160,7 @@ public class ChecksumTransferTest Path expectedFile = managedDefaultDir.resolve( path ); BaseRepositoryContentLayout layout = managedDefaultRepository.getLayout( BaseRepositoryContentLayout.class ); - ArtifactReference artifact = managedDefaultRepository.toArtifactReference( path ); + Artifact artifact = layout.getArtifact( path ); FileUtils.deleteDirectory( expectedFile.getParent( ) ); assertFalse( Files.exists( expectedFile ) ); @@ -185,7 +186,7 @@ public class ChecksumTransferTest Path expectedFile = managedDefaultDir.resolve( path ); BaseRepositoryContentLayout layout = managedDefaultRepository.getLayout( BaseRepositoryContentLayout.class ); - ArtifactReference artifact = managedDefaultRepository.toArtifactReference( path ); + Artifact artifact = layout.getArtifact( path ); FileUtils.deleteDirectory( expectedFile.getParent( ) ); assertFalse( Files.exists( expectedFile ) ); @@ -211,7 +212,7 @@ public class ChecksumTransferTest Path expectedFile = managedDefaultDir.resolve( path ); BaseRepositoryContentLayout layout = managedDefaultRepository.getLayout( BaseRepositoryContentLayout.class ); - ArtifactReference artifact = managedDefaultRepository.toArtifactReference( path ); + Artifact artifact = layout.getArtifact( path ); FileUtils.deleteDirectory( expectedFile.getParent( ) ); assertFalse( Files.exists( expectedFile ) ); @@ -235,7 +236,7 @@ public class ChecksumTransferTest Path expectedFile = managedDefaultDir.resolve( path ); BaseRepositoryContentLayout layout = managedDefaultRepository.getLayout( BaseRepositoryContentLayout.class ); - ArtifactReference artifact = managedDefaultRepository.toArtifactReference( path ); + Artifact artifact = layout.getArtifact( path ); FileUtils.deleteDirectory( expectedFile.getParent( ) ); assertFalse( Files.exists( expectedFile ) ); @@ -262,7 +263,7 @@ public class ChecksumTransferTest Path expectedFile = managedDefaultDir.resolve( path ); BaseRepositoryContentLayout layout = managedDefaultRepository.getLayout( BaseRepositoryContentLayout.class ); - ArtifactReference artifact = managedDefaultRepository.toArtifactReference( path ); + Artifact artifact = layout.getArtifact( path ); FileUtils.deleteDirectory( expectedFile.getParent( ) ); assertFalse( Files.exists( expectedFile ) ); @@ -286,7 +287,7 @@ public class ChecksumTransferTest Path expectedFile = managedDefaultDir.resolve( path ); BaseRepositoryContentLayout layout = managedDefaultRepository.getLayout( BaseRepositoryContentLayout.class ); - ArtifactReference artifact = managedDefaultRepository.toArtifactReference( path ); + Artifact artifact = layout.getArtifact( path ); FileUtils.deleteDirectory( expectedFile.getParent( ) ); assertFalse( Files.exists( expectedFile ) ); @@ -313,7 +314,7 @@ public class ChecksumTransferTest Path expectedFile = managedDefaultDir.resolve( path ); BaseRepositoryContentLayout layout = managedDefaultRepository.getLayout( BaseRepositoryContentLayout.class ); - ArtifactReference artifact = managedDefaultRepository.toArtifactReference( path ); + Artifact artifact = layout.getArtifact( path ); FileUtils.deleteDirectory( expectedFile.getParent( ) ); assertFalse( Files.exists( expectedFile ) ); @@ -337,7 +338,7 @@ public class ChecksumTransferTest Path expectedFile = managedDefaultDir.resolve( path ); BaseRepositoryContentLayout layout = managedDefaultRepository.getLayout( BaseRepositoryContentLayout.class ); - ArtifactReference artifact = managedDefaultRepository.toArtifactReference( path ); + Artifact artifact = layout.getArtifact( path ); FileUtils.deleteDirectory( expectedFile.getParent( ) ); assertFalse( Files.exists( expectedFile ) ); @@ -364,7 +365,7 @@ public class ChecksumTransferTest Path expectedFile = managedDefaultDir.resolve( path ); BaseRepositoryContentLayout layout = managedDefaultRepository.getLayout( BaseRepositoryContentLayout.class ); - ArtifactReference artifact = managedDefaultRepository.toArtifactReference( path ); + Artifact artifact = layout.getArtifact( path ); FileUtils.deleteDirectory( expectedFile.getParent( ) ); assertFalse( Files.exists( expectedFile ) ); @@ -392,7 +393,7 @@ public class ChecksumTransferTest Path expectedFile = managedDefaultDir.resolve( path ); BaseRepositoryContentLayout layout = managedDefaultRepository.getLayout( BaseRepositoryContentLayout.class ); - ArtifactReference artifact = managedDefaultRepository.toArtifactReference( path ); + Artifact artifact = layout.getArtifact( path ); FileUtils.deleteDirectory( expectedFile.getParent( ) ); assertFalse( Files.exists( expectedFile ) ); @@ -419,7 +420,7 @@ public class ChecksumTransferTest Path expectedFile = managedDefaultDir.resolve( path ); BaseRepositoryContentLayout layout = managedDefaultRepository.getLayout( BaseRepositoryContentLayout.class ); - ArtifactReference artifact = managedDefaultRepository.toArtifactReference( path ); + Artifact artifact = layout.getArtifact( path ); FileUtils.deleteDirectory( expectedFile.getParent( ) ); assertFalse( Files.exists( expectedFile ) ); @@ -446,7 +447,7 @@ public class ChecksumTransferTest Path expectedFile = managedDefaultDir.resolve( path ); BaseRepositoryContentLayout layout = managedDefaultRepository.getLayout( BaseRepositoryContentLayout.class ); - ArtifactReference artifact = managedDefaultRepository.toArtifactReference( path ); + Artifact artifact = layout.getArtifact( path ); FileUtils.deleteDirectory( expectedFile.getParent( ) ); assertFalse( Files.exists( expectedFile.getParent( ) ) ); @@ -501,7 +502,7 @@ public class ChecksumTransferTest setManagedOlderThanRemote( expectedFile, remoteFile ); BaseRepositoryContentLayout layout = managedDefaultRepository.getLayout( BaseRepositoryContentLayout.class ); - ArtifactReference artifact = managedDefaultRepository.toArtifactReference( path ); + Artifact artifact = layout.getArtifact( path ); // Configure Connector (usually done within archiva.xml configuration) saveConnector( ID_DEFAULT_MANAGED, "proxied1", ChecksumPolicy.IGNORE, ReleasesPolicy.ALWAYS, @@ -529,7 +530,7 @@ public class ChecksumTransferTest setManagedOlderThanRemote( expectedFile, remoteFile ); BaseRepositoryContentLayout layout = managedDefaultRepository.getLayout( BaseRepositoryContentLayout.class ); - ArtifactReference artifact = managedDefaultRepository.toArtifactReference( path ); + Artifact artifact = layout.getArtifact( path ); // Configure Connector (usually done within archiva.xml configuration) saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FAIL, ReleasesPolicy.ALWAYS, @@ -558,7 +559,7 @@ public class ChecksumTransferTest setManagedOlderThanRemote( expectedFile, remoteFile ); BaseRepositoryContentLayout layout = managedDefaultRepository.getLayout( BaseRepositoryContentLayout.class ); - ArtifactReference artifact = managedDefaultRepository.toArtifactReference( path ); + Artifact artifact = layout.getArtifact( path ); // Configure Connector (usually done within archiva.xml configuration) saveConnector( ID_DEFAULT_MANAGED, "proxied1", ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS, diff --git a/archiva-modules/archiva-maven/archiva-maven-proxy/src/test/java/org/apache/archiva/proxy/ErrorHandlingTest.java b/archiva-modules/archiva-maven/archiva-maven-proxy/src/test/java/org/apache/archiva/proxy/ErrorHandlingTest.java index baccc1717..6840328f9 100644 --- a/archiva-modules/archiva-maven/archiva-maven-proxy/src/test/java/org/apache/archiva/proxy/ErrorHandlingTest.java +++ b/archiva-modules/archiva-maven/archiva-maven-proxy/src/test/java/org/apache/archiva/proxy/ErrorHandlingTest.java @@ -22,6 +22,7 @@ package org.apache.archiva.proxy; import org.apache.archiva.policies.*; import org.apache.archiva.repository.BaseRepositoryContentLayout; import org.apache.archiva.repository.LayoutException; +import org.apache.archiva.repository.content.Artifact; import org.apache.archiva.repository.storage.StorageAsset; import org.apache.maven.wagon.ResourceDoesNotExistException; import org.apache.maven.wagon.TransferFailedException; @@ -599,7 +600,7 @@ public class ErrorHandlingTest { BaseRepositoryContentLayout layout = managedDefaultRepository.getLayout( BaseRepositoryContentLayout.class ); downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository.getRepository(), - managedDefaultRepository.toArtifactReference( path ) ); + layout.getArtifact( path ) ); fail( "Proxy should not have succeeded" ); } catch ( ProxyDownloadException e ) @@ -642,7 +643,7 @@ public class ErrorHandlingTest BaseRepositoryContentLayout layout = managedDefaultRepository.getLayout( BaseRepositoryContentLayout.class ); StorageAsset downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository.getRepository(), - managedDefaultRepository.toArtifactReference( path ) ); + layout.getArtifact( path ) ); wagonMockControl.verify(); return downloadedFile; diff --git a/archiva-modules/archiva-maven/archiva-maven-proxy/src/test/java/org/apache/archiva/proxy/HttpProxyTransferTest.java b/archiva-modules/archiva-maven/archiva-maven-proxy/src/test/java/org/apache/archiva/proxy/HttpProxyTransferTest.java index 2189614f9..19eb0812c 100644 --- a/archiva-modules/archiva-maven/archiva-maven-proxy/src/test/java/org/apache/archiva/proxy/HttpProxyTransferTest.java +++ b/archiva-modules/archiva-maven/archiva-maven-proxy/src/test/java/org/apache/archiva/proxy/HttpProxyTransferTest.java @@ -33,6 +33,7 @@ import org.apache.archiva.policies.SnapshotsPolicy; import org.apache.archiva.proxy.model.RepositoryProxyHandler; import org.apache.archiva.repository.*; import org.apache.archiva.repository.base.BasicManagedRepository; +import org.apache.archiva.repository.content.Artifact; import org.apache.archiva.repository.storage.StorageAsset; import org.apache.archiva.test.utils.ArchivaSpringJUnit4ClassRunner; import org.apache.commons.io.FileUtils; @@ -222,7 +223,7 @@ public class HttpProxyTransferTest BaseRepositoryContentLayout layout = managedDefaultRepository.getLayout( BaseRepositoryContentLayout.class ); Path expectedFile = managedDefaultRepository.getRepository().getRoot().resolve( path ).getFilePath(); Files.deleteIfExists( expectedFile ); - ArtifactReference artifact = managedDefaultRepository.toArtifactReference( path ); + Artifact artifact = layout.getArtifact( path ); // Attempt the proxy fetch. StorageAsset downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository.getRepository(), artifact ); diff --git a/archiva-modules/archiva-maven/archiva-maven-proxy/src/test/java/org/apache/archiva/proxy/ManagedDefaultTransferTest.java b/archiva-modules/archiva-maven/archiva-maven-proxy/src/test/java/org/apache/archiva/proxy/ManagedDefaultTransferTest.java index a4025894b..36026da78 100644 --- a/archiva-modules/archiva-maven/archiva-maven-proxy/src/test/java/org/apache/archiva/proxy/ManagedDefaultTransferTest.java +++ b/archiva-modules/archiva-maven/archiva-maven-proxy/src/test/java/org/apache/archiva/proxy/ManagedDefaultTransferTest.java @@ -25,6 +25,7 @@ import org.apache.archiva.policies.ChecksumPolicy; import org.apache.archiva.policies.ReleasesPolicy; import org.apache.archiva.policies.SnapshotsPolicy; import org.apache.archiva.repository.BaseRepositoryContentLayout; +import org.apache.archiva.repository.content.Artifact; import org.apache.archiva.repository.storage.StorageAsset; import org.apache.commons.io.FileUtils; import org.apache.commons.lang3.StringUtils; @@ -59,7 +60,7 @@ public class ManagedDefaultTransferTest BaseRepositoryContentLayout layout = managedDefaultRepository.getLayout( BaseRepositoryContentLayout.class ); - ArtifactReference artifact = managedDefaultRepository.toArtifactReference( path ); + Artifact artifact = layout.getArtifact( path ); // Ensure file isn't present first. assertNotExistsInManagedDefaultRepo( expectedFile ); @@ -84,7 +85,7 @@ public class ManagedDefaultTransferTest BaseRepositoryContentLayout layout = managedDefaultRepository.getLayout( BaseRepositoryContentLayout.class ); - ArtifactReference artifact = managedDefaultRepository.toArtifactReference( path ); + Artifact artifact = layout.getArtifact( path ); // Ensure file isn't present first. assertNotExistsInManagedDefaultRepo( expectedFile ); @@ -147,7 +148,7 @@ public class ManagedDefaultTransferTest BaseRepositoryContentLayout layout = managedDefaultRepository.getLayout( BaseRepositoryContentLayout.class ); - ArtifactReference artifact = managedDefaultRepository.toArtifactReference( path ); + Artifact artifact = layout.getArtifact( path ); assertTrue( Files.exists(expectedFile) ); @@ -230,7 +231,7 @@ public class ManagedDefaultTransferTest BaseRepositoryContentLayout layout = managedDefaultRepository.getLayout( BaseRepositoryContentLayout.class ); - ArtifactReference artifact = managedDefaultRepository.toArtifactReference( path ); + Artifact artifact = layout.getArtifact( path ); assertTrue( Files.exists(expectedFile) ); @@ -277,7 +278,7 @@ public class ManagedDefaultTransferTest BaseRepositoryContentLayout layout = managedDefaultRepository.getLayout( BaseRepositoryContentLayout.class ); - ArtifactReference artifact = managedDefaultRepository.toArtifactReference( path ); + Artifact artifact = layout.getArtifact( path ); assertTrue( Files.exists(expectedFile) ); @@ -311,7 +312,7 @@ public class ManagedDefaultTransferTest BaseRepositoryContentLayout layout = managedDefaultRepository.getLayout( BaseRepositoryContentLayout.class ); - ArtifactReference artifact = managedDefaultRepository.toArtifactReference( path ); + Artifact artifact = layout.getArtifact( path ); assertTrue( Files.exists(expectedFile) ); Files.setLastModifiedTime( expectedFile, FileTime.from(getPastDate().getTime(), TimeUnit.MILLISECONDS )); @@ -339,7 +340,7 @@ public class ManagedDefaultTransferTest BaseRepositoryContentLayout layout = managedDefaultRepository.getLayout( BaseRepositoryContentLayout.class ); - ArtifactReference artifact = managedDefaultRepository.toArtifactReference( path ); + Artifact artifact = layout.getArtifact( path ); assertNotExistsInManagedDefaultRepo( expectedFile ); @@ -373,7 +374,7 @@ public class ManagedDefaultTransferTest BaseRepositoryContentLayout layout = managedDefaultRepository.getLayout( BaseRepositoryContentLayout.class ); - ArtifactReference artifact = managedDefaultRepository.toArtifactReference( path ); + Artifact artifact = layout.getArtifact( path ); assertNotExistsInManagedDefaultRepo( expectedFile ); @@ -400,7 +401,7 @@ public class ManagedDefaultTransferTest BaseRepositoryContentLayout layout = managedDefaultRepository.getLayout( BaseRepositoryContentLayout.class ); - ArtifactReference artifact = managedDefaultRepository.toArtifactReference( path ); + Artifact artifact = layout.getArtifact( path ); assertNotExistsInManagedDefaultRepo( expectedFile ); @@ -427,7 +428,7 @@ public class ManagedDefaultTransferTest BaseRepositoryContentLayout layout = managedDefaultRepository.getLayout( BaseRepositoryContentLayout.class ); - ArtifactReference artifact = managedDefaultRepository.toArtifactReference( path ); + Artifact artifact = layout.getArtifact( path ); assertNotExistsInManagedDefaultRepo( expectedFile ); @@ -464,7 +465,7 @@ public class ManagedDefaultTransferTest BaseRepositoryContentLayout layout = managedDefaultRepository.getLayout( BaseRepositoryContentLayout.class ); - ArtifactReference artifact = managedDefaultRepository.toArtifactReference( path ); + Artifact artifact = layout.getArtifact( path ); assertNotExistsInManagedDefaultRepo( expectedFile ); diff --git a/archiva-modules/archiva-maven/archiva-maven-proxy/src/test/java/org/apache/archiva/proxy/SnapshotTransferTest.java b/archiva-modules/archiva-maven/archiva-maven-proxy/src/test/java/org/apache/archiva/proxy/SnapshotTransferTest.java index 291e0a914..de99d95a3 100644 --- a/archiva-modules/archiva-maven/archiva-maven-proxy/src/test/java/org/apache/archiva/proxy/SnapshotTransferTest.java +++ b/archiva-modules/archiva-maven/archiva-maven-proxy/src/test/java/org/apache/archiva/proxy/SnapshotTransferTest.java @@ -25,6 +25,7 @@ import org.apache.archiva.policies.ChecksumPolicy; import org.apache.archiva.policies.ReleasesPolicy; import org.apache.archiva.policies.SnapshotsPolicy; import org.apache.archiva.repository.BaseRepositoryContentLayout; +import org.apache.archiva.repository.content.Artifact; import org.apache.archiva.repository.storage.StorageAsset; import org.junit.Test; @@ -53,7 +54,7 @@ public class SnapshotTransferTest Path expectedFile = managedDefaultDir.resolve(path); BaseRepositoryContentLayout layout = managedDefaultRepository.getLayout( BaseRepositoryContentLayout.class ); - ArtifactReference artifact = managedDefaultRepository.toArtifactReference( path ); + Artifact artifact = layout.getArtifact( path ); Files.deleteIfExists(expectedFile); assertFalse( Files.exists(expectedFile) ); @@ -76,7 +77,7 @@ public class SnapshotTransferTest Path expectedFile = managedDefaultDir.resolve(path); BaseRepositoryContentLayout layout = managedDefaultRepository.getLayout( BaseRepositoryContentLayout.class ); - ArtifactReference artifact = managedDefaultRepository.toArtifactReference( path ); + Artifact artifact = layout.getArtifact( path ); Files.deleteIfExists(expectedFile); assertFalse( Files.exists(expectedFile) ); @@ -101,7 +102,7 @@ public class SnapshotTransferTest Path expectedFile = managedDefaultDir.resolve(path); BaseRepositoryContentLayout layout = managedDefaultRepository.getLayout( BaseRepositoryContentLayout.class ); - ArtifactReference artifact = managedDefaultRepository.toArtifactReference( path ); + Artifact artifact = layout.getArtifact( path ); assertTrue( Files.exists(expectedFile) ); Files.setLastModifiedTime( expectedFile, FileTime.from( getPastDate().getTime(), TimeUnit.MILLISECONDS )); @@ -130,7 +131,7 @@ public class SnapshotTransferTest BaseRepositoryContentLayout layout = managedDefaultRepository.getLayout( BaseRepositoryContentLayout.class ); - ArtifactReference artifact = managedDefaultRepository.toArtifactReference( path ); + Artifact artifact = layout.getArtifact( path ); // Configure Connector (usually done within archiva.xml configuration) saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, false ); @@ -219,7 +220,7 @@ public class SnapshotTransferTest Path expectedFile = managedDefaultDir.resolve(path); BaseRepositoryContentLayout layout = managedDefaultRepository.getLayout( BaseRepositoryContentLayout.class ); - ArtifactReference artifact = managedDefaultRepository.toArtifactReference( path ); + Artifact artifact = layout.getArtifact( path ); assertTrue( Files.exists(expectedFile) ); @@ -250,7 +251,7 @@ public class SnapshotTransferTest BaseRepositoryContentLayout layout = managedDefaultRepository.getLayout( BaseRepositoryContentLayout.class ); - ArtifactReference artifact = managedDefaultRepository.toArtifactReference( path ); + Artifact artifact = layout.getArtifact( path ); // Configure Connector (usually done within archiva.xml configuration) saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, false); @@ -273,7 +274,7 @@ public class SnapshotTransferTest BaseRepositoryContentLayout layout = managedDefaultRepository.getLayout( BaseRepositoryContentLayout.class ); - ArtifactReference artifact = managedDefaultRepository.toArtifactReference( path ); + Artifact artifact = layout.getArtifact( path ); Files.deleteIfExists(expectedFile); assertFalse( Files.exists(expectedFile) ); @@ -302,7 +303,7 @@ public class SnapshotTransferTest BaseRepositoryContentLayout layout = managedDefaultRepository.getLayout( BaseRepositoryContentLayout.class ); - ArtifactReference artifact = managedDefaultRepository.toArtifactReference( path ); + Artifact artifact = layout.getArtifact( path ); Files.deleteIfExists(expectedFile); assertFalse( Files.exists(expectedFile) ); @@ -332,8 +333,7 @@ public class SnapshotTransferTest BaseRepositoryContentLayout layout = managedDefaultRepository.getLayout( BaseRepositoryContentLayout.class ); - ArtifactReference artifact = managedDefaultRepository.toArtifactReference( path ); - artifact.setProjectVersion( "1.0-SNAPSHOT" ); + Artifact artifact = layout.getArtifact( path ); assertTrue( Files.exists(expectedFile) ); |