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.spi.shard;
10 import static org.mockito.Mockito.doNothing;
11 import static org.mockito.Mockito.verify;
13 import java.util.HashMap;
15 import org.junit.After;
16 import org.junit.Assert;
17 import org.junit.Test;
18 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
20 public class WritableInteriorNodeTest {
23 public void basicTest() throws Exception {
24 doNothing().when(TestUtils.WRITEABLE_MODIFICATION_NODE).markDeleted();
25 doNothing().when(TestUtils.DOM_DATA_TREE_WRITE_CURSOR).exit();
27 final Map<PathArgument, WriteableModificationNode> children = new HashMap<>();
28 children.put(TestUtils.NODE_IDENTIFIER, TestUtils.WRITEABLE_MODIFICATION_NODE);
30 final WritableInteriorNode writableInteriorNode = new WritableInteriorNode(TestUtils.NODE_IDENTIFIER, children);
31 Assert.assertEquals(writableInteriorNode.getIdentifier(), TestUtils.NODE_IDENTIFIER);
33 writableInteriorNode.createOperation(TestUtils.DOM_DATA_TREE_WRITE_CURSOR).exit();
34 verify(TestUtils.DOM_DATA_TREE_WRITE_CURSOR).exit();
39 TestUtils.resetMocks();