@Test public void testCommandIsExecuted() { presenter.setup(LABEL, command); presenter.onActionClick(); verify(command, times(1)).execute(); } }
@Test public void testSetup() { presenter.setup(LABEL, command); verify(view, times(1)).setLabel(LABEL); //verify the command was properly set presenter.onActionClick(); verify(command, times(1)).execute(); }
@Test public void testSetup() { presenter.setup(LABEL, command); verify(view, times(1)).setLabel(LABEL); //verify the command was properly set presenter.onActionClick(); verify(command, times(1)).execute(); }
@Test public void testCommandIsExecuted() { presenter.setup(LABEL, command); presenter.onActionClick(); verify(command, times(1)).execute(); } }
private void verifyPipelineActionsCommonSetup() { verify(view, times(1)).clearActionItems(); verify(stopActionPresenter, times(1)).setup(eq(STOP_PIPELINE_ACTION), any(Command.class)); verify(deleteActionPresenter, times(1)).setup(eq(DELETE_PIPELINE_ACTION), any(Command.class)); verify(showErrorActionPresenter, times(1)).setup(eq(SHOW_PIPELINE_ERROR_ACTION), any(Command.class)); verify(view, times(1)).addActionItem(stopActionPresenter.getView()); verify(view, times(1)).addActionItem(separatorPresenter.getView()); verify(view, times(1)).addActionItem(deleteActionPresenter.getView()); verify(view, never()).addActionItem(startActionPresenter.getView()); verify(stopActionPresenter, times(1)).setEnabled(false); verify(startActionPresenter, times(1)).setEnabled(false); verify(deleteActionPresenter, times(1)).setEnabled(false); }
private void verifyRuntimeActionsCommonSetup() { verify(view, times(1)).clearActionItems(); verify(startActionPresenter, times(1)).setup(eq(START_RUNTIME_ACTION), any(Command.class)); verify(stopActionPresenter, times(1)).setup(eq(STOP_RUNTIME_ACTION), any(Command.class)); verify(deleteActionPresenter, times(1)).setup(eq(DELETE_RUNTIME_ACTION), any(Command.class)); verify(view, times(1)).addActionItem(stopActionPresenter.getView()); verify(view, times(1)).addActionItem(deleteActionPresenter.getView()); verify(view, times(1)).addActionItem(separatorPresenter.getView()); verify(view, times(1)).addActionItem(deleteActionPresenter.getView()); verify(stopActionPresenter, times(1)).setEnabled(true); verify(startActionPresenter, times(1)).setEnabled(true); verify(deleteActionPresenter, times(1)).setEnabled(true); } }
private void verifyRuntimeActionsCommonSetup() { verify(view, times(1)).clearActionItems(); verify(startActionPresenter, times(1)).setup(eq(START_RUNTIME_ACTION), any(Command.class)); verify(stopActionPresenter, times(1)).setup(eq(STOP_RUNTIME_ACTION), any(Command.class)); verify(deleteActionPresenter, times(1)).setup(eq(DELETE_RUNTIME_ACTION), any(Command.class)); verify(view, times(1)).addActionItem(stopActionPresenter.getView()); verify(view, times(1)).addActionItem(deleteActionPresenter.getView()); verify(view, times(1)).addActionItem(separatorPresenter.getView()); verify(view, times(1)).addActionItem(deleteActionPresenter.getView()); verify(stopActionPresenter, times(1)).setEnabled(true); verify(startActionPresenter, times(1)).setEnabled(true); verify(deleteActionPresenter, times(1)).setEnabled(true); } }
private void verifyPipelineActionsCommonSetup() { verify(view, times(1)).clearActionItems(); verify(stopActionPresenter, times(1)).setup(eq(STOP_PIPELINE_ACTION), any(Command.class)); verify(deleteActionPresenter, times(1)).setup(eq(DELETE_PIPELINE_ACTION), any(Command.class)); verify(view, times(1)).addActionItem(stopActionPresenter.getView()); verify(view, times(1)).addActionItem(separatorPresenter.getView()); verify(view, times(1)).addActionItem(deleteActionPresenter.getView()); verify(view, never()).addActionItem(startActionPresenter.getView()); verify(stopActionPresenter, times(1)).setEnabled(false); verify(startActionPresenter, times(1)).setEnabled(false); verify(deleteActionPresenter, times(1)).setEnabled(false); }
private void processRuntimeStatus(final Runtime runtime) { view.clearActionItems(); enableActions(true); view.addActionItem(startAction.getView()); view.addActionItem(stopAction.getView()); view.addActionItem(separator.getView()); view.addActionItem(deleteAction.getView()); startAction.setup(translationService.getTranslation(RuntimePresenter_RuntimeStartAction), this::startRuntime); stopAction.setup(translationService.getTranslation(RuntimePresenter_RuntimeStopAction), this::stopRuntime); deleteAction.setup(translationService.getTranslation(RuntimePresenter_RuntimeDeleteAction), this::deleteRuntime); RuntimeStatus runtimeStatus = buildRuntimeStatus(runtime.getStatus()); if (RUNNING == runtimeStatus) { startAction.setEnabled(false); } if (STOPPED == runtimeStatus || READY == runtimeStatus) { stopAction.setEnabled(false); } view.setStatus(buildIconStyle(runtimeStatus)); view.setStatusTitle(runtime.getStatus()); }
private void processRuntimeStatus(final Runtime runtime) { view.clearActionItems(); enableActions(true, startAction, stopAction, deleteAction); view.addActionItem(startAction.getView()); view.addActionItem(stopAction.getView()); view.addActionItem(separator.getView()); view.addActionItem(deleteAction.getView()); startAction.setup(translationService.getTranslation(RuntimePresenter_RuntimeStartAction), this::startRuntime); stopAction.setup(translationService.getTranslation(RuntimePresenter_RuntimeStopAction), this::stopRuntime); deleteAction.setup(translationService.getTranslation(RuntimePresenter_RuntimeDeleteAction), this::deleteRuntime); RuntimeStatus runtimeStatus = buildRuntimeStatus(runtime.getStatus()); if (RUNNING == runtimeStatus) { startAction.setEnabled(false); } if (STOPPED == runtimeStatus || READY == runtimeStatus) { stopAction.setEnabled(false); } view.setStatus(buildIconStyle(runtimeStatus)); view.setStatusTitle(runtime.getStatus()); }
private void processPipelineStatus(final PipelineStatus status) { view.clearActionItems(); enableActions(false); view.addActionItem(stopAction.getView()); view.addActionItem(separator.getView()); view.addActionItem(deleteAction.getView()); stopAction.setup(translationService.getTranslation(RuntimePresenter_PipelineExecutionStopAction), this::stopPipeline); deleteAction.setup(translationService.getTranslation(RuntimePresenter_PipelineExecutionDeleteAction), this::deletePipeline); switch (status) { case SCHEDULED: case RUNNING: stopAction.setEnabled(true); break; case ERROR: case STOPPED: deleteAction.setEnabled(true); break; case FINISHED: if (item.getRuntime() == null) { deleteAction.setEnabled(true); } break; } view.setStatus(buildIconStyle(status)); view.setStatusTitle(status.name()); }
view.addActionItem(deleteAction.getView()); stopAction.setup(translationService.getTranslation(RuntimePresenter_PipelineExecutionStopAction), this::stopPipeline); deleteAction.setup(translationService.getTranslation(RuntimePresenter_PipelineExecutionDeleteAction), this::deletePipeline); showErrorAction.setup(translationService.getTranslation(RuntimePresenter_PipelineExecutionShowErrorAction), this::showPipelineError);