use of org.camunda.bpm.engine.form.FormType in project camunda-bpm-platform by camunda.
the class MockProvider method createMockTaskFormDataUsingFormFieldsWithoutFormKey.
public static TaskFormData createMockTaskFormDataUsingFormFieldsWithoutFormKey() {
FormField mockFormField = mock(FormField.class);
when(mockFormField.getId()).thenReturn(EXAMPLE_FORM_PROPERTY_ID);
when(mockFormField.getLabel()).thenReturn(EXAMPLE_FORM_PROPERTY_NAME);
when(mockFormField.getDefaultValue()).thenReturn(EXAMPLE_FORM_PROPERTY_VALUE);
FormType mockFormType = mock(FormType.class);
when(mockFormType.getName()).thenReturn(EXAMPLE_FORM_PROPERTY_TYPE_NAME);
when(mockFormField.getType()).thenReturn(mockFormType);
TaskFormData mockFormData = mock(TaskFormData.class);
when(mockFormData.getDeploymentId()).thenReturn(EXAMPLE_DEPLOYMENT_ID);
List<FormField> mockFormFields = new ArrayList<FormField>();
mockFormFields.add(mockFormField);
when(mockFormData.getFormFields()).thenReturn(mockFormFields);
return mockFormData;
}
use of org.camunda.bpm.engine.form.FormType in project camunda-bpm-platform by camunda.
the class MockProvider method createMockStartFormDataUsingFormFieldsWithoutFormKey.
public static StartFormData createMockStartFormDataUsingFormFieldsWithoutFormKey(ProcessDefinition definition) {
FormField mockFormField = mock(FormField.class);
when(mockFormField.getId()).thenReturn(EXAMPLE_FORM_PROPERTY_ID);
when(mockFormField.getLabel()).thenReturn(EXAMPLE_FORM_PROPERTY_NAME);
when(mockFormField.getDefaultValue()).thenReturn(EXAMPLE_FORM_PROPERTY_VALUE);
FormType mockFormType = mock(FormType.class);
when(mockFormType.getName()).thenReturn(EXAMPLE_FORM_PROPERTY_TYPE_NAME);
when(mockFormField.getType()).thenReturn(mockFormType);
StartFormData mockFormData = mock(StartFormData.class);
when(mockFormData.getDeploymentId()).thenReturn(EXAMPLE_DEPLOYMENT_ID);
when(mockFormData.getProcessDefinition()).thenReturn(definition);
List<FormField> mockFormFields = new ArrayList<FormField>();
mockFormFields.add(mockFormField);
when(mockFormData.getFormFields()).thenReturn(mockFormFields);
return mockFormData;
}
use of org.camunda.bpm.engine.form.FormType in project camunda-bpm-platform by camunda.
the class MockProvider method createMockTaskFormData.
public static TaskFormData createMockTaskFormData() {
FormProperty mockFormProperty = mock(FormProperty.class);
when(mockFormProperty.getId()).thenReturn(EXAMPLE_FORM_PROPERTY_ID);
when(mockFormProperty.getName()).thenReturn(EXAMPLE_FORM_PROPERTY_NAME);
when(mockFormProperty.getValue()).thenReturn(EXAMPLE_FORM_PROPERTY_VALUE);
when(mockFormProperty.isReadable()).thenReturn(EXAMPLE_FORM_PROPERTY_READABLE);
when(mockFormProperty.isWritable()).thenReturn(EXAMPLE_FORM_PROPERTY_WRITABLE);
when(mockFormProperty.isRequired()).thenReturn(EXAMPLE_FORM_PROPERTY_REQUIRED);
FormType mockFormType = mock(FormType.class);
when(mockFormType.getName()).thenReturn(EXAMPLE_FORM_PROPERTY_TYPE_NAME);
when(mockFormProperty.getType()).thenReturn(mockFormType);
TaskFormData mockFormData = mock(TaskFormData.class);
when(mockFormData.getFormKey()).thenReturn(EXAMPLE_FORM_KEY);
when(mockFormData.getDeploymentId()).thenReturn(EXAMPLE_DEPLOYMENT_ID);
List<FormProperty> mockFormProperties = new ArrayList<FormProperty>();
mockFormProperties.add(mockFormProperty);
when(mockFormData.getFormProperties()).thenReturn(mockFormProperties);
return mockFormData;
}
use of org.camunda.bpm.engine.form.FormType in project camunda-bpm-platform by camunda.
the class MockProvider method createMockStartFormData.
// form data
public static StartFormData createMockStartFormData(ProcessDefinition definition) {
FormProperty mockFormProperty = mock(FormProperty.class);
when(mockFormProperty.getId()).thenReturn(EXAMPLE_FORM_PROPERTY_ID);
when(mockFormProperty.getName()).thenReturn(EXAMPLE_FORM_PROPERTY_NAME);
when(mockFormProperty.getValue()).thenReturn(EXAMPLE_FORM_PROPERTY_VALUE);
when(mockFormProperty.isReadable()).thenReturn(EXAMPLE_FORM_PROPERTY_READABLE);
when(mockFormProperty.isWritable()).thenReturn(EXAMPLE_FORM_PROPERTY_WRITABLE);
when(mockFormProperty.isRequired()).thenReturn(EXAMPLE_FORM_PROPERTY_REQUIRED);
FormType mockFormType = mock(FormType.class);
when(mockFormType.getName()).thenReturn(EXAMPLE_FORM_PROPERTY_TYPE_NAME);
when(mockFormProperty.getType()).thenReturn(mockFormType);
StartFormData mockFormData = mock(StartFormData.class);
when(mockFormData.getFormKey()).thenReturn(EXAMPLE_FORM_KEY);
when(mockFormData.getDeploymentId()).thenReturn(EXAMPLE_DEPLOYMENT_ID);
when(mockFormData.getProcessDefinition()).thenReturn(definition);
List<FormProperty> mockFormProperties = new ArrayList<FormProperty>();
mockFormProperties.add(mockFormProperty);
when(mockFormData.getFormProperties()).thenReturn(mockFormProperties);
return mockFormData;
}
Aggregations