X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fnetconf%2Fnetconf-impl%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fnetconf%2Fimpl%2Fosgi%2FNetconfImplActivatorTest.java;h=2fb989507c54f7f3aa065407a6664d554c7cd051;hp=b59ea884c5631122f3689bf6b8a1e61ee2943d32;hb=5c008222efa5c0af49cf8a52881a6299b1e249dc;hpb=0eba94d9411ea40945ddc8c732640c0cc004599f diff --git a/opendaylight/netconf/netconf-impl/src/test/java/org/opendaylight/controller/netconf/impl/osgi/NetconfImplActivatorTest.java b/opendaylight/netconf/netconf-impl/src/test/java/org/opendaylight/controller/netconf/impl/osgi/NetconfImplActivatorTest.java index b59ea884c5..2fb989507c 100644 --- a/opendaylight/netconf/netconf-impl/src/test/java/org/opendaylight/controller/netconf/impl/osgi/NetconfImplActivatorTest.java +++ b/opendaylight/netconf/netconf-impl/src/test/java/org/opendaylight/controller/netconf/impl/osgi/NetconfImplActivatorTest.java @@ -8,19 +8,23 @@ package org.opendaylight.controller.netconf.impl.osgi; +import static org.mockito.Matchers.any; +import static org.mockito.Mockito.anyString; +import static org.mockito.Mockito.doNothing; +import static org.mockito.Mockito.doReturn; +import static org.mockito.Mockito.verify; + import java.util.Arrays; -import java.util.Collection; import java.util.Dictionary; import org.junit.Before; import org.junit.Test; import org.mockito.Mock; import org.mockito.MockitoAnnotations; -import org.opendaylight.controller.netconf.api.monitoring.NetconfMonitoringService; -import org.opendaylight.controller.netconf.mapping.api.NetconfOperationProvider; -import org.osgi.framework.*; - -import static org.mockito.Matchers.any; -import static org.mockito.Mockito.*; +import org.osgi.framework.BundleContext; +import org.osgi.framework.Filter; +import org.osgi.framework.ServiceListener; +import org.osgi.framework.ServiceReference; +import org.osgi.framework.ServiceRegistration; public class NetconfImplActivatorTest { @@ -29,9 +33,9 @@ public class NetconfImplActivatorTest { @Mock private Filter filter; @Mock - private ServiceReference reference; + private ServiceReference reference; @Mock - private ServiceRegistration registration; + private ServiceRegistration registration; @Before public void setUp() throws Exception { @@ -39,11 +43,11 @@ public class NetconfImplActivatorTest { doReturn(filter).when(bundle).createFilter(anyString()); doNothing().when(bundle).addServiceListener(any(ServiceListener.class), anyString()); - ServiceReference[] refs = new ServiceReference[0]; + ServiceReference[] refs = {}; doReturn(refs).when(bundle).getServiceReferences(anyString(), anyString()); doReturn(Arrays.asList(refs)).when(bundle).getServiceReferences(any(Class.class), anyString()); doReturn("").when(bundle).getProperty(anyString()); - doReturn(registration).when(bundle).registerService(any(Class.class), any(NetconfOperationServiceFactoryListenerImpl.class), any(Dictionary.class)); + doReturn(registration).when(bundle).registerService(any(Class.class), any(AggregatedNetconfOperationServiceFactory.class), any(Dictionary.class)); doNothing().when(registration).unregister(); doNothing().when(bundle).removeServiceListener(any(ServiceListener.class)); } @@ -52,7 +56,7 @@ public class NetconfImplActivatorTest { public void testStart() throws Exception { NetconfImplActivator activator = new NetconfImplActivator(); activator.start(bundle); - verify(bundle, times(2)).registerService(any(Class.class), any(NetconfOperationServiceFactoryListenerImpl.class), any(Dictionary.class)); + verify(bundle).registerService(any(Class.class), any(AggregatedNetconfOperationServiceFactory.class), any(Dictionary.class)); activator.stop(bundle); } }