2 * Copyright (c) 2019 Pantheon Technologies, s.r.o. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.yangtools.yang.data.tree.impl;
10 import static org.junit.jupiter.api.Assertions.assertInstanceOf;
12 import org.junit.jupiter.api.Test;
13 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates;
14 import org.opendaylight.yangtools.yang.data.tree.api.DataTreeConfiguration;
15 import org.opendaylight.yangtools.yang.data.tree.api.TreeType;
16 import org.opendaylight.yangtools.yang.data.tree.impl.di.InMemoryDataTreeFactory;
18 class MapEntryRootTest extends AbstractTestModelTest {
20 void testMapEntryRoot() {
21 final var treeConfig = DataTreeConfiguration.builder(TreeType.OPERATIONAL).setRootPath(
22 TestModel.TEST_PATH.node(TestModel.OUTER_LIST_QNAME).node(
23 NodeIdentifierWithPredicates.of(TestModel.OUTER_LIST_QNAME, TestModel.ID_QNAME, (short) 12))).build();
24 final var dataTree = new InMemoryDataTreeFactory().create(treeConfig, SCHEMA_CONTEXT);
25 assertInstanceOf(InMemoryDataTree.class, dataTree);
27 final var imdt = (InMemoryDataTree) dataTree;
28 final var mod = imdt.takeSnapshot().newModification();
29 final var strategy = mod.getStrategy();
30 assertInstanceOf(MapEntryModificationStrategy.class, strategy);