@Test public void testStopRuntimeConfirmNo() { prepareRuntimeStop(); noCommandCaptor.getValue().execute(); verify(runtimeService, never()).stopRuntime(any(RuntimeKey.class)); }
@Test public void testStopRuntimeConfirmNo() { prepareRuntimeStop(); noCommandCaptor.getValue().execute(); verify(runtimeService, never()).stopRuntime(any(RuntimeKey.class)); }
@Test public void testStopRuntimeConfirmYesAndFailed() { prepareRuntimeStop(); RuntimeKey currentKey = runtime.getKey(); when(translationService.getTranslation(RuntimePresenter_RuntimeStoppingMessage)).thenReturn(BUSY_POPUP_MESSAGE); doThrow(new RuntimeException(ERROR_MESSAGE)) .when(runtimeService) .stopRuntime(currentKey); yesCommandCaptor.getValue().execute(); verify(runtimeService, times(1)).stopRuntime(currentKey); 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 testStopRuntimeConfirmYesAndFailed() { prepareRuntimeStop(); RuntimeKey currentKey = runtime.getKey(); when(translationService.getTranslation(RuntimePresenter_RuntimeStoppingMessage)).thenReturn(BUSY_POPUP_MESSAGE); doThrow(new RuntimeException(ERROR_MESSAGE)) .when(runtimeService) .stopRuntime(currentKey); yesCommandCaptor.getValue().execute(); verify(runtimeService, times(1)).stopRuntime(currentKey); 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 testStopRuntimeConfirmYesAndSuccessful() { prepareRuntimeStop(); RuntimeKey currentKey = runtime.getKey(); when(translationService.format(RuntimePresenter_RuntimeStopSuccessMessage, item.getRuntime().getKey().getId())).thenReturn(SUCCESS_MESSAGE); when(translationService.getTranslation(RuntimePresenter_RuntimeStoppingMessage)).thenReturn(BUSY_POPUP_MESSAGE); yesCommandCaptor.getValue().execute(); verify(runtimeService, times(1)).stopRuntime(currentKey); verify(popupHelper, times(1)).showBusyIndicator(BUSY_POPUP_MESSAGE); verify(popupHelper, times(1)).hideBusyIndicator(); verify(notificationEvent, times(1)).fire(new NotificationEvent(SUCCESS_MESSAGE, NotificationEvent.NotificationType.SUCCESS)); }
@Test public void testStopRuntimeConfirmYesAndSuccessful() { prepareRuntimeStop(); RuntimeKey currentKey = runtime.getKey(); when(translationService.format(RuntimePresenter_RuntimeStopSuccessMessage, item.getRuntime().getKey().getId())).thenReturn(SUCCESS_MESSAGE); when(translationService.getTranslation(RuntimePresenter_RuntimeStoppingMessage)).thenReturn(BUSY_POPUP_MESSAGE); yesCommandCaptor.getValue().execute(); verify(runtimeService, times(1)).stopRuntime(currentKey); verify(popupHelper, times(1)).showBusyIndicator(BUSY_POPUP_MESSAGE); verify(popupHelper, times(1)).hideBusyIndicator(); verify(notificationEvent, times(1)).fire(new NotificationEvent(SUCCESS_MESSAGE, NotificationEvent.NotificationType.SUCCESS)); }