Merge "Fix channelInactive event handling in the netty pipeline for netconf."
[controller.git] / opendaylight / netconf / netconf-monitoring / src / test / java / org / opendaylight / controller / netconf / monitoring / osgi / NetconfMonitoringActivatorTest.java
index 40493569d68adaf9ec54f9249cbe7fac8ab11bdc..792a591512baad9d9088e801c440e05b643fb780 100644 (file)
@@ -8,6 +8,13 @@
 
 package org.opendaylight.controller.netconf.monitoring.osgi;
 
+import static org.mockito.Matchers.any;
+import static org.mockito.Matchers.anyString;
+import static org.mockito.Mockito.doNothing;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+
 import java.util.Arrays;
 import org.junit.Before;
 import org.junit.Test;
@@ -18,10 +25,6 @@ import org.osgi.framework.Filter;
 import org.osgi.framework.ServiceListener;
 import org.osgi.framework.ServiceReference;
 
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.anyString;
-import static org.mockito.Mockito.*;
-
 public class NetconfMonitoringActivatorTest {
 
     @Mock
@@ -34,9 +37,10 @@ public class NetconfMonitoringActivatorTest {
         MockitoAnnotations.initMocks(this);
         doReturn(filter).when(context).createFilter(anyString());
         doNothing().when(context).addServiceListener(any(ServiceListener.class), anyString());
-        ServiceReference[] refs = new ServiceReference[2];
+        ServiceReference<?>[] refs = new ServiceReference[2];
         doReturn(Arrays.asList(refs)).when(context).getServiceReferences(any(Class.class), anyString());
         doReturn(refs).when(context).getServiceReferences(anyString(), anyString());
+        doNothing().when(context).removeServiceListener(any(ServiceListener.class));
     }
 
     @Test