use of com.sequenceiq.flow.reactor.api.handler.HandlerEvent in project cloudbreak by hortonworks.
the class DiagnosticsInitHandlerTest method testDoAcceptOnError.
@Test
public void testDoAcceptOnError() throws CloudbreakOrchestratorFailedException {
// GIVEN
doThrow(new CloudbreakOrchestratorFailedException("ex")).when(diagnosticsOperationsService).init(anyLong(), any());
// WHEN
DiagnosticsCollectionEvent event = new DiagnosticsCollectionEvent(INIT_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: Initialization"));
}
use of com.sequenceiq.flow.reactor.api.handler.HandlerEvent in project cloudbreak by hortonworks.
the class DiagnosticsPreFlightCheckHandlerTest method testDoAccept.
@Test
public void testDoAccept() {
// GIVEN
doNothing().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());
underTest.doAccept(new HandlerEvent<>(new Event<>(event)));
// THEN
verify(diagnosticsFlowService, times(1)).nodeStatusNetworkReport(anyLong());
}
use of com.sequenceiq.flow.reactor.api.handler.HandlerEvent 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"));
}
use of com.sequenceiq.flow.reactor.api.handler.HandlerEvent in project cloudbreak by hortonworks.
the class DiagnosticsUpgradeTelemetryHandlerTest method testDoAccept.
@Test
public void testDoAccept() throws CloudbreakOrchestratorFailedException {
// GIVEN
doNothing().when(telemetryUpgradeService).upgradeTelemetryComponent(anyLong(), any(), any());
// WHEN
DiagnosticsCollectionEvent event = new DiagnosticsCollectionEvent(UPGRADE_DIAGNOSTICS_EVENT.selector(), STACK_ID, "crn", new DiagnosticParameters(), Set.of(), Set.of(), Set.of());
underTest.doAccept(new HandlerEvent<>(new Event<>(event)));
// THEN
verify(telemetryUpgradeService, times(1)).upgradeTelemetryComponent(anyLong(), any(), any());
}
use of com.sequenceiq.flow.reactor.api.handler.HandlerEvent in project cloudbreak by hortonworks.
the class DiagnosticsUploadHandlerTest method testDoAccept.
@Test
public void testDoAccept() throws CloudbreakOrchestratorFailedException {
// GIVEN
doNothing().when(diagnosticsOperationsService).upload(anyLong(), any());
// WHEN
DiagnosticsCollectionEvent event = new DiagnosticsCollectionEvent(UPLOAD_DIAGNOSTICS_EVENT.selector(), STACK_ID, "crn", new DiagnosticParameters(), Set.of(), Set.of(), Set.of());
underTest.doAccept(new HandlerEvent<>(new Event<>(event)));
// THEN
verify(diagnosticsOperationsService, times(1)).upload(anyLong(), any());
}
Aggregations