use of com.sequenceiq.freeipa.flow.freeipa.diagnostics.DiagnosticsFlowException in project cloudbreak by hortonworks.
the class DiagnosticsUploadHandlerTest method testDoAcceptOnError.
@Test
public void testDoAcceptOnError() throws CloudbreakOrchestratorFailedException {
// GIVEN
doThrow(new CloudbreakOrchestratorFailedException("ex")).when(diagnosticsOperationsService).upload(anyLong(), any());
// WHEN
DiagnosticsCollectionEvent event = new DiagnosticsCollectionEvent(UPLOAD_DIAGNOSTICS_EVENT.selector(), STACK_ID, "crn", new DiagnosticParameters());
DiagnosticsFlowException result = assertThrows(DiagnosticsFlowException.class, () -> underTest.doAccept(new HandlerEvent<>(new Event<>(event))));
// THEN
assertTrue(result.getMessage().contains("Error during diagnostics operation: Upload"));
}
use of com.sequenceiq.freeipa.flow.freeipa.diagnostics.DiagnosticsFlowException in project cloudbreak by hortonworks.
the class DiagnosticsVmPreFlightCheckHandlerTest method testDoAcceptOnError.
@Test
public void testDoAcceptOnError() throws CloudbreakOrchestratorFailedException {
// GIVEN
doThrow(new CloudbreakOrchestratorFailedException("ex")).when(diagnosticsOperationsService).vmPreflightCheck(anyLong(), any());
// WHEN
DiagnosticsCollectionEvent event = new DiagnosticsCollectionEvent(VM_PREFLIGHT_CHECK_DIAGNOSTICS_EVENT.selector(), STACK_ID, "crn", new DiagnosticParameters());
DiagnosticsFlowException result = assertThrows(DiagnosticsFlowException.class, () -> underTest.doAccept(new HandlerEvent<>(new Event<>(event))));
// THEN
assertTrue(result.getMessage().contains("Error during diagnostics operation: VM Pre-flight check"));
}
use of com.sequenceiq.freeipa.flow.freeipa.diagnostics.DiagnosticsFlowException in project cloudbreak by hortonworks.
the class DiagnosticsCleanupHandlerTest method testDoAcceptOnError.
@Test
public void testDoAcceptOnError() throws CloudbreakOrchestratorFailedException {
// GIVEN
doThrow(new CloudbreakOrchestratorFailedException("ex")).when(diagnosticsOperationsService).cleanup(anyLong(), any());
// WHEN
DiagnosticsCollectionEvent event = new DiagnosticsCollectionEvent(CLEANUP_DIAGNOSTICS_EVENT.selector(), STACK_ID, "crn", new DiagnosticParameters());
DiagnosticsFlowException result = assertThrows(DiagnosticsFlowException.class, () -> underTest.doAccept(new HandlerEvent<>(new Event<>(event))));
// THEN
assertTrue(result.getMessage().contains("Error during diagnostics operation: Cleanup"));
}
use of com.sequenceiq.freeipa.flow.freeipa.diagnostics.DiagnosticsFlowException in project cloudbreak by hortonworks.
the class DiagnosticsCollectionHandlerTest method testDoAcceptOnError.
@Test
public void testDoAcceptOnError() throws CloudbreakOrchestratorFailedException {
// GIVEN
doThrow(new CloudbreakOrchestratorFailedException("ex")).when(diagnosticsOperationsService).collect(anyLong(), any());
// WHEN
DiagnosticsCollectionEvent event = new DiagnosticsCollectionEvent(COLLECT_DIAGNOSTICS_EVENT.selector(), STACK_ID, "crn", new DiagnosticParameters());
DiagnosticsFlowException result = assertThrows(DiagnosticsFlowException.class, () -> underTest.doAccept(new HandlerEvent<>(new Event<>(event))));
// THEN
assertTrue(result.getMessage().contains("Error during diagnostics operation: Collection"));
}
use of com.sequenceiq.freeipa.flow.freeipa.diagnostics.DiagnosticsFlowException in project cloudbreak by hortonworks.
the class DiagnosticsEnsureMachineUserHandlerTest method testDoAcceptOnError.
@Test
public void testDoAcceptOnError() throws IOException {
// GIVEN
doThrow(new IOException("ex")).when(altusMachineUserService).getOrCreateDataBusCredentialIfNeeded(anyLong());
DiagnosticParameters diagnosticParameters = new DiagnosticParameters();
diagnosticParameters.setDestination(DiagnosticsDestination.SUPPORT);
// WHEN
DiagnosticsCollectionEvent event = new DiagnosticsCollectionEvent(ENSURE_MACHINE_USER_EVENT.selector(), STACK_ID, "crn", diagnosticParameters);
DiagnosticsFlowException result = assertThrows(DiagnosticsFlowException.class, () -> underTest.doAccept(new HandlerEvent<>(new Event<>(event))));
// THEN
assertTrue(result.getMessage().contains("Error during diagnostics operation: UMS resource check"));
}
Aggregations