### Question:
SdxDiagnosticsCollectionHandler extends ExceptionCatcherEventHandler<SdxDiagnosticsWaitRequest> { @Override public String selector() { return "SdxDiagnosticsWaitRequest"; }  @Override String selector();  }### Answer:
@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)); }
@Test void testAcceptWithUserBreakException() { Event<SdxDiagnosticsWaitRequest> event = initEvent(); UserBreakException exception = new UserBreakException(); 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)); }
@Test void testAcceptWithPollerStoppedException() { Event<SdxDiagnosticsWaitRequest> event = initEvent(); PollerStoppedException exception = new PollerStoppedException(); 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)); }
@Test void testAcceptWithPollerException() { Event<SdxDiagnosticsWaitRequest> event = initEvent(); PollerException exception = new PollerException(); 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)); }
@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)); }