923944b655de0f165e60f93748fe74112735c8c4
[transportpce.git] / servicehandler / src / test / java / org / opendaylight / transportpce / servicehandler / impl / ServicehandlerProviderTest.java
1 /*
2  * Copyright © 2019 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.servicehandler.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 org.junit.Before;
15 import org.junit.Test;
16 import org.mockito.Mock;
17 import org.mockito.MockitoAnnotations;
18 import org.opendaylight.mdsal.binding.api.NotificationPublishService;
19 import org.opendaylight.mdsal.binding.api.RpcProviderService;
20 import org.opendaylight.transportpce.pce.service.PathComputationService;
21 import org.opendaylight.transportpce.renderer.provisiondevice.RendererServiceOperations;
22 import org.opendaylight.transportpce.test.AbstractTest;
23
24 public class ServicehandlerProviderTest  extends AbstractTest {
25
26     @Mock
27     private PathComputationService pathComputationService;
28
29     @Mock
30     private RendererServiceOperations rendererServiceOperations;
31
32     @Mock
33     private NotificationPublishService notificationPublishService;
34
35     @Mock
36     RpcProviderService rpcProviderRegistry;
37
38     @Before
39     public void init() {
40         MockitoAnnotations.initMocks(this);
41
42     }
43
44     @Test
45     public void testInitRegisterServiceHandlerToRpcRegistry() {
46         ServicehandlerProvider provider =  new ServicehandlerProvider(
47                 getDataBroker(), rpcProviderRegistry,
48                 getNotificationService() , pathComputationService,
49                 rendererServiceOperations, notificationPublishService);
50
51         provider.init();
52
53         verify(rpcProviderRegistry, times(1))
54                 .registerRpcImplementation(any(), any(ServicehandlerImpl.class));
55     }
56
57
58
59
60
61 }