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