use of com.ibm.cohort.cql.evaluation.CqlContextFactory.ContextCacheKey in project quality-measure-and-cohort-service by Alvearie.
the class CqlContextFactoryTest method testContextCacheKeyEquals.
@Test
public void testContextCacheKeyEquals() {
CqlLibraryProvider libraryProvider = mock(CqlLibraryProvider.class);
CqlTerminologyProvider terminologyProvider = mock(CqlTerminologyProvider.class);
CqlVersionedIdentifier topLevelLibraryIdentifier = new CqlVersionedIdentifier("Test", "1.0.0");
Map<String, Parameter> parameters = new HashMap<>();
ZonedDateTime evaluationDateTime = ZonedDateTime.now();
CqlContextFactory.ContextCacheKey k1 = new CqlContextFactory.ContextCacheKey(libraryProvider, topLevelLibraryIdentifier, terminologyProvider, null, evaluationDateTime, parameters);
assertEquals(k1, k1);
CqlContextFactory.ContextCacheKey k2 = new CqlContextFactory.ContextCacheKey(libraryProvider, topLevelLibraryIdentifier, terminologyProvider, null, evaluationDateTime, parameters);
assertEquals(k1, k2);
Map<ContextCacheKey, String> map = new HashMap<>();
map.put(k1, "Hello,World");
assertEquals("Hello,World", map.get(k2));
}
Aggregations