use of org.jboss.pnc.dto.TargetRepository 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())));
}
use of org.jboss.pnc.dto.TargetRepository in project bacon by project-ncl.
the class OfflineManifestGeneratorTest method mockBuildsAndArtifacts.
private void mockBuildsAndArtifacts() {
TargetRepository repository = TargetRepository.refBuilder().identifier("repo1").repositoryType(RepositoryType.MAVEN).build();
builds = new HashMap<>();
artifacts = new HashSet<>();
for (int i = 1; i <= 5; i++) {
String buildName = "build" + i;
List<Artifact> builtArtifacts = new ArrayList<>();
for (int j = 1; j <= i * 2; j++) {
builtArtifacts.add(Artifact.builder().targetRepository(repository).identifier("org:built:jar:" + i + "." + j).filename("built-" + i + "." + j + ".jar").sha256("built_" + i + "_" + j).build());
}
List<Artifact> dependencies = new ArrayList<>();
for (int k = 1; k <= i * 3; k++) {
dependencies.add(Artifact.builder().targetRepository(repository).identifier("org:dependency:jar:" + i + "." + k).filename("dependency-" + i + "." + k + ".jar").sha256("dependency_" + i + "_" + k).build());
}
PncBuild build = new PncBuild();
build.setId(buildName);
build.setName(buildName);
build.addBuiltArtifacts(builtArtifacts);
build.addDependencyArtifacts(dependencies);
builds.put(buildName, build);
artifacts.addAll(builtArtifacts);
artifacts.addAll(dependencies);
}
}
Aggregations