use of org.kie.workbench.common.stunner.bpmn.workitem.WorkItemDefinitionService in project kie-wb-common by kiegroup.
the class WorkItemDefinitionClientRegistryTest method init.
@Before
@SuppressWarnings("unchecked")
public void init() {
when(sessionManager.getCurrentSession()).thenReturn(session);
when(session.getSessionUUID()).thenReturn(SESSION_ID);
when(session.getCanvasHandler()).thenReturn(canvasHandler);
when(canvasHandler.getDiagram()).thenReturn(diagram);
when(diagram.getMetadata()).thenReturn(metadata);
when(metadata.getRoot()).thenReturn(root);
when(service.search(eq(root))).thenReturn(Collections.singleton(DEF));
when(registry.items()).thenReturn(Collections.singleton(DEF));
when(registry.get(eq(WID_ID))).thenReturn(DEF);
CallerMock<WorkItemDefinitionService> serviceCaller = new CallerMock<>(service);
WorkItemDefinitionMetadataRegistry metadataRegistry = new WorkItemDefinitionMetadataRegistry();
this.tested = new WorkItemDefinitionClientRegistry(sessionManager, serviceCaller, () -> registry, registryInstanceDestroyer, metadataRegistry);
this.tested.init();
}
Aggregations