Search in sources :

Example 6 with SdxDiagnosticsWaitRequest

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));
}
Also used : SdxDiagnosticsSuccessEvent(com.sequenceiq.datalake.flow.diagnostics.event.SdxDiagnosticsSuccessEvent) SdxDiagnosticsSuccessEvent(com.sequenceiq.datalake.flow.diagnostics.event.SdxDiagnosticsSuccessEvent) SdxDiagnosticsFailedEvent(com.sequenceiq.datalake.flow.diagnostics.event.SdxDiagnosticsFailedEvent) Event(reactor.bus.Event) SdxDiagnosticsWaitRequest(com.sequenceiq.datalake.flow.diagnostics.event.SdxDiagnosticsWaitRequest) Test(org.junit.jupiter.api.Test)

Example 7 with SdxDiagnosticsWaitRequest

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));
}
Also used : SdxDiagnosticsFailedEvent(com.sequenceiq.datalake.flow.diagnostics.event.SdxDiagnosticsFailedEvent) SdxDiagnosticsSuccessEvent(com.sequenceiq.datalake.flow.diagnostics.event.SdxDiagnosticsSuccessEvent) SdxDiagnosticsFailedEvent(com.sequenceiq.datalake.flow.diagnostics.event.SdxDiagnosticsFailedEvent) Event(reactor.bus.Event) SdxDiagnosticsWaitRequest(com.sequenceiq.datalake.flow.diagnostics.event.SdxDiagnosticsWaitRequest) Test(org.junit.jupiter.api.Test)

Aggregations

SdxDiagnosticsFailedEvent (com.sequenceiq.datalake.flow.diagnostics.event.SdxDiagnosticsFailedEvent)7 SdxDiagnosticsSuccessEvent (com.sequenceiq.datalake.flow.diagnostics.event.SdxDiagnosticsSuccessEvent)7 SdxDiagnosticsWaitRequest (com.sequenceiq.datalake.flow.diagnostics.event.SdxDiagnosticsWaitRequest)7 Event (reactor.bus.Event)6 Test (org.junit.jupiter.api.Test)5 PollerException (com.dyngr.exception.PollerException)2 PollerStoppedException (com.dyngr.exception.PollerStoppedException)2 UserBreakException (com.dyngr.exception.UserBreakException)2 Selectable (com.sequenceiq.cloudbreak.common.event.Selectable)1 PollingConfig (com.sequenceiq.datalake.service.sdx.PollingConfig)1 FlowIdentifier (com.sequenceiq.flow.api.model.FlowIdentifier)1