use of org.kie.workbench.common.forms.editor.service.backend.FormModelHandlerManager in project kie-wb-common by kiegroup.
the class FormGenerationIntegrationTest method init.
@Before
public void init() {
formModelHandlerManager = new TestFormModelHandlerManager(moduleService, moduleClassLoaderHelper, fieldManager, finderService);
when(pathModelReaderService.getModelReader(any())).thenReturn(new RuntimeDMOModelReader(moduleClassLoader, new RawMVELEvaluator()));
when(formFinderService.findFormsForType(anyString(), any())).then((Answer<List<FormDefinition>>) invocationOnMock -> {
String type = invocationOnMock.getArguments()[0].toString();
return Collections.singletonList(readFormDefinitionForType(type));
});
service = new BPMNVFSFormDefinitionGeneratorService(fieldManager, pathModelReaderService, formModelHandlerManager, formFinderService, formSerializer, ioService, commentedOptionFactory, formModelSynchronizationUtil);
when(moduleService.resolveModule(any())).thenReturn(module);
when(moduleClassLoaderHelper.getModuleClassLoader(any())).thenReturn(moduleClassLoader);
generator = new BPMNFormModelGeneratorImpl(moduleService, moduleClassLoaderHelper);
final Path rootPathWithNestedForms = PathFactory.newPath(DATA_OBJECTS_FOLDER, getUriOfResource(PREPARED_NESTED_FORMS_FOLDER));
;
processFormModel = generator.generateProcessFormModel(formGenerationProcessDefinitions, rootPathWithNestedForms);
taskFormModels = generator.generateTaskFormModels(formGenerationProcessDefinitions, rootPathWithNestedForms);
}
use of org.kie.workbench.common.forms.editor.service.backend.FormModelHandlerManager in project kie-wb-common by kiegroup.
the class FormDefinitionGeneratorImplTest method init.
@Before
@Override
public void init() {
super.init();
SimpleFileSystemProvider simpleFileSystemProvider = new SimpleFileSystemProvider();
simpleFileSystemProvider.forceAsDefault();
Definitions processDefinitions = getProcessDefinitions();
// Prepare BPMNFormModelGenerator
when(kieModuleService.resolveModule(any())).thenReturn(module);
when(module.getRootPath()).thenReturn(path);
when(moduleClassLoaderHelper.getModuleClassLoader(module)).thenReturn(moduleClassLoader);
loadClass();
when(modelReaderService.getModelReader(any())).thenReturn(new RuntimeDMOModelReader(moduleClassLoader, new RawMVELEvaluator()));
BPMNFormModelGenerator bpmnFormModelGenerator = spy(new BPMNFormModelGeneratorImpl(kieModuleService, moduleClassLoaderHelper));
FormModelHandlerManager formModelHandlerManager = new TestFormModelHandlerManager(kieModuleService, moduleClassLoaderHelper, new TestFieldManager());
BPMNFormGeneratorService<Path> bpmnFormGeneratorService = new BPMNVFSFormDefinitionGeneratorService(new TestFieldManager(), modelReaderService, formModelHandlerManager, formFinderService, formDefinitionSerializer, ioService, commentedOptionFactory, synchronizationUtil);
generator = spy(new TestFormDefinitionGeneratorImpl(formGenerationModelProviders, ioService, bpmnFormModelGenerator, formDefinitionSerializer, bpmnFormGeneratorService, processDefinitions));
when(diagram.getMetadata()).thenReturn(metadata);
when(metadata.getPath()).thenReturn(diagramPath);
when(diagram.getGraph()).thenReturn(graph);
when(diagramPath.toURI()).thenReturn("default:///src/main/resources" + PROCESS_PATH);
}
Aggregations