use of org.kie.workbench.common.stunner.core.registry.impl.DefinitionsCacheRegistry in project kie-wb-common by kiegroup.
the class DomainLookupsCacheTest method testCleanUp.
@Test
public void testCleanUp() {
DefinitionsCacheRegistry definitionsRegistry = mock(DefinitionsCacheRegistry.class);
when(definitionsRegistry.getLabels(eq(DEF_ID1))).thenReturn(Collections.singleton(ROLE1));
when(definitionsRegistry.getLabels(eq(DEF_ID2))).thenReturn(Collections.singleton(ROLE2));
DomainLookupsCache tested = new DomainLookupsCache(definitionManager, definitionsRegistry, DEF_SET_ID);
assertEquals(1, tested.getDefinitions(ROLE1).size());
assertEquals(1, tested.getDefinitions(ROLE2).size());
tested.clear();
assertEquals(Collections.emptySet(), tested.getDefinitions(ROLE1));
assertEquals(Collections.emptySet(), tested.getDefinitions(ROLE2));
assertEquals(0, tested.getConnectionRules().size());
}
Aggregations