use of com.sequenceiq.datalake.flow.diagnostics.event.SdxDiagnosticsWaitRequest in project cloudbreak by hortonworks.
the class SdxDiagnosticsCollectionHandlerTest method testAcceptHappyPath.
@Test
void testAcceptHappyPath() {
Event<SdxDiagnosticsWaitRequest> event = initEvent();
underTest.accept(event);
SdxDiagnosticsSuccessEvent sdxDiagnosticsSuccessEvent = new SdxDiagnosticsSuccessEvent(1L, "userId", Map.of());
Mockito.verify(eventBus, Mockito.times(1)).notify(eq(sdxDiagnosticsSuccessEvent.selector()), any(Event.class));
}
use of com.sequenceiq.datalake.flow.diagnostics.event.SdxDiagnosticsWaitRequest in project cloudbreak by hortonworks.
the class SdxDiagnosticsCollectionHandlerTest method testAcceptWithUnspecifiedException.
@Test
void testAcceptWithUnspecifiedException() {
Event<SdxDiagnosticsWaitRequest> event = initEvent();
RuntimeException exception = new RuntimeException();
doThrow(exception).when(diagnosticsFlowService).waitForDiagnosticsCollection(anyLong(), any(), any());
underTest.accept(event);
SdxDiagnosticsFailedEvent sdxDiagnosticsFailedEvent = new SdxDiagnosticsFailedEvent(1L, "userId", Map.of(), exception);
Mockito.verify(eventBus, Mockito.times(1)).notify(eq(sdxDiagnosticsFailedEvent.selector()), any(Event.class));
}
Aggregations