Do not generate 'isFoo()' methods
[mdsal.git] / dom / mdsal-dom-spi / src / test / java / org / opendaylight / mdsal / dom / spi / shard / WritableInteriorNodeTest.java
1 /*
2  * Copyright (c) 2016 Cisco Systems, Inc. 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.mdsal.dom.spi.shard;
9
10 import static org.mockito.Mockito.doNothing;
11 import static org.mockito.Mockito.verify;
12
13 import java.util.HashMap;
14 import java.util.Map;
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;
19
20 public class WritableInteriorNodeTest {
21
22     @Test
23     public void basicTest() throws Exception {
24         doNothing().when(TestUtils.WRITEABLE_MODIFICATION_NODE).markDeleted();
25         doNothing().when(TestUtils.DOM_DATA_TREE_WRITE_CURSOR).exit();
26
27         final Map<PathArgument, WriteableModificationNode> children = new HashMap<>();
28         children.put(TestUtils.NODE_IDENTIFIER, TestUtils.WRITEABLE_MODIFICATION_NODE);
29
30         final WritableInteriorNode writableInteriorNode = new WritableInteriorNode(TestUtils.NODE_IDENTIFIER, children);
31         Assert.assertEquals(writableInteriorNode.getIdentifier(), TestUtils.NODE_IDENTIFIER);
32
33         writableInteriorNode.createOperation(TestUtils.DOM_DATA_TREE_WRITE_CURSOR).exit();
34         verify(TestUtils.DOM_DATA_TREE_WRITE_CURSOR).exit();
35     }
36
37     @After
38     public void reset() {
39         TestUtils.resetMocks();
40     }
41 }