Search in sources :

Example 11 with DiagnosticsFlowException

use of com.sequenceiq.cloudbreak.core.flow2.diagnostics.DiagnosticsFlowException in project cloudbreak by hortonworks.

the class DiagnosticsPreFlightCheckHandlerTest method testDoAcceptOnError.

@Test
public void testDoAcceptOnError() {
    // GIVEN
    doThrow(new IllegalArgumentException("ex")).when(diagnosticsFlowService).nodeStatusNetworkReport(anyLong());
    // WHEN
    DiagnosticsCollectionEvent event = new DiagnosticsCollectionEvent(SALT_PILLAR_UPDATE_DIAGNOSTICS_EVENT.selector(), STACK_ID, "crn", new DiagnosticParameters(), Set.of(), Set.of(), Set.of());
    DiagnosticsFlowException result = assertThrows(DiagnosticsFlowException.class, () -> underTest.doAccept(new HandlerEvent<>(new Event<>(event))));
    // THEN
    assertTrue(result.getMessage().contains("Error during diagnostics operation: Pre-flight check"));
}
Also used : DiagnosticParameters(com.sequenceiq.common.model.diagnostics.DiagnosticParameters) HandlerEvent(com.sequenceiq.flow.reactor.api.handler.HandlerEvent) DiagnosticsCollectionEvent(com.sequenceiq.cloudbreak.core.flow2.diagnostics.event.DiagnosticsCollectionEvent) DiagnosticsFlowException(com.sequenceiq.cloudbreak.core.flow2.diagnostics.DiagnosticsFlowException) Test(org.junit.jupiter.api.Test)

Aggregations

DiagnosticsFlowException (com.sequenceiq.cloudbreak.core.flow2.diagnostics.DiagnosticsFlowException)11 DiagnosticsCollectionEvent (com.sequenceiq.cloudbreak.core.flow2.diagnostics.event.DiagnosticsCollectionEvent)11 DiagnosticParameters (com.sequenceiq.common.model.diagnostics.DiagnosticParameters)11 HandlerEvent (com.sequenceiq.flow.reactor.api.handler.HandlerEvent)11 Test (org.junit.jupiter.api.Test)11 CloudbreakOrchestratorFailedException (com.sequenceiq.cloudbreak.orchestrator.exception.CloudbreakOrchestratorFailedException)9 IOException (java.io.IOException)1