ServiceDatastore instantiation in ServiceHandler
[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.servicehandler.service.ServiceDataStoreOperations;
23 import org.opendaylight.transportpce.test.AbstractTest;
24
25 public class ServicehandlerProviderTest  extends AbstractTest {
26
27     @Mock
28     private PathComputationService pathComputationService;
29
30     @Mock
31     private RendererServiceOperations rendererServiceOperations;
32
33     @Mock
34     private NotificationPublishService notificationPublishService;
35
36     @Mock
37     RpcProviderService rpcProviderRegistry;
38
39     @Mock
40     ServiceDataStoreOperations serviceDataStoreOperations;
41
42     @Before
43     public void init() {
44         MockitoAnnotations.initMocks(this);
45
46     }
47
48     @Test
49     public void testInitRegisterServiceHandlerToRpcRegistry() {
50         ServicehandlerProvider provider =  new ServicehandlerProvider(
51                 getDataBroker(), rpcProviderRegistry,
52                 getNotificationService() , pathComputationService,
53                 rendererServiceOperations, notificationPublishService, serviceDataStoreOperations);
54
55         provider.init();
56
57         verify(rpcProviderRegistry, times(1))
58                 .registerRpcImplementation(any(), any(ServicehandlerImpl.class));
59     }
60
61
62
63
64
65 }