use of org.kie.workbench.common.stunner.bpmn.WorkItemDefinitionMockRegistry 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);
}
use of org.kie.workbench.common.stunner.bpmn.WorkItemDefinitionMockRegistry in project kie-wb-common by kiegroup.
the class BPMNDirectDiagramMarshallerTest method setup.
@Before
@SuppressWarnings("unchecked")
public void setup() throws Exception {
// Setup context.
widRegistry = new WorkItemDefinitionMockRegistry();
widService = mock(WorkItemDefinitionLookupService.class);
when(widService.execute(any(Metadata.class))).thenReturn(widRegistry.items());
stunnerAPI = StunnerTestingGraphBackendAPI.build(BPMNDefinitionSet.class, new BPMNTestDefinitionFactory(widRegistry));
xmlEncoder = new XMLEncoderDiagramMetadataMarshaller();
// Setup tested instance.
tested = new BPMNDirectDiagramMarshaller(xmlEncoder, stunnerAPI.getDefinitionManager(), stunnerAPI.getRuleManager(), widService, stunnerAPI.getFactoryManager(), stunnerAPI.commandFactory, stunnerAPI.commandManager, dataTypeCacheServer);
}
Aggregations