use of org.jboss.pnc.dto.requests.BuildPushParameters in project pnc by project-ncl.
the class BuildPusherRejectionsTest method shouldRejectWithBlacklistedArtifacts.
@Test
public void shouldRejectWithBlacklistedArtifacts() throws ProcessException {
// given
BuildRecord record = new BuildRecord();
record.setStatus(buildStatus);
record.setExecutionRootName("FOO");
BuildRecord savedBuildRecord = buildRecordRepository.save(record);
Artifact artifact = Artifact.builder().build();
artifact.setArtifactQuality(artifactQuality);
artifact.setBuildRecord(savedBuildRecord);
when(globalModuleGroup.getPncUrl()).thenReturn("http://localhost/");
when(artifactRepository.queryWithPredicates(any())).thenReturn(Collections.singletonList(artifact));
when(buildRecordRepository.getAnyLatestSuccessfulBuildRecordWithRevision(any(IdRev.class), any(Boolean.class))).thenReturn(null);
// then
thrown.expect(expected);
// when
BuildPushParameters buildPushParameters = BuildPushParameters.builder().build();
brewPusher.pushBuild(BuildMapper.idMapper.toDto(savedBuildRecord.getId()), buildPushParameters);
}
Aggregations