Search in sources :

Example 1 with WorkItemDefinitionMetadataRegistry

use of org.kie.workbench.common.stunner.bpmn.workitem.WorkItemDefinitionMetadataRegistry in project kie-wb-common by kiegroup.

the class WorkItemDefinitionBackendRegistryTest method init.

@Before
public void init() {
    WorkItemDefinitionCacheRegistry registry = new WorkItemDefinitionCacheRegistry();
    WorkItemDefinitionMetadataRegistry metadataRegistry = new WorkItemDefinitionMetadataRegistry();
    when(metadata.getRoot()).thenReturn(root);
    when(service.search(eq(root))).thenReturn(Arrays.asList(DEF1, DEF2));
    this.tested = new WorkItemDefinitionBackendRegistry(registry, service, metadataRegistry);
    tested.init();
}
Also used : WorkItemDefinitionMetadataRegistry(org.kie.workbench.common.stunner.bpmn.workitem.WorkItemDefinitionMetadataRegistry) WorkItemDefinitionCacheRegistry(org.kie.workbench.common.stunner.bpmn.workitem.WorkItemDefinitionCacheRegistry) Before(org.junit.Before)

Example 2 with WorkItemDefinitionMetadataRegistry

use of org.kie.workbench.common.stunner.bpmn.workitem.WorkItemDefinitionMetadataRegistry 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)2 WorkItemDefinitionMetadataRegistry (org.kie.workbench.common.stunner.bpmn.workitem.WorkItemDefinitionMetadataRegistry)2 WorkItemDefinitionCacheRegistry (org.kie.workbench.common.stunner.bpmn.workitem.WorkItemDefinitionCacheRegistry)1 WorkItemDefinitionService (org.kie.workbench.common.stunner.bpmn.workitem.WorkItemDefinitionService)1 CallerMock (org.uberfire.mocks.CallerMock)1