Move netconf-console to apps/
[netconf.git] / plugins / sal-netconf-connector / src / test / java / org / opendaylight / netconf / sal / connect / netconf / sal / tx / FieldsAwareReadWriteTxTest.java
1 /*
2  * Copyright © 2020 FRINX s.r.o. 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.netconf.sal.connect.netconf.sal.tx;
9
10 import static org.mockito.Mockito.verify;
11
12 import java.util.List;
13 import org.junit.Test;
14 import org.junit.runner.RunWith;
15 import org.mockito.Mock;
16 import org.mockito.junit.MockitoJUnitRunner;
17 import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
18 import org.opendaylight.mdsal.dom.api.DOMDataTreeWriteTransaction;
19 import org.opendaylight.netconf.dom.api.tx.NetconfDOMFieldsReadTransaction;
20 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
21
22 @RunWith(MockitoJUnitRunner.StrictStubs.class)
23 public class FieldsAwareReadWriteTxTest {
24     @Mock
25     private NetconfDOMFieldsReadTransaction delegateReadTx;
26     @Mock
27     private DOMDataTreeWriteTransaction delegateWriteTx;
28
29     @Test
30     public void testReadWithFields() {
31         final FieldsAwareReadWriteTx tx = new FieldsAwareReadWriteTx(delegateReadTx, delegateWriteTx);
32         tx.read(LogicalDatastoreType.CONFIGURATION, TxTestUtils.getContainerId(),
33             List.of(YangInstanceIdentifier.empty()));
34         verify(delegateReadTx).read(LogicalDatastoreType.CONFIGURATION, TxTestUtils.getContainerId(),
35             List.of(YangInstanceIdentifier.empty()));
36     }
37 }