ProcessInstanceDiagramPresenter implements ProcessInstanceSummaryAware { protected void showOrHideParentAndSubProcessPanel(ProcessInstanceSummary parentProcessInstance, List<ProcessInstanceSummary> subProcessInstances) { if (subProcessInstances.isEmpty() && parentProcessInstance == null) { view.hideParentAndSubProcessPanel(); } else { view.showParentAndSubProcessPanel(); } }  @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 testShowOrHideParentAndSubProcessPanel() { ProcessInstanceDiagramSummary summary = createHumanTaskProcessInstanceDiagramSummary(null); ProcessInstanceSummary processInstance = ProcessInstanceSummary.builder().withServerTemplateId("serverTemplateId").withDeploymentId("containerId").withProcessInstanceId(1l).withState(ProcessInstance.STATE_ACTIVE).build(); summary.setParentProcessInstanceSummary(ProcessInstanceSummary.builder().withServerTemplateId("serverTemplateId").withDeploymentId("containerId") .withProcessInstanceId(10l).withProcessName("parentProcess").build()); List<ProcessInstanceSummary> list = Arrays.asList(ProcessInstanceSummary.builder().withParentId(10l).withServerTemplateId("serverTemplateId").withDeploymentId("containerId") .withProcessId("sub-process-one").withProcessInstanceId(11l).withProcessName("sub-process-one").build(), ProcessInstanceSummary.builder().withParentId(10l).withServerTemplateId("serverTemplateId").withDeploymentId("containerId") .withProcessId("sub-process-two").withProcessInstanceId(12l).withProcessName("sub-process-two").build()); presenter.showOrHideParentAndSubProcessPanel(processInstance, list); verify(view).showParentAndSubProcessPanel(); presenter.showOrHideParentAndSubProcessPanel(null, Collections.emptyList()); verify(view).hideParentAndSubProcessPanel(); }