Migrate yang-data-tree-ri to JUnit5
[yangtools.git] / data / yang-data-tree-ri / src / test / java / org / opendaylight / yangtools / yang / data / tree / impl / MapEntryRootTest.java
1 /*
2  * Copyright (c) 2019 Pantheon Technologies, s.r.o. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.yangtools.yang.data.tree.impl;
9
10 import static org.junit.jupiter.api.Assertions.assertInstanceOf;
11
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;
17
18 class MapEntryRootTest extends AbstractTestModelTest {
19     @Test
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);
26
27         final var imdt = (InMemoryDataTree) dataTree;
28         final var mod = imdt.takeSnapshot().newModification();
29         final var strategy = mod.getStrategy();
30         assertInstanceOf(MapEntryModificationStrategy.class, strategy);
31     }
32 }