use of org.jboss.pnc.spi.datastore.repositories.api.Repository in project pnc by project-ncl.
the class ArtifactProviderTest method testStore.
@Test
public void testStore() {
TargetRepository repo = TargetRepository.refBuilder().identifier("repo-id").repositoryPath("/repo/path").repositoryType(RepositoryType.MAVEN).build();
final String identifier = "foo:bar:0.0.1";
Artifact artifact = Artifact.builder().identifier(identifier).artifactQuality(ArtifactQuality.NEW).buildCategory(BuildCategory.STANDARD).build();
Artifact stored = provider.store(artifact);
assertThat(stored.getIdentifier()).isEqualTo(identifier);
assertThat(stored.getId()).isNotNull();
Mockito.verify(repository).save(ArgumentMatchers.argThat(a -> identifier.equals(a.getIdentifier())));
}
Aggregations