X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=netconf%2Fnetconf-impl%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fnetconf%2Fimpl%2Fosgi%2FNetconfImplActivatorTest.java;h=4e6a94c083c53bc6f5154721049a51caafc0ed4b;hb=bd6ecc76e3076240630fd197d5cf6fd812ba8abb;hp=5f8c6d2aa46f858c39d21e330b298b2d9adc8ea2;hpb=9c56fbbb1c62243df9baa3b95140153f91ffdde9;p=netconf.git diff --git a/netconf/netconf-impl/src/test/java/org/opendaylight/netconf/impl/osgi/NetconfImplActivatorTest.java b/netconf/netconf-impl/src/test/java/org/opendaylight/netconf/impl/osgi/NetconfImplActivatorTest.java index 5f8c6d2aa4..4e6a94c083 100644 --- a/netconf/netconf-impl/src/test/java/org/opendaylight/netconf/impl/osgi/NetconfImplActivatorTest.java +++ b/netconf/netconf-impl/src/test/java/org/opendaylight/netconf/impl/osgi/NetconfImplActivatorTest.java @@ -8,8 +8,8 @@ package org.opendaylight.netconf.impl.osgi; -import static org.mockito.Matchers.any; -import static org.mockito.Mockito.anyString; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.Mockito.doNothing; import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.verify; @@ -36,17 +36,22 @@ public class NetconfImplActivatorTest { private ServiceReference reference; @Mock private ServiceRegistration registration; + @Mock + private ServiceRegistration monRegistration; @Before public void setUp() throws Exception { MockitoAnnotations.initMocks(this); doReturn(filter).when(bundle).createFilter(anyString()); - doNothing().when(bundle).addServiceListener(any(ServiceListener.class), anyString()); + doNothing().when(bundle).addServiceListener(any(ServiceListener.class), any()); ServiceReference[] refs = {}; - doReturn(refs).when(bundle).getServiceReferences(anyString(), anyString()); - doReturn(Arrays.asList(refs)).when(bundle).getServiceReferences(any(Class.class), anyString()); + doReturn(refs).when(bundle).getServiceReferences(anyString(), any()); + doReturn(Arrays.asList(refs)).when(bundle).getServiceReferences(any(Class.class), any()); doReturn("").when(bundle).getProperty(anyString()); + doReturn(monRegistration).when(bundle).registerService(any(Class.class), + any(NetconfMonitoringServiceImpl.class), any(Dictionary.class)); + doNothing().when(monRegistration).unregister(); doReturn(registration).when(bundle).registerService(any(Class.class), any(AggregatedNetconfOperationServiceFactory.class), any(Dictionary.class)); doNothing().when(registration).unregister(); @@ -57,7 +62,7 @@ public class NetconfImplActivatorTest { public void testStart() throws Exception { NetconfImplActivator activator = new NetconfImplActivator(); activator.start(bundle); - verify(bundle).registerService(any(Class.class), any(AggregatedNetconfOperationServiceFactory.class), + verify(bundle).registerService(any(Class.class), any(NetconfMonitoringServiceImpl.class), any(Dictionary.class)); activator.stop(bundle); }