@Test public void testStopPipelineConfirmNo() { preparePipelineStop(); noCommandCaptor.getValue().execute(); verify(runtimeService, never()).stopPipelineExecution(any(PipelineExecutionTraceKey.class)); }
@Test public void testStopPipelineConfirmNo() { preparePipelineStop(); noCommandCaptor.getValue().execute(); verify(runtimeService, never()).stopPipelineExecution(any(PipelineExecutionTraceKey.class)); }
@Test public void testStopPipelineConfirmYesAndFailed() { preparePipelineStop(); PipelineExecutionTraceKey currentKey = trace.getKey(); doThrow(new RuntimeException(ERROR_MESSAGE)) .when(runtimeService) .stopPipelineExecution(currentKey); yesCommandCaptor.getValue().execute(); verify(runtimeService, times(1)).stopPipelineExecution(currentKey); verify(defaultErrorCallback, times(1)).error(any(Message.class), exceptionCaptor.capture()); assertEquals(ERROR_MESSAGE, exceptionCaptor.getValue().getMessage()); }
@Test public void testStopPipelineConfirmYesAndFailed() { preparePipelineStop(); PipelineExecutionTraceKey currentKey = trace.getKey(); doThrow(new RuntimeException(ERROR_MESSAGE)) .when(runtimeService) .stopPipelineExecution(currentKey); yesCommandCaptor.getValue().execute(); verify(runtimeService, times(1)).stopPipelineExecution(currentKey); verify(defaultErrorCallback, times(1)).error(any(Message.class), exceptionCaptor.capture()); assertEquals(ERROR_MESSAGE, exceptionCaptor.getValue().getCause().getMessage()); }
@Test public void testStopPipelineConfirmYesAndSuccessful() { preparePipelineStop(); PipelineExecutionTraceKey currentKey = trace.getKey(); when(translationService.format(RuntimePresenter_PipelineExecutionStopSuccessMessage, currentKey.getId())).thenReturn(SUCCESS_MESSAGE); yesCommandCaptor.getValue().execute(); verify(runtimeService, times(1)).stopPipelineExecution(currentKey); verify(notificationEvent, times(1)).fire(new NotificationEvent(SUCCESS_MESSAGE, NotificationEvent.NotificationType.SUCCESS)); }
@Test public void testStopPipelineConfirmYesAndSuccessful() { preparePipelineStop(); PipelineExecutionTraceKey currentKey = trace.getKey(); when(translationService.format(RuntimePresenter_PipelineExecutionStopSuccessMessage, currentKey.getId())).thenReturn(SUCCESS_MESSAGE); yesCommandCaptor.getValue().execute(); verify(runtimeService, times(1)).stopPipelineExecution(currentKey); verify(notificationEvent, times(1)).fire(new NotificationEvent(SUCCESS_MESSAGE, NotificationEvent.NotificationType.SUCCESS)); }