X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=nbinotifications%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Ftransportpce%2Fnbinotifications%2Fimpl%2FNbiNotificationsProviderTest.java;h=c5b2237729cd35b3f55856bac2cfd916e4985d5d;hb=198afc243c98aedfc5b30b93c1a5e3052d30868c;hp=93827286f55d8cf73e5011f3158b12fb2a5dd172;hpb=966354326af4a6dd4fa05ceca0ac02ee82721242;p=transportpce.git diff --git a/nbinotifications/src/test/java/org/opendaylight/transportpce/nbinotifications/impl/NbiNotificationsProviderTest.java b/nbinotifications/src/test/java/org/opendaylight/transportpce/nbinotifications/impl/NbiNotificationsProviderTest.java index 93827286f..c5b223772 100644 --- a/nbinotifications/src/test/java/org/opendaylight/transportpce/nbinotifications/impl/NbiNotificationsProviderTest.java +++ b/nbinotifications/src/test/java/org/opendaylight/transportpce/nbinotifications/impl/NbiNotificationsProviderTest.java @@ -11,46 +11,39 @@ import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; -import java.util.Arrays; -import org.junit.Before; -import org.junit.Test; +import com.google.common.collect.ClassToInstanceMap; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.mockito.Mock; import org.mockito.MockitoAnnotations; import org.opendaylight.mdsal.binding.api.NotificationService; import org.opendaylight.mdsal.binding.api.RpcProviderService; import org.opendaylight.transportpce.common.network.NetworkTransactionImpl; import org.opendaylight.transportpce.common.network.NetworkTransactionService; -import org.opendaylight.transportpce.common.network.RequestProcessor; -import org.opendaylight.transportpce.nbinotifications.listener.NbiNotificationsListenerImpl; import org.opendaylight.transportpce.test.AbstractTest; + public class NbiNotificationsProviderTest extends AbstractTest { public static NetworkTransactionService networkTransactionService; @Mock RpcProviderService rpcProviderRegistry; - @Mock private NotificationService notificationService; - @Before - public void init() { + @BeforeEach + void init() { MockitoAnnotations.openMocks(this); - } @Test - public void initTest() { - networkTransactionService = new NetworkTransactionImpl( - new RequestProcessor(getDataStoreContextUtil().getDataBroker())); - NbiNotificationsProvider provider = new NbiNotificationsProvider( - Arrays.asList("topic1", "topic2"), Arrays.asList("topic1", "topic2"), "localhost:8080", - "localhost:8080", rpcProviderRegistry, notificationService, - getDataStoreContextUtil().getBindingDOMCodecServices(), networkTransactionService); - provider.init(); - verify(rpcProviderRegistry, times(2)) - .registerRpcImplementation(any(), any(NbiNotificationsImpl.class)); + void initTest() { + networkTransactionService = new NetworkTransactionImpl(getDataBroker()); + new NbiNotificationsProvider("localhost:8080", "localhost:8080", + rpcProviderRegistry, notificationService, getDataStoreContextUtil().getBindingDOMCodecServices(), + networkTransactionService); + verify(rpcProviderRegistry, times(1)).registerRpcImplementations(any(ClassToInstanceMap.class)); verify(notificationService, times(1)) - .registerNotificationListener(any(NbiNotificationsListenerImpl.class)); + .registerCompositeListener(any(NotificationService.CompositeListener.class)); } }