use of org.kie.workbench.common.forms.jbpm.server.service.BPMNFormModelGenerator in project kie-wb-common by kiegroup.
the class FormDefinitionGeneratorImplTest method init.
@Before
public void init() throws Exception {
SimpleFileSystemProvider simpleFileSystemProvider = new SimpleFileSystemProvider();
simpleFileSystemProvider.forceAsDefault();
Definitions processDefinitions = BPMN2Utils.getDefinitions(FormDefinitionGeneratorImplTest.class.getResourceAsStream(PROCESS_PATH));
// Prepare BPMNFormModelGenerator
when(kieModuleService.resolveModule(any())).thenReturn(module);
when(module.getRootPath()).thenReturn(path);
when(moduleClassLoaderHelper.getModuleClassLoader(module)).thenReturn(moduleClassLoader);
when(moduleClassLoader.loadClass(anyString())).thenAnswer(invocation -> Object.class);
BPMNFormModelGenerator bpmnFormModelGenerator = spy(new BPMNFormModelGeneratorImpl(kieModuleService, moduleClassLoaderHelper));
FormModelHandlerManager formModelHandlerManager = new TestFormModelHandlerManager(kieModuleService, moduleClassLoaderHelper, new TestFieldManager());
BPMNFormGeneratorService<Path> bpmnFormGeneratorService = new BPMNVFSFormDefinitionGeneratorService(new TestFieldManager(), 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