@Test public void testDeleteRuntimeConfirmNo() { prepareRuntimeDelete(); noCommandCaptor.getValue().execute(); verify(runtimeService, never()).deleteRuntime(any(RuntimeKey.class), anyBoolean()); }
private void testDeleteRuntime(boolean forced) { ProviderKey providerKey = mock(ProviderKey.class); RuntimeKey runtimeKey = new RuntimeKey(providerKey, RUNTIME_ID); service.deleteRuntime(runtimeKey, forced); verify(runtimeProvisioningService, times(1)).destroyRuntime(RUNTIME_ID, forced); verify(runtimeChangeEvent, times(1)).fire(new RuntimeChangeEvent(RuntimeChange.DELETED, runtimeKey)); }
@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()); }
private void testDeleteRuntime(boolean forced) { ProviderKey providerKey = mock(ProviderKey.class); RuntimeKey runtimeKey = new RuntimeKey(providerKey, RUNTIME_ID); service.deleteRuntime(runtimeKey, forced); verify(runtimeProvisioningService, times(1)).destroyRuntime(RUNTIME_ID, forced); verify(runtimeChangeEvent, times(1)).fire(new RuntimeChangeEvent(RuntimeChange.DELETED, runtimeKey)); }
@Test public void testDeleteRuntimeConfirmNo() { prepareRuntimeDelete(); 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(); }
.deleteRuntime(currentKey, false); times(1)).deleteRuntime(currentKey, false); verify(popupHelper, never()).deleteRuntime(currentKey, true);
.deleteRuntime(currentKey, false); times(1)).deleteRuntime(currentKey, false); verify(popupHelper, never()).deleteRuntime(currentKey, true);
.deleteRuntime(currentKey, false); times(1)).deleteRuntime(currentKey, false); times(1)).deleteRuntime(currentKey, true);
@Test public void testDeleteRuntimeConfirmYesAndSuccessful() { prepareRuntimeDelete(); RuntimeKey currentKey = runtime.getKey(); when(translationService.format(RuntimePresenter_RuntimeDeleteSuccessMessage, item.getRuntime().getKey().getId())).thenReturn(SUCCESS_MESSAGE); when(translationService.getTranslation(RuntimePresenter_RuntimeDeletingMessage)).thenReturn(BUSY_POPUP_MESSAGE); yesCommandCaptor.getValue().execute(); verify(runtimeService, times(1)).deleteRuntime(currentKey, false); 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)); }
.deleteRuntime(currentKey, false); times(1)).deleteRuntime(currentKey, false); times(1)).deleteRuntime(currentKey, true);
@Test public void testDeleteRuntimeConfirmYesAndSuccessful() { prepareRuntimeDelete(); RuntimeKey currentKey = runtime.getKey(); when(translationService.format(RuntimePresenter_RuntimeDeleteSuccessMessage, item.getRuntime().getKey().getId())).thenReturn(SUCCESS_MESSAGE); when(translationService.getTranslation(RuntimePresenter_RuntimeDeletingMessage)).thenReturn(BUSY_POPUP_MESSAGE); yesCommandCaptor.getValue().execute(); verify(runtimeService, times(1)).deleteRuntime(currentKey, false); 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 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(); }
protected void deleteRuntime() { confirmAndExecute(translationService.getTranslation(RuntimePresenter_RuntimeConfirmDeleteTitle), translationService.getTranslation(RuntimePresenter_RuntimeConfirmDeleteMessage), () -> { popupHelper.showBusyIndicator(translationService.getTranslation(RuntimePresenter_RuntimeDeletingMessage)); runtimeService.call(getDeleteRuntimeSuccessCallback(), getDeleteRuntimeErrorCallback()).deleteRuntime(item.getRuntime().getKey(), false); } ); }
protected void forceDeleteRuntime() { confirmAndExecute(translationService.getTranslation(RuntimePresenter_RuntimeConfirmForcedDeleteTitle), translationService.getTranslation(RuntimePresenter_RuntimeConfirmForcedDeleteMessage), () -> { popupHelper.showBusyIndicator(translationService.getTranslation(RuntimePresenter_RuntimeDeletingForcedMessage)); runtimeService.call(getDeleteRuntimeSuccessCallback(), getDefaultErrorCallback(true)).deleteRuntime(item.getRuntime().getKey(), true); } ); }
protected void deleteRuntime() { confirmAndExecute(translationService.getTranslation(RuntimePresenter_RuntimeConfirmDeleteTitle), translationService.getTranslation(RuntimePresenter_RuntimeConfirmDeleteMessage), () -> { popupHelper.showBusyIndicator(translationService.getTranslation(RuntimePresenter_RuntimeDeletingMessage)); runtimeService.call(getDeleteRuntimeSuccessCallback(), getDeleteRuntimeErrorCallback()).deleteRuntime(item.getRuntime().getKey(), false); } ); }
protected void forceDeleteRuntime() { confirmAndExecute(translationService.getTranslation(RuntimePresenter_RuntimeConfirmForcedDeleteTitle), translationService.getTranslation(RuntimePresenter_RuntimeConfirmForcedDeleteMessage), () -> { popupHelper.showBusyIndicator(translationService.getTranslation(RuntimePresenter_RuntimeDeletingForcedMessage)); runtimeService.call(getDeleteRuntimeSuccessCallback(), getDefaultErrorCallback(true)).deleteRuntime(item.getRuntime().getKey(), true); } ); }