Create NetconfDataTreeService with base and additional operations for netconf
[netconf.git] / netconf / sal-netconf-connector / src / test / java / org / opendaylight / netconf / sal / connect / netconf / sal / MountInstanceTest.java
index afeeb90c7493d0057fd626eb7f93755280a86197..d2f661a17cee46ebb2e5d91cfcd63d2d76f3fdba 100644 (file)
@@ -25,6 +25,7 @@ import org.opendaylight.mdsal.dom.api.DOMMountPointService;
 import org.opendaylight.mdsal.dom.api.DOMNotification;
 import org.opendaylight.mdsal.dom.api.DOMNotificationService;
 import org.opendaylight.mdsal.dom.api.DOMRpcService;
+import org.opendaylight.netconf.dom.api.NetconfDataTreeService;
 import org.opendaylight.netconf.sal.connect.util.RemoteDeviceId;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netconf.base._1._0.rev110601.IetfNetconfService;
 import org.opendaylight.yangtools.concepts.ObjectRegistration;
@@ -43,6 +44,8 @@ public class MountInstanceTest {
     @Mock
     private DOMDataBroker broker;
     @Mock
+    private NetconfDataTreeService netconfService;
+    @Mock
     private DOMRpcService rpcService;
     @Mock
     private NetconfDeviceNotificationService notificationService;
@@ -72,7 +75,7 @@ public class MountInstanceTest {
 
 
     @Test
-    public void testOnTopologyDeviceConnected() throws Exception {
+    public void testOnTopologyDeviceConnected() {
         mountInstance.onTopologyDeviceConnected(SCHEMA_CONTEXT, broker, rpcService, notificationService);
         verify(mountPointBuilder).addInitialSchemaContext(SCHEMA_CONTEXT);
         verify(mountPointBuilder).addService(DOMDataBroker.class, broker);
@@ -80,6 +83,16 @@ public class MountInstanceTest {
         verify(mountPointBuilder).addService(DOMNotificationService.class, notificationService);
     }
 
+    @Test
+    public void testOnTopologyDeviceConnectedWithNetconfService() {
+        mountInstance.onTopologyDeviceConnected(SCHEMA_CONTEXT, null, netconfService, rpcService,
+                notificationService, null);
+        verify(mountPointBuilder).addInitialSchemaContext(SCHEMA_CONTEXT);
+        verify(mountPointBuilder).addService(NetconfDataTreeService.class, netconfService);
+        verify(mountPointBuilder).addService(DOMRpcService.class, rpcService);
+        verify(mountPointBuilder).addService(DOMNotificationService.class, notificationService);
+    }
+
     @Test
     public void testOnTopologyDeviceDisconnected() throws Exception {
         mountInstance.onTopologyDeviceConnected(SCHEMA_CONTEXT, broker, rpcService, notificationService);