use of org.kie.workbench.common.forms.jbpm.server.service.formGeneration.test.TestFormModelHandlerManager 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.jbpm.server.service.formGeneration.test.TestFormModelHandlerManager in project kie-wb-common by kiegroup.
the class BPMNVFSFormDefinitionGeneratorServiceTest method setup.
@Before
public void setup() throws IOException {
when(projectService.resolveModule(any())).thenReturn(module);
when(projectClassLoaderHelper.getModuleClassLoader(module)).thenReturn(this.getClass().getClassLoader());
source = mock(Path.class);
simpleFileSystemProvider = new SimpleFileSystemProvider();
simpleFileSystemProvider.forceAsDefault();
when(source.toURI()).thenReturn("default:///src/main/resources/test.frm");
when(commentedOptionFactory.makeCommentedOption(Mockito.<String>any())).then(invocationOnMock -> new CommentedOption("1", invocationOnMock.getArguments()[0].toString()));
formModelHandlerManager = new TestFormModelHandlerManager(projectService, projectClassLoaderHelper, fieldManager, modelFinderService);
when(modelReaderService.getModelReader(any())).thenReturn(modelReader);
service = new BPMNVFSFormDefinitionGeneratorService(fieldManager, modelReaderService, formModelHandlerManager, formFinderService, formSerializer, ioService, commentedOptionFactory, new FormModelSynchronizationUtilImpl(fieldManager, templateGenerator));
}
Aggregations