2 * Copyright © 2020 FRINX s.r.o. 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.netconf.client.mdsal.spi;
10 import static org.mockito.Mockito.verify;
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;
22 @RunWith(MockitoJUnitRunner.StrictStubs.class)
23 public class FieldsAwareReadWriteTxTest {
25 private NetconfDOMFieldsReadTransaction delegateReadTx;
27 private DOMDataTreeWriteTransaction delegateWriteTx;
30 public void testReadWithFields() {
31 final FieldsAwareReadWriteTx tx = new FieldsAwareReadWriteTx(delegateReadTx, delegateWriteTx);
32 tx.read(LogicalDatastoreType.CONFIGURATION, TxTestUtils.getContainerId(),
33 List.of(YangInstanceIdentifier.of()));
34 verify(delegateReadTx).read(LogicalDatastoreType.CONFIGURATION, TxTestUtils.getContainerId(),
35 List.of(YangInstanceIdentifier.of()));