QuickNewProcessInstancePopup extends BaseModal implements FormDisplayerView { protected void createNewProcessInstance() { final Option selectedItem = processDefinitionsListBox.getSelectedItem(); deploymentId = ((OptGroup) selectedItem.getParent()).getLabel(); processId = selectedItem.getValue(); processForm.setVisible(true); basicForm.setVisible(false); ProcessDisplayerConfig config = new ProcessDisplayerConfig(new ProcessDefinitionKey(serverTemplateId, deploymentId, processId), processId, false); startProcessDisplayProvider.setup(config, this); } QuickNewProcessInstancePopup(); void show(Long parentProcessInstanceId); void show(String serverTemplateId); void displayNotification(String text); @Override void display(GenericFormDisplayer displayer); void closePopup(); @Override void displayErrorMessage(String header, String errorMessage); @Override Command getOnCloseCommand(); @Override void setOnCloseCommand(Command onCloseCommand); @Override GenericFormDisplayer getCurrentDisplayer(); @Inject void setProcessRuntimeDataService(Caller<ProcessRuntimeDataService> processRuntimeDataService); static final String FIELD_ID_PROCESSNAME; @UiField
    public FlowPanel processForm; @UiField
    public FlowPanel basicForm; @UiField
    public HelpBlock errorMessages; @UiField
    public FormGroup errorMessagesGroup; @UiField
    public FormGroup processDefinitionsControlGroup; @UiField
    public Select processDefinitionsListBox; @UiField
    public HelpBlock processDefinitionsHelpLabel; @UiField
    public FlowPanel body; }
@Test public void createNewProcessInstance() { String deploymentId = "def_deploymentId"; String processDefinitionId = "def_Id"; OptGroup group = mock(OptGroup.class); Option option = mock(Option.class); when(option.getParent()).thenReturn(group); when(group.getLabel()).thenReturn(deploymentId); when(option.getValue()).thenReturn(processDefinitionId); when(processDefinitionsListBox.getSelectedItem()).thenReturn(option); quickNewProcessInstancePopup.createNewProcessInstance(); final ArgumentCaptor<ProcessDisplayerConfig> captor = ArgumentCaptor.forClass(ProcessDisplayerConfig.class); verify(startProcessDisplayProvider).setup(captor.capture(), eq(quickNewProcessInstancePopup)); assertEquals(processDefinitionId, captor.getValue().getKey().getProcessDefName()); assertEquals(deploymentId, captor.getValue().getKey().getDeploymentId()); }