@Override public boolean error(final Object o, final Throwable throwable) { notification.fire(new NotificationEvent(view.getStartContainerErrorMessage(), NotificationEvent.NotificationType.ERROR)); updateStatus(KieContainerStatus.STOPPED); return false; } }).startContainer(containerSpec);
@Override public boolean error(final Object o, final Throwable throwable) { notification.fire(new NotificationEvent(view.getStartContainerErrorMessage(), NotificationEvent.NotificationType.ERROR)); updateStatus(KieContainerStatus.STARTED); return false; } }).deactivateContainer(containerSpec);
@Override public boolean error(final Object o, final Throwable throwable) { notification.fire(new NotificationEvent(view.getStartContainerErrorMessage(), NotificationEvent.NotificationType.ERROR)); updateStatus(KieContainerStatus.DEACTIVATED); return false; } }).activateContainer(containerSpec);
@Test public void testStartContainer() { presenter.loadContainers(containerSpecData); presenter.startContainer(); verify(view).setContainerStartState(State.ENABLED); verify(view).setContainerStopState(State.DISABLED); verify(view).disableRemoveButton(); verify(view).enableToggleActivationButton(); final String errorMessage = "ERROR"; when(view.getStartContainerErrorMessage()).thenReturn(errorMessage); doThrow(new RuntimeException()).when(specManagementService).startContainer(containerSpecData.getContainerSpec()); presenter.startContainer(); verify(notification).fire(new NotificationEvent(errorMessage, NotificationEvent.NotificationType.ERROR)); verify(view, times(2)).setContainerStartState(State.DISABLED); verify(view, times(2)).setContainerStopState(State.ENABLED); verify(view, times(2)).enableRemoveButton(); }