2 * Copyright © 2020 Orange, Inc. and others. All rights reserved.
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
8 package org.opendaylight.transportpce.nbinotifications.impl;
10 import static org.mockito.ArgumentMatchers.any;
11 import static org.mockito.Mockito.times;
12 import static org.mockito.Mockito.verify;
14 import java.util.Arrays;
15 import org.junit.Before;
16 import org.junit.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.nbinotifications.listener.NbiNotificationsListenerImpl;
22 import org.opendaylight.transportpce.test.AbstractTest;
24 public class NbiNotificationsProviderTest extends AbstractTest {
27 RpcProviderService rpcProviderRegistry;
30 private NotificationService notificationService;
34 MockitoAnnotations.openMocks(this);
39 public void initTest() {
40 NbiNotificationsProvider provider = new NbiNotificationsProvider(
41 Arrays.asList("topic1", "topic2"), "localhost:8080", "localhost:8080",
42 rpcProviderRegistry, notificationService,
43 getDataStoreContextUtil().getBindingDOMCodecServices());
45 verify(rpcProviderRegistry, times(1))
46 .registerRpcImplementation(any(), any(NbiNotificationsImpl.class));
47 verify(notificationService, times(1))
48 .registerNotificationListener(any(NbiNotificationsListenerImpl.class));