use of org.kie.workbench.common.stunner.bpmn.workitem.CustomTask in project kie-wb-common by kiegroup.
the class CaseGraphFactoryImplTest method setUp.
@Before
public void setUp() throws Exception {
milestone = new CustomTask();
graphCommandFactory = new GraphCommandFactory();
when(customTaskFactory.buildItem(MILESTONE)).thenReturn(milestone);
when(definitionManager.adapters()).thenReturn(adapters);
when(adapters.registry()).thenReturn(registry);
when(registry.getDefinitionAdapter(CustomTask.class)).thenReturn(adapter);
when(adapter.getId(milestone)).thenReturn(DefinitionId.build(MILESTONE_ID));
when(factoryManager.newElement(anyString(), eq(getDefinitionId(BPMNDiagramImpl.class)))).thenReturn(diagramNode);
when(factoryManager.newElement(anyString(), eq(MILESTONE_ID))).thenReturn(milestoneNode);
when(diagramNode.getContent()).thenReturn(diagramContent);
when(diagramContent.getDefinition()).thenReturn(diagramDefinition);
when(diagramDefinition.getDiagramSet()).thenReturn(diagramSet);
when(diagramSet.getAdHoc()).thenReturn(adHoc);
when(adapters.forProperty()).thenReturn(propertyAdapter);
when(propertyAdapter.getId(adHoc)).thenReturn(ADHOC_ID);
when(diagramNode.getUUID()).thenReturn(UUID.uuid());
Index index = mock(Index.class);
when(indexBuilder.build(any(Graph.class))).thenReturn(index);
tested = new CaseGraphFactoryImpl(definitionManager, factoryManager, ruleManager, graphCommandManager, graphCommandFactory, indexBuilder, customTaskFactory, workItemDefinitionService);
}
Aggregations