MapBackedDMNContext implements DMNContext { public static MapBackedDMNContext of(Map<String, Object> ctx) { return new MapBackedDMNContext(ctx); } private  MapBackedDMNContext(); private  MapBackedDMNContext(Map<String, Object> ctx); private  MapBackedDMNContext(Map<String, Object> ctx, Map<String, Object> metadata); static MapBackedDMNContext of(Map<String, Object> ctx); static MapBackedDMNContext of(Map<String, Object> ctx, Map<String, Object> metadata); @Override DMNContext clone(); @Override Object set(String name, Object value); @Override Object get(String name); @Override void pushScope(String name, String namespace); @Override void popScope(); @Override Optional<String> scopeNamespace(); @Override Map<String, Object> getAll(); @Override boolean isDefined(String name); @Override DMNMetadata getMetadata();  }
@Test public void testEmptyContext() { MapBackedDMNContext ctx1 = MapBackedDMNContext.of(new HashMap<>(Collections.emptyMap())); testCloneAndAlter(ctx1, Collections.emptyMap(), Collections.emptyMap()); MapBackedDMNContext ctx2 = MapBackedDMNContext.of(new HashMap<>(Collections.emptyMap())); testPushAndPopScope(ctx2, Collections.emptyMap(), Collections.emptyMap()); }
@Test public void testContextWithEntries() { MapBackedDMNContext ctx1 = MapBackedDMNContext.of(new HashMap<>(DEFAULT_ENTRIES)); testCloneAndAlter(ctx1, DEFAULT_ENTRIES, Collections.emptyMap()); MapBackedDMNContext ctx2 = MapBackedDMNContext.of(new HashMap<>(DEFAULT_ENTRIES)); testPushAndPopScope(ctx2, DEFAULT_ENTRIES, Collections.emptyMap()); }
@Test public void testContextWithEntriesAndMetadata() { MapBackedDMNContext ctx1 = MapBackedDMNContext.of(new HashMap<>(DEFAULT_ENTRIES), new HashMap<>(DEFAULT_METADATA)); testCloneAndAlter(ctx1, DEFAULT_ENTRIES, DEFAULT_METADATA); MapBackedDMNContext ctx2 = MapBackedDMNContext.of(new HashMap<>(DEFAULT_ENTRIES), new HashMap<>(DEFAULT_METADATA)); testPushAndPopScope(ctx2, DEFAULT_ENTRIES, DEFAULT_METADATA); }