ProcessInstanceDiagramPresenter implements ProcessInstanceSummaryAware { protected void showOrHideNodeActions(boolean forLog, ProcessInstanceSummary processInstance) { if (forLog || processInstance.getState() != ProcessInstance.STATE_ACTIVE) { view.hideNodeActions(); } else { view.showNodeActions(); } }  @PostConstruct void init(); @Override void setProcessInstance(ProcessInstanceSummary processInstance); void onProcessInstanceSelectionEvent(@Observes final ProcessInstanceSelectionEvent event); void displayImage(final String svgContent, final String containerId); void onDiagramNodeSelected(final String nodeId); void onProcessNodeTrigger(final ProcessNodeSummary node); void listenParentProcessInstanceSelected(); void onNodeInstanceReTrigger(final NodeInstanceSummary node); void onNodeInstanceCancel(final NodeInstanceSummary node); void onTimerInstanceReschedule(final TimerInstanceSummary summary); void onShow(); @WorkbenchPartTitle String getName(); @WorkbenchPartView IsWidget getView(); @Inject void setProcessService(final Caller<ProcessRuntimeDataService> processService); void onProcessDiagramExpandEvent(@Observes ProcessDiagramExpandEvent event);  }
@Test public void testShowOrHideNodeActions() { ProcessInstanceSummary processInstanceActive = ProcessInstanceSummary.builder().withServerTemplateId("serverTemplateId").withDeploymentId("containerId").withState(ProcessInstance.STATE_ACTIVE).build(); presenter.showOrHideNodeActions(false, processInstanceActive); verify(view).showNodeActions(); ProcessInstanceSummary processInstanceCompleted = ProcessInstanceSummary.builder().withServerTemplateId("serverTemplateId").withDeploymentId("containerId").withState(ProcessInstance.STATE_COMPLETED).build(); presenter.showOrHideNodeActions(false, processInstanceCompleted); verify(view).hideNodeActions(); }