Add blueprint wiring for netconf-console 38/45738/7
authorAlexis de Talhouët <adetalhouet@inocybe.com>
Fri, 16 Sep 2016 13:50:38 +0000 (09:50 -0400)
committerAlexis de Talhouët <adetalhouet@inocybe.com>
Tue, 18 Oct 2016 15:19:19 +0000 (11:19 -0400)
Also fix potential NPE when netconf:list-device is called
before the topology-netconf is initialized

Change-Id: Ic4e33ea7717511c26aa9cc9cbde4148f3e5549ac
Signed-off-by: Alexis de Talhouët <adetalhouet@inocybe.com>
16 files changed:
features/netconf-connector/pom.xml
features/netconf-connector/src/main/features/features.xml
netconf/netconf-console/src/main/config/default-config.xml [deleted file]
netconf/netconf-console/src/main/java/org/opendaylight/netconf/console/commands/NetconfCommandUtils.java
netconf/netconf-console/src/main/java/org/opendaylight/netconf/console/commands/NetconfDisconnectDeviceCommand.java
netconf/netconf-console/src/main/java/org/opendaylight/netconf/console/commands/NetconfListDevicesCommand.java
netconf/netconf-console/src/main/java/org/opendaylight/netconf/console/commands/NetconfUpdateDeviceCommand.java
netconf/netconf-console/src/main/java/org/opendaylight/netconf/console/impl/NetconfCommandsImpl.java
netconf/netconf-console/src/main/java/org/opendaylight/netconf/console/impl/NetconfConsoleProvider.java [deleted file]
netconf/netconf-console/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/netconf/console/provider/impl/rev160323/NetconfConsoleProviderModule.java [deleted file]
netconf/netconf-console/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/netconf/console/provider/impl/rev160323/NetconfConsoleProviderModuleFactory.java [deleted file]
netconf/netconf-console/src/main/resources/OSGI-INF/blueprint/commands.xml [deleted file]
netconf/netconf-console/src/main/resources/org/opendaylight/blueprint/netconf-command.xml [new file with mode: 0755]
netconf/netconf-console/src/main/yang/netconf-console-provider-impl.yang [deleted file]
netconf/netconf-console/src/test/java/org/opendaylight/netconf/console/impl/NetconfCommandsImplTest.java
netconf/netconf-console/src/test/java/org/opendaylight/netconf/console/impl/NetconfConsoleProviderTest.java [deleted file]

index cf4131026bb253e2e3b452019b1adb97074261c5..5931f6e975b8cbfff25f61166016094a65c770ff 100644 (file)
@@ -36,7 +36,6 @@
     <config.netconf.client.configfile>01-netconf.xml</config.netconf.client.configfile>
     <config.netconf.topology.configfile>02-netconf-topology.xml</config.netconf.topology.configfile>
     <config.netconf.connector.configfile>99-netconf-connector.xml</config.netconf.connector.configfile>
-    <config.netconf.console.configfile>100-netconf-console.xml</config.netconf.console.configfile>
   </properties>
 
   <dependencyManagement>
       <artifactId>netconf-console</artifactId>
       <version>${project.version}</version>
     </dependency>
-    <dependency>
-      <groupId>${project.groupId}</groupId>
-      <artifactId>netconf-console</artifactId>
-      <version>${project.version}</version>
-      <classifier>config</classifier>
-      <type>xml</type>
-    </dependency>
     <dependency>
       <groupId>${project.groupId}</groupId>
       <artifactId>abstract-topology</artifactId>
index fe3e66dba3ced96accabdbc0f98c5b10115d1d8a..49dfa5673553ab778379278ee1aca7d6a243caad 100644 (file)
@@ -66,7 +66,6 @@
        <feature version='${project.version}'>odl-netconf-connector-all</feature>
        <feature version='${project.version}'>odl-netconf-topology</feature>
        <bundle>mvn:org.opendaylight.netconf/netconf-console/{{VERSION}}</bundle>
-       <configfile finalname='${config.configfile.directory}/${config.netconf.console.configfile}'>mvn:org.opendaylight.netconf/netconf-console/{{VERSION}}/xml/config</configfile>
     </feature>
 
 </features>
diff --git a/netconf/netconf-console/src/main/config/default-config.xml b/netconf/netconf-console/src/main/config/default-config.xml
deleted file mode 100644 (file)
index 4f27421..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-Copyright (c) 2016 Inocybe Technologies. All rights reserved.
-This program and the accompanying materials are made available under the
-terms of the Eclipse Public License v1.0 which accompanies this distribution,
-and is available at http://www.eclipse.org/legal/epl-v10.html INTERNAL
--->
-<snapshot>
-  <required-capabilities>
-      <capability>urn:opendaylight:netconf:console:provider:impl?module=netconf-console-provider-impl&amp;revision=2016-03-23</capability>
-      <capability>urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding?module=opendaylight-md-sal-binding&amp;revision=2013-10-28</capability>
-  </required-capabilities>
-
-  <configuration>
-    <data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
-      <modules xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
-        <module>
-          <type xmlns:prefix="urn:opendaylight:netconf:console:provider:impl">prefix:netconf-console-provider-impl</type>
-          <name>netconf-console-default</name>
-          <broker>
-            <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-broker-osgi-registry</type>
-            <name>binding-osgi-broker</name>
-          </broker>
-        </module>
-      </modules>
-    </data>
-  </configuration>
-</snapshot>
\ No newline at end of file
index 40ac48f17c633613afc9a1dd9be39db3ae5d86d0..96715193b5a2928e0dc3ecf8acfe38368ff7d22b 100644 (file)
@@ -8,11 +8,10 @@
 
 package org.opendaylight.netconf.console.commands;
 
+import com.google.common.base.Strings;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
-import com.google.common.base.Strings;
-
 public class NetconfCommandUtils {
 
     private static final Pattern IP_PATTERN = Pattern.compile(
index b1abf2fa254d7a9f2bac9009245a99f1e0f48211..20f1234ac90dc9af0ebf30353370d5916d695648 100644 (file)
@@ -9,13 +9,12 @@
 package org.opendaylight.netconf.console.commands;
 
 import com.google.common.annotations.VisibleForTesting;
+import com.google.common.base.Strings;
 import org.apache.karaf.shell.commands.Command;
 import org.apache.karaf.shell.commands.Option;
 import org.apache.karaf.shell.console.AbstractAction;
 import org.opendaylight.netconf.console.api.NetconfCommands;
 
-import com.google.common.base.Strings;
-
 @Command(name = "netconf:disconnect-device", scope = "netconf", description = "Disconnect netconf device.")
 public class NetconfDisconnectDeviceCommand extends AbstractAction {
 
index fd52e651e2ff7d9fce9704057ce5306688e1f8fc..7a1ec73f45ec67a99d77a7b04621fe968b98ab7a 100644 (file)
@@ -9,9 +9,7 @@
 package org.opendaylight.netconf.console.commands;
 
 import java.util.Map;
-
 import javax.annotation.Nonnull;
-
 import org.apache.karaf.shell.commands.Command;
 import org.apache.karaf.shell.console.AbstractAction;
 import org.apache.karaf.shell.table.ShellTable;
index 79b6bb498e4d0b6e00f596749fa5264ce9164323..c890a39884cfd6d86ef8b88bbefeb34144d15f62 100644 (file)
@@ -11,7 +11,6 @@ package org.opendaylight.netconf.console.commands;
 import com.google.common.annotations.VisibleForTesting;
 import java.util.HashMap;
 import java.util.Map;
-
 import org.apache.karaf.shell.commands.Command;
 import org.apache.karaf.shell.commands.Option;
 import org.apache.karaf.shell.console.AbstractAction;
index d830e9d097b0f14a6a94a2ea20b7fd5a2a026ae0..14a241259226f0ab3e8f898649896217ef1037b9 100644 (file)
@@ -19,7 +19,6 @@ import java.util.Map;
 import java.util.UUID;
 import java.util.stream.Collectors;
 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.binding.api.MountPointService;
 import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
 import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
@@ -50,17 +49,18 @@ public class NetconfCommandsImpl implements NetconfCommands {
     private static final Logger LOG = LoggerFactory.getLogger(NetconfCommandsImpl.class);
 
     private final DataBroker dataBroker;
-    private final MountPointService mountPointService;
 
-    public NetconfCommandsImpl(final DataBroker db, final MountPointService mountPointService) {
+    public NetconfCommandsImpl(final DataBroker db) {
         LOG.debug("NetconfConsoleProviderImpl initialized");
         this.dataBroker = db;
-        this.mountPointService = mountPointService;
     }
 
     @Override
     public Map<String, Map<String, String>> listDevices() {
         final Topology topology = NetconfConsoleUtils.read(LogicalDatastoreType.OPERATIONAL, NetconfIidFactory.NETCONF_TOPOLOGY_IID, dataBroker);
+        if (topology == null) {
+            return new HashMap<>();
+        }
         final Map<String, Map<String, String>> netconfNodes = new HashMap<>();
         for (final Node node : topology.getNode()) {
             final NetconfNode netconfNode = node.getAugmentation(NetconfNode.class);
diff --git a/netconf/netconf-console/src/main/java/org/opendaylight/netconf/console/impl/NetconfConsoleProvider.java b/netconf/netconf-console/src/main/java/org/opendaylight/netconf/console/impl/NetconfConsoleProvider.java
deleted file mode 100644 (file)
index 0f15ef4..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) 2016 Inocybe Technologies and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-
-package org.opendaylight.netconf.console.impl;
-
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.binding.api.MountPointService;
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
-import org.opendaylight.controller.sal.binding.api.BindingAwareProvider;
-import org.opendaylight.netconf.console.api.NetconfCommands;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.FrameworkUtil;
-import org.osgi.framework.ServiceRegistration;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class NetconfConsoleProvider implements BindingAwareProvider, AutoCloseable {
-
-    private static final Logger LOG = LoggerFactory.getLogger(NetconfConsoleProvider.class);
-    private ServiceRegistration<NetconfCommands> netconfConsoleRegistration;
-
-    @Override
-    public void onSessionInitiated(ProviderContext session) {
-        LOG.info("NetconfProvider Session Initiated");
-
-        // Retrieve DataBroker service to interact with md-sal
-        final DataBroker dataBroker =  session.getSALService(DataBroker.class);
-
-        // Retrieve MountPointService to interact with NETCONF remote devices connected to ODL and register it
-        final MountPointService mountService = session.getSALService(MountPointService.class);
-        final BundleContext context = FrameworkUtil.getBundle(this.getClass()).getBundleContext();
-
-        // Initialization of NETCONF Console Provider service implementation
-        initializeNetconfConsoleProvider(dataBroker, context, mountService);
-    }
-
-    private void initializeNetconfConsoleProvider(DataBroker dataBroker, BundleContext context, MountPointService mountService) {
-        // Initialize NetconfConsoleProviderImpl class
-        final NetconfCommandsImpl consoleProvider = new NetconfCommandsImpl(dataBroker, mountService);
-
-        // Register the NetconfConsoleProvider service
-        netconfConsoleRegistration = context.registerService(NetconfCommands.class, consoleProvider, null);
-    }
-
-    @Override
-    public void close() throws Exception {
-        LOG.info("NetconfProvider closed.");
-        netconfConsoleRegistration.unregister();
-    }
-}
diff --git a/netconf/netconf-console/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/netconf/console/provider/impl/rev160323/NetconfConsoleProviderModule.java b/netconf/netconf-console/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/netconf/console/provider/impl/rev160323/NetconfConsoleProviderModule.java
deleted file mode 100644 (file)
index 39f5409..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-package org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.console.provider.impl.rev160323;
-
-import org.opendaylight.netconf.console.impl.NetconfConsoleProvider;
-
-public class NetconfConsoleProviderModule extends org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.console.provider.impl.rev160323.AbstractNetconfConsoleProviderModule {
-    public NetconfConsoleProviderModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
-        super(identifier, dependencyResolver);
-    }
-
-    public NetconfConsoleProviderModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.console.provider.impl.rev160323.NetconfConsoleProviderModule oldModule, java.lang.AutoCloseable oldInstance) {
-        super(identifier, dependencyResolver, oldModule, oldInstance);
-    }
-
-    @Override
-    public void customValidation() {
-        // add custom validation form module attributes here.
-    }
-
-    @Override
-    public java.lang.AutoCloseable createInstance() {
-        final NetconfConsoleProvider provider = new NetconfConsoleProvider();
-        getBrokerDependency().registerProvider(provider);
-        return provider;
-    }
-}
diff --git a/netconf/netconf-console/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/netconf/console/provider/impl/rev160323/NetconfConsoleProviderModuleFactory.java b/netconf/netconf-console/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/netconf/console/provider/impl/rev160323/NetconfConsoleProviderModuleFactory.java
deleted file mode 100644 (file)
index 01c4b5f..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-/*
-* Generated file
-*
-* Generated from: yang module name: netconf-console-provider-impl yang module local name: netconf-console-provider-impl
-* Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator
-* Generated at: Wed Mar 23 18:01:12 EDT 2016
-*
-* Do not modify this file unless it is present under src/main directory
-*/
-package org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.console.provider.impl.rev160323;
-public class NetconfConsoleProviderModuleFactory extends org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.console.provider.impl.rev160323.AbstractNetconfConsoleProviderModuleFactory {
-
-}
diff --git a/netconf/netconf-console/src/main/resources/OSGI-INF/blueprint/commands.xml b/netconf/netconf-console/src/main/resources/OSGI-INF/blueprint/commands.xml
deleted file mode 100644 (file)
index 51e07b0..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
-    <reference id="netconfConsoleProvider" availability="mandatory"
-        activation="eager" interface="org.opendaylight.netconf.console.api.NetconfCommands">
-    </reference>
-    <command-bundle xmlns="http://karaf.apache.org/xmlns/shell/v1.0.0">
-        <command name="netconf:connect-device">
-            <action class="org.opendaylight.netconf.console.commands.NetconfConnectDeviceCommand">
-                <argument ref="netconfConsoleProvider"/>
-            </action>
-        </command>
-        <command name="netconf:list-devices">
-            <action class="org.opendaylight.netconf.console.commands.NetconfListDevicesCommand">
-                <argument ref="netconfConsoleProvider"/>
-            </action>
-        </command>
-        <command name="netconf:show-device">
-            <action class="org.opendaylight.netconf.console.commands.NetconfShowDeviceCommand">
-                <argument ref="netconfConsoleProvider"/>
-            </action>
-        </command>
-        <command name="netconf:disconnect-device">
-            <action class="org.opendaylight.netconf.console.commands.NetconfDisconnectDeviceCommand">
-                <argument ref="netconfConsoleProvider"/>
-            </action>
-        </command>
-        <command name="netconf:update-device">
-            <action class="org.opendaylight.netconf.console.commands.NetconfUpdateDeviceCommand">
-                <argument ref="netconfConsoleProvider"/>
-            </action>
-        </command>
-    </command-bundle>
-</blueprint>
\ No newline at end of file
diff --git a/netconf/netconf-console/src/main/resources/org/opendaylight/blueprint/netconf-command.xml b/netconf/netconf-console/src/main/resources/org/opendaylight/blueprint/netconf-command.xml
new file mode 100755 (executable)
index 0000000..68d319d
--- /dev/null
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (c) 2016 Inocybe Technologies Inc. and others.  All rights reserved.
+
+ This program and the accompanying materials are made available under the
+ terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ and is available at http://www.eclipse.org/legal/epl-v10.html
+-->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+           xmlns:odl="http://opendaylight.org/xmlns/blueprint/v1.0.0"
+           odl:use-default-for-reference-types="true">
+
+    <reference id="dataBroker"
+               interface="org.opendaylight.controller.md.sal.binding.api.DataBroker"
+               odl:type="default"/>
+
+    <bean id="netconfCommandsImpl" class="org.opendaylight.netconf.console.impl.NetconfCommandsImpl">
+        <argument ref="dataBroker"/>
+    </bean>
+    <service ref="netconfCommandsImpl" interface="org.opendaylight.netconf.console.api.NetconfCommands" />
+
+    <!--Karaf CLI-->
+
+    <command-bundle xmlns="http://karaf.apache.org/xmlns/shell/v1.0.0">
+        <command name="netconf:connect-device">
+            <action class="org.opendaylight.netconf.console.commands.NetconfConnectDeviceCommand">
+                <argument ref="netconfCommandsImpl"/>
+            </action>
+        </command>
+        <command name="netconf:list-devices">
+            <action class="org.opendaylight.netconf.console.commands.NetconfListDevicesCommand">
+                <argument ref="netconfCommandsImpl"/>
+            </action>
+        </command>
+        <command name="netconf:show-device">
+            <action class="org.opendaylight.netconf.console.commands.NetconfShowDeviceCommand">
+                <argument ref="netconfCommandsImpl"/>
+            </action>
+        </command>
+        <command name="netconf:disconnect-device">
+            <action class="org.opendaylight.netconf.console.commands.NetconfDisconnectDeviceCommand">
+                <argument ref="netconfCommandsImpl"/>
+            </action>
+        </command>
+        <command name="netconf:update-device">
+            <action class="org.opendaylight.netconf.console.commands.NetconfUpdateDeviceCommand">
+                <argument ref="netconfCommandsImpl"/>
+            </action>
+        </command>
+    </command-bundle>
+
+</blueprint>
diff --git a/netconf/netconf-console/src/main/yang/netconf-console-provider-impl.yang b/netconf/netconf-console/src/main/yang/netconf-console-provider-impl.yang
deleted file mode 100644 (file)
index bbe7ea6..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-module netconf-console-provider-impl {
-    namespace "urn:opendaylight:netconf:console:provider:impl";
-    prefix "netconf-console-provider-impl";
-
-    import config { prefix config; revision-date 2013-04-05; }
-    import opendaylight-md-sal-binding { prefix mdsal; revision-date 2013-10-28; }
-
-    revision 2016-03-23 {
-        description "Initial revision";
-    }
-
-    identity netconf-console-provider-impl {
-        base config:module-type;
-        config:java-name-prefix NetconfConsoleProvider;
-    }
-
-    augment "/config:modules/config:module/config:configuration" {
-        case netconf-console-provider-impl {
-            when "/config:modules/config:module/config:type = 'netconf-console-provider-impl'";
-            container broker {
-                uses config:service-ref {
-                    refine type {
-                        mandatory true;
-                        config:required-identity mdsal:binding-broker-osgi-registry;
-                    }
-                }
-            }
-        }
-    }
-}
\ No newline at end of file
index 1ccd575c78096d75b938360f9e679b3256605310..bafcd9bc321888f8ad91dc4f50c1e8d75176e317 100644 (file)
@@ -121,8 +121,7 @@ public class NetconfCommandsImplTest {
         bindingToNormalized.onGlobalContextUpdated(schemaContext);
         dataBroker = new BindingDOMDataBrokerAdapter(cDOMDataBroker, bindingToNormalized);
 
-        final MountPointService mountPointService = mock(MountPointService.class);
-        netconfCommands = new NetconfCommandsImpl(dataBroker, mountPointService);
+        netconfCommands = new NetconfCommandsImpl(dataBroker);
     }
 
     @Test
diff --git a/netconf/netconf-console/src/test/java/org/opendaylight/netconf/console/impl/NetconfConsoleProviderTest.java b/netconf/netconf-console/src/test/java/org/opendaylight/netconf/console/impl/NetconfConsoleProviderTest.java
deleted file mode 100644 (file)
index ef20f81..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-
-package org.opendaylight.netconf.console.impl;
-
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.eq;
-import static org.mockito.Mockito.doReturn;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.times;
-import static org.mockito.Mockito.verify;
-import static org.powermock.api.mockito.PowerMockito.when;
-
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.BDDMockito;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.binding.api.MountPointService;
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
-import org.opendaylight.netconf.console.api.NetconfCommands;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.FrameworkUtil;
-import org.powermock.api.mockito.PowerMockito;
-import org.powermock.core.classloader.annotations.PrepareForTest;
-import org.powermock.modules.junit4.PowerMockRunner;
-
-@RunWith(PowerMockRunner.class)
-@PrepareForTest(FrameworkUtil.class)
-public class NetconfConsoleProviderTest {
-
-    @Test
-    public void testProvider() throws Exception {
-        final NetconfConsoleProvider netconfConsoleProvider = new NetconfConsoleProvider();
-
-        PowerMockito.mockStatic(FrameworkUtil.class);
-
-        final BindingAwareBroker.ProviderContext session = mock(BindingAwareBroker.ProviderContext.class);
-        final MountPointService mountPointService = mock(MountPointService.class);
-        final BundleContext bundleContext = mock(BundleContext.class);
-        final DataBroker dataBroker = mock(DataBroker.class);
-        final Bundle bundle = mock(Bundle.class);
-
-        doReturn(dataBroker).when(session).getSALService(DataBroker.class);
-        doReturn(mountPointService).when(session).getSALService(MountPointService.class);
-        BDDMockito.given(FrameworkUtil.getBundle(any())).willReturn(bundle);
-        when(bundle.getBundleContext()).thenReturn(bundleContext);
-
-        netconfConsoleProvider.onSessionInitiated(session);
-
-        verify(bundleContext, times(1)).registerService(eq(NetconfCommands.class), any(NetconfCommandsImpl.class), eq(null));
-
-    }
-}