Search in sources :

Example 1 with Form

use of org.guvnor.common.services.project.categories.Form in project kie-wb-common by kiegroup.

the class FormDefinitionIndexerTest method setup.

@Override
public void setup() throws IOException {
    FormModelVisitor visitor = mock(FormModelVisitor.class);
    FormModelVisitorProvider provider = mock(FormModelVisitorProvider.class);
    when(provider.getModelType()).thenReturn(FormModel.class);
    when(provider.getVisitor()).thenReturn(visitor);
    Instance<FormModelVisitorProvider<?>> providersInstance = mock(Instance.class);
    List<FormModelVisitorProvider<?>> providers = Arrays.asList(provider);
    when(providersInstance.iterator()).thenReturn(providers.iterator());
    indexer = spy(new TestFormDefinitionIndexer(new FormResourceTypeDefinition(new Form()), new FormDefinitionSerializerImpl(new FieldSerializer(), new FormModelSerializer(), new TestMetaDataEntryManager()), providersInstance));
    when(indexer.getProviderForModel(any())).thenReturn(provider);
    super.setup();
}
Also used : FieldSerializer(org.kie.workbench.common.forms.services.backend.serialization.impl.FieldSerializer) FormResourceTypeDefinition(org.kie.workbench.common.forms.editor.type.FormResourceTypeDefinition) Form(org.guvnor.common.services.project.categories.Form) FormDefinitionSerializerImpl(org.kie.workbench.common.forms.services.backend.serialization.impl.FormDefinitionSerializerImpl) FormModelSerializer(org.kie.workbench.common.forms.services.backend.serialization.impl.FormModelSerializer) TestMetaDataEntryManager(org.kie.workbench.common.forms.fields.test.TestMetaDataEntryManager)

Aggregations

Form (org.guvnor.common.services.project.categories.Form)1 FormResourceTypeDefinition (org.kie.workbench.common.forms.editor.type.FormResourceTypeDefinition)1 TestMetaDataEntryManager (org.kie.workbench.common.forms.fields.test.TestMetaDataEntryManager)1 FieldSerializer (org.kie.workbench.common.forms.services.backend.serialization.impl.FieldSerializer)1 FormDefinitionSerializerImpl (org.kie.workbench.common.forms.services.backend.serialization.impl.FormDefinitionSerializerImpl)1 FormModelSerializer (org.kie.workbench.common.forms.services.backend.serialization.impl.FormModelSerializer)1