@ExtendWith({ RepositoryManagementTestExecutionListener.class,

              ArtifactManagementTestExecutionListener.class })
@Test
public void testCopyArtifactFile(@MavenRepository(repositoryId = REPOSITORY_RELEASES_1,
                                                  setup = MavenIndexedRepositorySetup.class)
                                 Repository repository1,
                                 @MavenRepository(repositoryId = REPOSITORY_RELEASES_2,
                                                  setup = MavenIndexedRepositorySetup.class)
                                 Repository repository2,
                                 @MavenTestArtifact(repositoryId = REPOSITORY_RELEASES_1,
                                                    id = "org.carlspring.strongbox.copy:copy-foo",
                                                    versions = "1.1")
                                 Path artifactPath)
        throws IOException
{
    RepositoryPath artifactRepositoryPath = (RepositoryPath) artifactPath.normalize();
    String artifactRepositoryPathStr = RepositoryFiles.relativizePath(artifactRepositoryPath);
    client.copy(artifactRepositoryPathStr,
                repository1.getStorage().getId(),
                repository1.getId(),
                repository2.getStorage().getId(),
                repository2.getId());
    RootRepositoryPath repositoryPath2 = repositoryPathResolver.resolve(repository2);
    Path destArtifactPath = repositoryPath2.resolve(artifactRepositoryPathStr);
    assertThat(Files.exists(destArtifactPath))
            .as("Failed to copy artifact to destination repository '" + destArtifactPath + "'!")
            .isTrue();
}