@Test public void testForceDeleteRuntimeConfirmNo() { prepareRuntimeForceDelete(); noCommandCaptor.getValue().execute(); verify(runtimeService, never()).deleteRuntime(any(RuntimeKey.class), anyBoolean()); }
@Test public void testForceDeleteRuntimeConfirmNo() { prepareRuntimeForceDelete(); noCommandCaptor.getValue().execute(); verify(runtimeService, never()).deleteRuntime(any(RuntimeKey.class), anyBoolean()); }
@Test public void testForceDeleteRuntimeConfirmYesAndFailed() { prepareRuntimeForceDelete(); RuntimeKey currentKey = runtime.getKey(); when(translationService.getTranslation(RuntimePresenter_RuntimeDeletingForcedMessage)).thenReturn(BUSY_POPUP_MESSAGE); doThrow(new RuntimeException(ERROR_MESSAGE)) .when(runtimeService) .deleteRuntime(currentKey, true); yesCommandCaptor.getValue().execute(); verify(runtimeService, times(1)).deleteRuntime(currentKey, true); verify(defaultErrorCallback, times(1)).error(any(Message.class), exceptionCaptor.capture()); assertEquals(ERROR_MESSAGE, exceptionCaptor.getValue().getMessage()); verify(popupHelper, times(1)).showBusyIndicator(BUSY_POPUP_MESSAGE); verify(popupHelper, times(1)).hideBusyIndicator(); }
@Test public void testForceDeleteRuntimeConfirmYesAndFailed() { prepareRuntimeForceDelete(); RuntimeKey currentKey = runtime.getKey(); when(translationService.getTranslation(RuntimePresenter_RuntimeDeletingForcedMessage)).thenReturn(BUSY_POPUP_MESSAGE); doThrow(new RuntimeException(ERROR_MESSAGE)) .when(runtimeService) .deleteRuntime(currentKey, true); yesCommandCaptor.getValue().execute(); verify(runtimeService, times(1)).deleteRuntime(currentKey, true); verify(defaultErrorCallback, times(1)).error(any(Message.class), exceptionCaptor.capture()); assertEquals(ERROR_MESSAGE, exceptionCaptor.getValue().getCause().getMessage()); verify(popupHelper, times(1)).showBusyIndicator(BUSY_POPUP_MESSAGE); verify(popupHelper, times(1)).hideBusyIndicator(); }
@Test public void testForceDeleteRuntimeConfirmYesAndSuccessful() { prepareRuntimeForceDelete(); RuntimeKey currentKey = runtime.getKey(); when(translationService.format(RuntimePresenter_RuntimeDeleteSuccessMessage, item.getRuntime().getKey().getId())).thenReturn(SUCCESS_MESSAGE); when(translationService.getTranslation(RuntimePresenter_RuntimeDeletingForcedMessage)).thenReturn(BUSY_POPUP_MESSAGE); yesCommandCaptor.getValue().execute(); verify(runtimeService, times(1)).deleteRuntime(currentKey, true); verify(notificationEvent, times(1)).fire(new NotificationEvent(SUCCESS_MESSAGE, NotificationEvent.NotificationType.SUCCESS)); verify(popupHelper, times(1)).showBusyIndicator(BUSY_POPUP_MESSAGE); verify(popupHelper, times(1)).hideBusyIndicator(); }
@Test public void testForceDeleteRuntimeConfirmYesAndSuccessful() { prepareRuntimeForceDelete(); RuntimeKey currentKey = runtime.getKey(); when(translationService.format(RuntimePresenter_RuntimeDeleteSuccessMessage, item.getRuntime().getKey().getId())).thenReturn(SUCCESS_MESSAGE); when(translationService.getTranslation(RuntimePresenter_RuntimeDeletingForcedMessage)).thenReturn(BUSY_POPUP_MESSAGE); yesCommandCaptor.getValue().execute(); verify(runtimeService, times(1)).deleteRuntime(currentKey, true); verify(notificationEvent, times(1)).fire(new NotificationEvent(SUCCESS_MESSAGE, NotificationEvent.NotificationType.SUCCESS)); verify(popupHelper, times(1)).showBusyIndicator(BUSY_POPUP_MESSAGE); verify(popupHelper, times(1)).hideBusyIndicator(); }