use of org.kie.workbench.common.forms.editor.type.FormResourceTypeDefinition 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();
}
Aggregations