2 * Copyright (c) 2016 Cisco Systems, Inc. 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.mdsal.dom.store.inmemory;
10 import static org.junit.Assert.assertEquals;
11 import static org.mockito.Mockito.doNothing;
12 import static org.mockito.Mockito.verify;
13 import static org.opendaylight.mdsal.dom.store.inmemory.TestUtils.DOM_DATA_TREE_WRITE_CURSOR;
14 import static org.opendaylight.mdsal.dom.store.inmemory.TestUtils.NODE_IDENTIFIER;
15 import static org.opendaylight.mdsal.dom.store.inmemory.TestUtils.WRITEABLE_MODIFICATION_NODE;
16 import static org.opendaylight.mdsal.dom.store.inmemory.TestUtils.resetMocks;
18 import java.util.HashMap;
20 import org.junit.After;
21 import org.junit.Test;
22 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
24 public class WritableInteriorNodeTest {
27 public void basicTest() throws Exception {
28 doNothing().when(WRITEABLE_MODIFICATION_NODE).markDeleted();
29 doNothing().when(DOM_DATA_TREE_WRITE_CURSOR).exit();
31 final Map<PathArgument, WriteableModificationNode> children = new HashMap<>();
32 children.put(NODE_IDENTIFIER, WRITEABLE_MODIFICATION_NODE);
34 final WritableInteriorNode writableInteriorNode = new WritableInteriorNode(NODE_IDENTIFIER, children);
35 assertEquals(writableInteriorNode.getIdentifier(), NODE_IDENTIFIER);
37 writableInteriorNode.createOperation(DOM_DATA_TREE_WRITE_CURSOR).exit();
38 verify(DOM_DATA_TREE_WRITE_CURSOR).exit();