Search in sources :

Example 1 with MergeRepositoriesService

use of org.apache.archiva.rest.api.services.MergeRepositoriesService in project archiva by apache.

the class MergeRepositoriesServiceTest method merge.

@Test
public void merge() throws Exception {
    String mergedArtifactPath = "org/apache/felix/org.apache.felix.bundlerepository/1.6.4/org.apache.felix.bundlerepository-1.6.4.jar";
    String mergedArtifactPomPath = "org/apache/felix/org.apache.felix.bundlerepository/1.6.4/org.apache.felix.bundlerepository-1.6.4.pom";
    assertTrue(Files.exists(repoStage.resolve(mergedArtifactPath)));
    assertTrue(Files.exists(repoStage.resolve(mergedArtifactPomPath)));
    MergeRepositoriesService service = getMergeRepositoriesService(authorizationHeader);
    service.mergeRepositories(TEST_REPOSITORY + "-stage", TEST_REPOSITORY, true);
    assertTrue(Files.exists(repo.resolve(mergedArtifactPath)));
    assertTrue(Files.exists(repo.resolve(mergedArtifactPomPath)));
}
Also used : MergeRepositoriesService(org.apache.archiva.rest.api.services.MergeRepositoriesService) Test(org.junit.Test)

Example 2 with MergeRepositoriesService

use of org.apache.archiva.rest.api.services.MergeRepositoriesService in project archiva by apache.

the class MergeRepositoriesServiceTest method getMergeConflictedArtifacts.

@Test
public void getMergeConflictedArtifacts() throws Exception {
    MergeRepositoriesService service = getMergeRepositoriesService(authorizationHeader);
    List<Artifact> artifactMetadatas = service.getMergeConflictedArtifacts(TEST_REPOSITORY + "-stage", TEST_REPOSITORY);
    log.info("conflicts: {}", artifactMetadatas);
    assertThat(artifactMetadatas).isNotNull().isNotEmpty().hasSize(8);
}
Also used : MergeRepositoriesService(org.apache.archiva.rest.api.services.MergeRepositoriesService) Artifact(org.apache.archiva.maven2.model.Artifact) Test(org.junit.Test)

Aggregations

MergeRepositoriesService (org.apache.archiva.rest.api.services.MergeRepositoriesService)2 Test (org.junit.Test)2 Artifact (org.apache.archiva.maven2.model.Artifact)1