QuickNewProcessInstancePopup extends BaseModal implements FormDisplayerView { protected boolean validateForm() { if (processDefinitionsListBox.getSelectedItem() == null) { errorMessages.setText(Constants.INSTANCE.Select_Process()); errorMessagesGroup.setValidationState(ValidationState.ERROR); return false; } else { clearErrorMessages(); return true; } } 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 validateFormTest() { when(processDefinitionsListBox.getSelectedItem()).thenReturn(null); boolean valid = quickNewProcessInstancePopup.validateForm(); assertFalse(valid); verify(errorMessages).setText(Constants.INSTANCE.Select_Process()); verify(errorMessagesGroup).setValidationState(ValidationState.ERROR); when(processDefinitionsListBox.getSelectedItem()).thenReturn(mock(Option.class)); valid = quickNewProcessInstancePopup.validateForm(); assertTrue(valid); verify(errorMessages).setText(""); }