Bump upstream dependencies to latest Ca versions
[transportpce.git] / nbinotifications / src / test / java / org / opendaylight / transportpce / nbinotifications / impl / NbiNotificationsProviderTest.java
1 /*
2  * Copyright © 2020 Orange, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.transportpce.nbinotifications.impl;
9
10 import static org.mockito.ArgumentMatchers.any;
11 import static org.mockito.Mockito.times;
12 import static org.mockito.Mockito.verify;
13
14 import com.google.common.collect.ClassToInstanceMap;
15 import org.junit.jupiter.api.BeforeEach;
16 import org.junit.jupiter.api.Test;
17 import org.mockito.Mock;
18 import org.mockito.MockitoAnnotations;
19 import org.opendaylight.mdsal.binding.api.NotificationService;
20 import org.opendaylight.mdsal.binding.api.RpcProviderService;
21 import org.opendaylight.transportpce.common.network.NetworkTransactionImpl;
22 import org.opendaylight.transportpce.common.network.NetworkTransactionService;
23 import org.opendaylight.transportpce.test.AbstractTest;
24
25
26 public class NbiNotificationsProviderTest  extends AbstractTest {
27     public static NetworkTransactionService networkTransactionService;
28
29     @Mock
30     RpcProviderService rpcProviderRegistry;
31     @Mock
32     private NotificationService notificationService;
33
34     @BeforeEach
35     void init() {
36         MockitoAnnotations.openMocks(this);
37     }
38
39     @Test
40     void initTest() {
41         networkTransactionService = new NetworkTransactionImpl(getDataBroker());
42         new NbiNotificationsProvider("localhost:8080", "localhost:8080",
43                 rpcProviderRegistry, notificationService, getDataStoreContextUtil().getBindingDOMCodecServices(),
44                 networkTransactionService);
45         verify(rpcProviderRegistry, times(1)).registerRpcImplementations(any(ClassToInstanceMap.class));
46         verify(notificationService, times(1))
47                 .registerCompositeListener(any(NotificationService.CompositeListener.class));
48     }
49 }