Search in sources :

Example 1 with WorkItemDefinitionService

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();
}
Also used : WorkItemDefinitionService(org.kie.workbench.common.stunner.bpmn.workitem.WorkItemDefinitionService) WorkItemDefinitionMetadataRegistry(org.kie.workbench.common.stunner.bpmn.workitem.WorkItemDefinitionMetadataRegistry) CallerMock(org.uberfire.mocks.CallerMock) Before(org.junit.Before)

Aggregations

Before (org.junit.Before)1 WorkItemDefinitionMetadataRegistry (org.kie.workbench.common.stunner.bpmn.workitem.WorkItemDefinitionMetadataRegistry)1 WorkItemDefinitionService (org.kie.workbench.common.stunner.bpmn.workitem.WorkItemDefinitionService)1 CallerMock (org.uberfire.mocks.CallerMock)1