ProcessDefinitionDetailsPresenter implements RefreshMenuBuilder.SupportsRefresh { public void onProcessSelectionEvent(@Observes final ProcessDefSelectionEvent event) { deploymentId = event.getDeploymentId(); processId = event.getProcessId(); processDefName = event.getProcessDefName(); serverTemplateId = event.getServerTemplateId(); dynamic = event.isDynamic(); primaryActionMenuBuilder.setVisible(dynamic == false); changeTitleWidgetEvent.fire(new ChangeTitleWidgetEvent(this.place, String.valueOf(deploymentId) + " - " + processDefName)); }  @PostConstruct void init(); @OnStartup void onStartup(final PlaceRequest place); @WorkbenchPartView UberView<ProcessDefinitionDetailsPresenter> getView(); @WorkbenchMenu void buildMenu(final Consumer<Menus> menusConsumer); @WorkbenchPartTitle String getTitle(); @Override void onRefresh(); void onProcessSelectionEvent(@Observes final ProcessDefSelectionEvent event); void createNewProcessInstance(); IsWidget getDetailsView(); IsWidget getProcessDiagramView();  }
@Test public void testOnProcessSelectionEvent() { presenter.onProcessSelectionEvent(new ProcessDefSelectionEvent("processId", "deploymentId", "serverTemplateId", "processDefName", false)); verify(primaryActionMenuBuilder).setVisible(true); ArgumentCaptor<ChangeTitleWidgetEvent> captor = ArgumentCaptor.forClass(ChangeTitleWidgetEvent.class); verify(changeTitleWidgetEvent).fire(captor.capture()); assertEquals("deploymentId - processDefName", captor.getValue().getTitle()); }