X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=netconf%2Fsal-netconf-connector%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fnetconf%2Fsal%2Fconnect%2Fnetconf%2Fsal%2Ftx%2FWriteCandidateRunningTxTest.java;h=d088eeaa54bfbcaf39161affe68a26eab5a55b65;hb=be9e646f67e160652f89d78c7dd2377fc36c7d1d;hp=fd99a54d76c95ddcc9c7aac533f5778842b6b36d;hpb=ddfdd7b56162e9c45639388b10407d45f5f0ba13;p=netconf.git diff --git a/netconf/sal-netconf-connector/src/test/java/org/opendaylight/netconf/sal/connect/netconf/sal/tx/WriteCandidateRunningTxTest.java b/netconf/sal-netconf-connector/src/test/java/org/opendaylight/netconf/sal/connect/netconf/sal/tx/WriteCandidateRunningTxTest.java index fd99a54d76..d088eeaa54 100644 --- a/netconf/sal-netconf-connector/src/test/java/org/opendaylight/netconf/sal/connect/netconf/sal/tx/WriteCandidateRunningTxTest.java +++ b/netconf/sal-netconf-connector/src/test/java/org/opendaylight/netconf/sal/connect/netconf/sal/tx/WriteCandidateRunningTxTest.java @@ -8,8 +8,8 @@ package org.opendaylight.netconf.sal.connect.netconf.sal.tx; -import static org.mockito.Matchers.any; -import static org.mockito.Matchers.eq; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; @@ -31,6 +31,7 @@ import org.opendaylight.netconf.sal.connect.netconf.util.NetconfBaseOps; import org.opendaylight.netconf.sal.connect.netconf.util.NetconfMessageTransformUtil; import org.opendaylight.netconf.sal.connect.util.RemoteDeviceId; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netconf.base._1._0.rev110601.copy.config.input.target.ConfigTarget; +import org.opendaylight.yangtools.yang.common.Empty; import org.opendaylight.yangtools.yang.common.QName; import org.opendaylight.yangtools.yang.data.api.schema.ChoiceNode; import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode; @@ -50,7 +51,7 @@ public class WriteCandidateRunningTxTest { public void setUp() throws Exception { MockitoAnnotations.initMocks(this); final SchemaContext schemaContext = - YangParserTestUtils.parseYangStreams(getClass().getResourceAsStream("/schemas/test-module.yang")); + YangParserTestUtils.parseYangResource("/schemas/test-module.yang"); doReturn(Futures.immediateCheckedFuture(new DefaultDOMRpcResult())).when(rpc).invokeRpc(any(), any()); netconfOps = new NetconfBaseOps(rpc, schemaContext); id = new RemoteDeviceId("device1", InetSocketAddress.createUnresolved("0.0.0.0", 17830)); @@ -71,7 +72,7 @@ public class WriteCandidateRunningTxTest { //check, if both edits are called verify(rpc, times(2)).invokeRpc( eq(SchemaPath.create(true, NetconfMessageTransformUtil.NETCONF_EDIT_CONFIG_QNAME)), any()); - tx.submit().get(); + tx.commit().get(); //check, if unlock is called verify(rpc).invokeRpc(SchemaPath.create(true, NetconfMessageTransformUtil.NETCONF_COMMIT_QNAME), NetconfMessageTransformUtil.COMMIT_RPC_CONTENT); @@ -84,7 +85,8 @@ public class WriteCandidateRunningTxTest { } private static ContainerNode getLockContent(final QName op, final QName datastore) { - final LeafNode datastoreLeaf = Builders.leafBuilder().withNodeIdentifier(toId(datastore)).build(); + final LeafNode datastoreLeaf = Builders.leafBuilder().withNodeIdentifier(toId(datastore)) + .withValue(Empty.getInstance()).build(); final ChoiceNode choice = Builders.choiceBuilder() .withNodeIdentifier(toId(ConfigTarget.QNAME)) .withChild(datastoreLeaf)