use of org.mockito.internal.verification.NoMoreInteractions in project gocd by gocd.
the class PipelineSchedulerTest method shouldReturn404WhenVariableIsNotInConfigScope.
@Test
public void shouldReturn404WhenVariableIsNotInConfigScope() {
when(configService.hasPipelineNamed(new CaseInsensitiveString("blahPipeline"))).thenReturn(true);
when(configService.hasVariableInScope("blahPipeline", "blahVariable")).thenReturn(false);
OperationResult operationResult = mock(OperationResult.class);
final HashMap<String, String> revisions = new HashMap<>();
scheduler.manualProduceBuildCauseAndSave("blahPipeline", Username.ANONYMOUS, new ScheduleOptions(revisions, Collections.singletonMap("blahVariable", "blahValue"), new HashMap<>()), operationResult);
//noinspection unchecked
verify(buildCauseProducerService, new NoMoreInteractions()).manualSchedulePipeline(any(Username.class), any(CaseInsensitiveString.class), any(ScheduleOptions.class), any(OperationResult.class));
verify(operationResult).notFound("Variable 'blahVariable' has not been configured for pipeline 'blahPipeline'", "Variable 'blahVariable' has not been configured for pipeline 'blahPipeline'", HealthStateType.general(HealthStateScope.forPipeline("blahPipeline")));
}
Aggregations