Search in sources :

Example 31 with Artifact

use of org.jboss.pnc.dto.Artifact in project pnc by project-ncl.

the class RepositoryManagerResultMapper method toDTO.

public RepositoryManagerResultRest toDTO(RepositoryManagerResult entity) {
    List<Artifact> builtArtifacts = entity.getBuiltArtifacts().stream().map(artifact -> artifactMapper.toDTO(artifact)).collect(Collectors.toList());
    List<Artifact> dependencies = entity.getDependencies().stream().map(artifact -> artifactMapper.toDTO(artifact)).collect(Collectors.toList());
    String buildContentId = entity.getBuildContentId();
    String log = entity.getLog();
    CompletionStatus completionStatus = entity.getCompletionStatus();
    return new RepositoryManagerResultRest(builtArtifacts, dependencies, buildContentId, log, completionStatus);
}
Also used : Inject(javax.inject.Inject) GenericRepositoryManagerResult(org.jboss.pnc.bpm.model.RepositoryManagerResultRest.GenericRepositoryManagerResult) List(java.util.List) RepositoryManagerResult(org.jboss.pnc.spi.repositorymanager.RepositoryManagerResult) RepositoryManagerResultRest(org.jboss.pnc.bpm.model.RepositoryManagerResultRest) CompletionStatus(org.jboss.pnc.spi.coordinator.CompletionStatus) ApplicationScoped(javax.enterprise.context.ApplicationScoped) Artifact(org.jboss.pnc.dto.Artifact) ArtifactMapper(org.jboss.pnc.mapper.api.ArtifactMapper) Collectors(java.util.stream.Collectors) RepositoryManagerResultRest(org.jboss.pnc.bpm.model.RepositoryManagerResultRest) CompletionStatus(org.jboss.pnc.spi.coordinator.CompletionStatus) Artifact(org.jboss.pnc.dto.Artifact)

Aggregations

Artifact (org.jboss.pnc.dto.Artifact)31 Test (org.junit.Test)28 ContainerTest (org.jboss.pnc.test.category.ContainerTest)24 ArtifactClient (org.jboss.pnc.client.ArtifactClient)22 BuildClient (org.jboss.pnc.client.BuildClient)4 ArrayList (java.util.ArrayList)3 ArtifactRevision (org.jboss.pnc.dto.ArtifactRevision)3 List (java.util.List)2 TargetRepository (org.jboss.pnc.dto.TargetRepository)2 DTOValidationException (org.jboss.pnc.facade.validation.DTOValidationException)2 Before (org.junit.Before)2 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)2 Iterator (java.util.Iterator)1 Collectors (java.util.stream.Collectors)1 ApplicationScoped (javax.enterprise.context.ApplicationScoped)1 Inject (javax.inject.Inject)1 BadRequestException (javax.ws.rs.BadRequestException)1 ClientErrorException (javax.ws.rs.ClientErrorException)1 Assertions.assertThat (org.assertj.core.api.Assertions.assertThat)1 Condition (org.assertj.core.api.Condition)1