use of org.kie.workbench.common.stunner.bpmn.definition.morph.BaseTaskMorphPropertyDefinition in project kie-wb-common by kiegroup.
the class BPMNDiagramMarshallerBaseTest method init.
@SuppressWarnings("unchecked")
protected void init() {
initMocks(this);
cloneManager = mock(CloneManager.class);
try {
api = StunnerTestingGraphBackendAPI.build(BPMNDefinitionSet.class, new BPMNTestDefinitionFactory());
} catch (Exception e) {
fail("Cannot instantiate DefinitionSet [message=" + e.getMessage() + "]");
}
BackendBindableMorphAdapter<Object> morphAdapter = new BackendBindableMorphAdapter(api.getDefinitionUtils(), api.getFactoryManager(), cloneManager, singletonList(new BaseTaskMorphPropertyDefinition()));
doReturn(morphAdapter).when(api.getAdapterRegistry()).getMorphAdapter(eq(UserTask.class));
doReturn(morphAdapter).when(api.getAdapterRegistry()).getMorphAdapter(eq(NoneTask.class));
doReturn(morphAdapter).when(api.getAdapterRegistry()).getMorphAdapter(eq(ScriptTask.class));
doReturn(morphAdapter).when(api.getAdapterRegistry()).getMorphAdapter(eq(BusinessRuleTask.class));
workItemDefinitionMockRegistry = new WorkItemDefinitionMockRegistry();
WorkItemDefinitionLookupService widService = mock(WorkItemDefinitionLookupService.class);
when(widService.execute(any(Metadata.class))).thenReturn(workItemDefinitionMockRegistry.items());
marshaller = new BPMNDirectDiagramMarshaller(new XMLEncoderDiagramMetadataMarshaller(), api.getDefinitionManager(), api.getRuleManager(), widService, api.getFactoryManager(), api.commandFactory, api.commandManager, dataTypeCacheServer);
}
Aggregations