use of org.guvnor.ala.ui.model.RuntimeKey in project kie-wb-common by kiegroup.
the class RuntimePresenterActionsTest method testOnCurrentRuntimeStopped.
@Test
public void testOnCurrentRuntimeStopped() {
prepareRuntime();
RuntimeKey currentKey = runtime.getKey();
presenter.onRuntimeChangeEvent(new RuntimeChangeEvent(RuntimeChange.STOPPED, currentKey));
verify(presenter, times(1)).refresh(currentKey);
}
use of org.guvnor.ala.ui.model.RuntimeKey in project kie-wb-common by kiegroup.
the class RuntimePresenterActionsTest method testForceDeleteRuntimeConfirmYesAndSuccessful.
@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();
}
use of org.guvnor.ala.ui.model.RuntimeKey in project kie-wb-common by kiegroup.
the class RuntimePresenterActionsTest method testStartRuntimeSuccessful.
@Test
public void testStartRuntimeSuccessful() {
prepareRuntime();
RuntimeKey currentKey = runtime.getKey();
when(translationService.format(RuntimePresenter_RuntimeStartSuccessMessage, currentKey.getId())).thenReturn(SUCCESS_MESSAGE);
when(translationService.getTranslation(RuntimePresenter_RuntimeStartingMessage)).thenReturn(BUSY_POPUP_MESSAGE);
presenter.startRuntime();
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));
}
use of org.guvnor.ala.ui.model.RuntimeKey in project kie-wb-common by kiegroup.
the class RuntimePresenterActionsTest method testOnCurrentRuntimeStarted.
@Test
public void testOnCurrentRuntimeStarted() {
prepareRuntime();
RuntimeKey currentKey = runtime.getKey();
presenter.onRuntimeChangeEvent(new RuntimeChangeEvent(RuntimeChange.STARTED, currentKey));
verify(presenter, times(1)).refresh(currentKey);
}
use of org.guvnor.ala.ui.model.RuntimeKey in project kie-wb-common by kiegroup.
the class RuntimePresenterActionsTest method testStopRuntimeConfirmYesAndFailed.
@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();
}
Aggregations