2 * Copyright © 2019 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.servicehandler.impl;
10 import static org.mockito.ArgumentMatchers.any;
11 import static org.opendaylight.transportpce.servicehandler.impl.ServicehandlerImpl.LogMessages;
13 import com.google.common.util.concurrent.Futures;
14 import com.google.common.util.concurrent.ListenableFuture;
15 import com.google.common.util.concurrent.ListeningExecutorService;
16 import com.google.common.util.concurrent.MoreExecutors;
17 import java.util.concurrent.CountDownLatch;
18 import java.util.concurrent.ExecutionException;
19 import java.util.concurrent.Executors;
20 import org.junit.Assert;
21 import org.junit.Before;
22 import org.junit.Test;
23 import org.mockito.Mock;
24 import org.mockito.Mockito;
25 import org.mockito.MockitoAnnotations;
26 import org.opendaylight.mdsal.binding.api.DataBroker;
27 import org.opendaylight.mdsal.binding.api.NotificationPublishService;
28 import org.opendaylight.transportpce.common.ResponseCodes;
29 import org.opendaylight.transportpce.pce.service.PathComputationService;
30 import org.opendaylight.transportpce.renderer.provisiondevice.RendererServiceOperations;
31 import org.opendaylight.transportpce.servicehandler.listeners.NetworkModelListenerImpl;
32 import org.opendaylight.transportpce.servicehandler.listeners.PceListenerImpl;
33 import org.opendaylight.transportpce.servicehandler.listeners.RendererListenerImpl;
34 import org.opendaylight.transportpce.servicehandler.service.ServiceDataStoreOperations;
35 import org.opendaylight.transportpce.servicehandler.service.ServiceDataStoreOperationsImpl;
36 import org.opendaylight.transportpce.servicehandler.utils.ServiceDataUtils;
37 import org.opendaylight.transportpce.test.AbstractTest;
38 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev211210.ServiceCreateInput;
39 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev211210.ServiceCreateInputBuilder;
40 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev211210.ServiceCreateOutput;
41 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev211210.ServiceDeleteInput;
42 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev211210.ServiceDeleteInputBuilder;
43 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev211210.ServiceDeleteOutput;
44 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev211210.ServiceFeasibilityCheckInput;
45 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev211210.ServiceFeasibilityCheckInputBuilder;
46 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev211210.ServiceFeasibilityCheckOutput;
47 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev211210.ServiceReconfigureInput;
48 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev211210.ServiceReconfigureInputBuilder;
49 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev211210.ServiceReconfigureOutput;
50 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev211210.ServiceRerouteInput;
51 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev211210.ServiceRerouteInputBuilder;
52 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev211210.ServiceRerouteOutput;
53 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev211210.ServiceRestorationInput;
54 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev211210.ServiceRestorationInputBuilder;
55 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev211210.ServiceRestorationOutput;
56 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev211210.TempServiceCreateInput;
57 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev211210.TempServiceCreateInputBuilder;
58 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev211210.TempServiceCreateOutput;
59 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev211210.TempServiceDeleteInput;
60 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev211210.TempServiceDeleteInputBuilder;
61 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev211210.TempServiceDeleteOutput;
62 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev211210.service.delete.input.ServiceDeleteReqInfoBuilder;
63 import org.opendaylight.yangtools.yang.common.RpcResult;
65 public class ServicehandlerImplTest extends AbstractTest {
68 private PathComputationService pathComputationService;
71 private RendererServiceOperations rendererServiceOperations;
74 private NotificationPublishService notificationPublishService;
77 private PceListenerImpl pceListenerImpl;
80 private RendererListenerImpl rendererListenerImpl;
83 private NetworkModelListenerImpl networkModelListenerImpl;
85 private ServiceDataStoreOperations serviceDataStoreOperations;
86 private ListeningExecutorService executorService;
87 private CountDownLatch endSignal;
88 private static final int NUM_THREADS = 5;
92 executorService = MoreExecutors.listeningDecorator(Executors.newFixedThreadPool(NUM_THREADS));
93 endSignal = new CountDownLatch(1);
94 MockitoAnnotations.openMocks(this);
95 this.serviceDataStoreOperations = new ServiceDataStoreOperationsImpl(getNewDataBroker());
99 public void createServiceShouldBeFailedWithEmptyInput() throws ExecutionException, InterruptedException {
100 ServicehandlerImpl servicehandlerImpl =
101 new ServicehandlerImpl(getNewDataBroker(), pathComputationService, rendererServiceOperations,
102 notificationPublishService, pceListenerImpl, rendererListenerImpl, networkModelListenerImpl,
103 serviceDataStoreOperations);
104 ListenableFuture<RpcResult<ServiceCreateOutput>> result =
105 servicehandlerImpl.serviceCreate(new ServiceCreateInputBuilder().build());
106 result.addListener(new Runnable() {
109 endSignal.countDown();
115 RpcResult<ServiceCreateOutput> rpcResult = result.get();
117 ResponseCodes.RESPONSE_FAILED, rpcResult.getResult().getConfigurationResponseCommon().getResponseCode());
121 public void createServiceShouldBeSuccessfulWhenPreformPCESuccessful()
122 throws ExecutionException, InterruptedException {
123 ServiceCreateInput input = ServiceDataUtils.buildServiceCreateInput();
124 Mockito.when(pathComputationService.pathComputationRequest(any())).thenReturn(Futures.immediateFuture(any()));
125 ServicehandlerImpl servicehandlerImpl =
126 new ServicehandlerImpl(getNewDataBroker(), pathComputationService, rendererServiceOperations,
127 notificationPublishService, pceListenerImpl, rendererListenerImpl, networkModelListenerImpl,
128 serviceDataStoreOperations);
129 ListenableFuture<RpcResult<ServiceCreateOutput>> result = servicehandlerImpl.serviceCreate(input);
130 result.addListener(new Runnable() {
133 endSignal.countDown();
139 RpcResult<ServiceCreateOutput> rpcResult = result.get();
141 ResponseCodes.RESPONSE_OK, rpcResult.getResult().getConfigurationResponseCommon().getResponseCode());
145 public void deleteServiceShouldBeFailedWithEmptyInput() throws ExecutionException, InterruptedException {
146 ServicehandlerImpl servicehandlerImpl =
147 new ServicehandlerImpl(getNewDataBroker(), pathComputationService, rendererServiceOperations,
148 notificationPublishService, pceListenerImpl, rendererListenerImpl, networkModelListenerImpl,
149 serviceDataStoreOperations);
150 ListenableFuture<RpcResult<ServiceDeleteOutput>> result =
151 servicehandlerImpl.serviceDelete(new ServiceDeleteInputBuilder()
152 .setServiceDeleteReqInfo(new ServiceDeleteReqInfoBuilder().setServiceName("").build()).build());
153 result.addListener(new Runnable() {
156 endSignal.countDown();
162 RpcResult<ServiceDeleteOutput> rpcResult = result.get();
164 ResponseCodes.RESPONSE_FAILED, rpcResult.getResult().getConfigurationResponseCommon().getResponseCode());
168 public void deleteServiceShouldBeFailedWithNonExistService() throws ExecutionException, InterruptedException {
169 ServiceDeleteInput input = ServiceDataUtils.buildServiceDeleteInput();
170 ServicehandlerImpl servicehandlerImpl =
171 new ServicehandlerImpl(getNewDataBroker(), pathComputationService, rendererServiceOperations,
172 notificationPublishService, pceListenerImpl, rendererListenerImpl, networkModelListenerImpl,
173 serviceDataStoreOperations);
174 ListenableFuture<RpcResult<ServiceDeleteOutput>> result = servicehandlerImpl.serviceDelete(input);
175 result.addListener(new Runnable() {
178 endSignal.countDown();
184 RpcResult<ServiceDeleteOutput> rpcResult = result.get();
186 ResponseCodes.RESPONSE_FAILED, rpcResult.getResult().getConfigurationResponseCommon().getResponseCode());
190 public void deleteServiceShouldBeSuccessForExistingService() throws ExecutionException, InterruptedException {
191 DataBroker dataBroker = getNewDataBroker();
192 Mockito.when(rendererServiceOperations.serviceDelete(any(), any())).thenReturn(Futures.immediateFuture(any()));
193 ServicehandlerImpl servicehandlerImpl =
194 new ServicehandlerImpl(dataBroker, pathComputationService, rendererServiceOperations,
195 notificationPublishService, pceListenerImpl, rendererListenerImpl, networkModelListenerImpl,
196 serviceDataStoreOperations);
197 ServiceCreateInput createInput = ServiceDataUtils.buildServiceCreateInput();
198 serviceDataStoreOperations.createService(createInput);
199 ServiceDeleteInput input = ServiceDataUtils.buildServiceDeleteInput();
200 ListenableFuture<RpcResult<ServiceDeleteOutput>> result = servicehandlerImpl.serviceDelete(input);
201 result.addListener(new Runnable() {
204 endSignal.countDown();
210 RpcResult<ServiceDeleteOutput> rpcResult = result.get();
212 ResponseCodes.RESPONSE_OK, rpcResult.getResult().getConfigurationResponseCommon().getResponseCode());
217 public void serviceFeasibilityCheckShouldBeFailedWithEmptyInput() throws ExecutionException, InterruptedException {
218 ServicehandlerImpl servicehandlerImpl =
219 new ServicehandlerImpl(getNewDataBroker(), pathComputationService, rendererServiceOperations,
220 notificationPublishService, pceListenerImpl, rendererListenerImpl, networkModelListenerImpl,
221 serviceDataStoreOperations);
222 ListenableFuture<RpcResult<ServiceFeasibilityCheckOutput>> result =
223 servicehandlerImpl.serviceFeasibilityCheck(new ServiceFeasibilityCheckInputBuilder().build());
224 result.addListener(new Runnable() {
227 endSignal.countDown();
233 RpcResult<ServiceFeasibilityCheckOutput> rpcResult = result.get();
235 ResponseCodes.RESPONSE_FAILED, rpcResult.getResult().getConfigurationResponseCommon().getResponseCode());
239 public void serviceFeasibilityCheckShouldBeSuccessfulWhenPreformPCESuccessful()
240 throws ExecutionException, InterruptedException {
241 ServiceFeasibilityCheckInput input = ServiceDataUtils.buildServiceFeasibilityCheckInput();
242 Mockito.when(pathComputationService.pathComputationRequest(any())).thenReturn(Futures.immediateFuture(any()));
243 ServicehandlerImpl servicehandlerImpl =
244 new ServicehandlerImpl(getNewDataBroker(), pathComputationService, rendererServiceOperations,
245 notificationPublishService, pceListenerImpl, rendererListenerImpl, networkModelListenerImpl,
246 serviceDataStoreOperations);
247 ListenableFuture<RpcResult<ServiceFeasibilityCheckOutput>> result =
248 servicehandlerImpl.serviceFeasibilityCheck(input);
249 result.addListener(new Runnable() {
252 endSignal.countDown();
258 RpcResult<ServiceFeasibilityCheckOutput> rpcResult = result.get();
260 ResponseCodes.RESPONSE_OK, rpcResult.getResult().getConfigurationResponseCommon().getResponseCode());
264 public void serviceReconfigureShouldBeFailedWithEmptyInput() throws ExecutionException, InterruptedException {
265 ServicehandlerImpl servicehandlerImpl =
266 new ServicehandlerImpl(getNewDataBroker(), pathComputationService, rendererServiceOperations,
267 notificationPublishService, pceListenerImpl, rendererListenerImpl, networkModelListenerImpl,
268 serviceDataStoreOperations);
269 ListenableFuture<RpcResult<ServiceReconfigureOutput>> result =
270 servicehandlerImpl.serviceReconfigure(new ServiceReconfigureInputBuilder().setServiceName("").build());
271 result.addListener(new Runnable() {
274 endSignal.countDown();
283 public void serviceReconfigureShouldBeFailedWithNonExistService() throws ExecutionException, InterruptedException {
284 ServiceReconfigureInput input = ServiceDataUtils.buildServiceReconfigureInput();
286 //action -> service reconfigure
287 ServicehandlerImpl servicehandlerImpl =
288 new ServicehandlerImpl(getNewDataBroker(), pathComputationService, rendererServiceOperations,
289 notificationPublishService, pceListenerImpl, rendererListenerImpl, networkModelListenerImpl,
290 serviceDataStoreOperations);
291 ListenableFuture<RpcResult<ServiceReconfigureOutput>> result = servicehandlerImpl.serviceReconfigure(input);
293 result.addListener(new Runnable() {
296 endSignal.countDown();
304 public void serviceReconfigureShouldBeSuccessForExistingService() throws ExecutionException, InterruptedException {
305 DataBroker dataBroker = getNewDataBroker();
308 // serviceReconfigure is calling service delete method in renderer
309 Mockito.when(rendererServiceOperations.serviceDelete(any(), any())).thenReturn(Futures.immediateFuture(any()));
310 //create service to reconfigure
311 ServicehandlerImpl servicehandlerImpl =
312 new ServicehandlerImpl(dataBroker, pathComputationService, rendererServiceOperations,
313 notificationPublishService, pceListenerImpl, rendererListenerImpl, networkModelListenerImpl,
314 serviceDataStoreOperations);
315 ServiceCreateInput createInput = ServiceDataUtils.buildServiceCreateInput();
316 serviceDataStoreOperations.createService(createInput);
318 //service reconfigure test action
319 ServiceReconfigureInput input = ServiceDataUtils.buildServiceReconfigureInput();
320 //ServiceReconfigureInput is created with the same service information that is created before
321 ListenableFuture<RpcResult<ServiceReconfigureOutput>> result = servicehandlerImpl.serviceReconfigure(input);
322 result.addListener(new Runnable() {
325 endSignal.countDown();
333 public void serviceReRestorationShouldBeFailedWithEmptyInput() throws ExecutionException, InterruptedException {
334 ServicehandlerImpl servicehandlerImpl =
335 new ServicehandlerImpl(getNewDataBroker(), pathComputationService, rendererServiceOperations,
336 notificationPublishService, pceListenerImpl, rendererListenerImpl, networkModelListenerImpl,
337 serviceDataStoreOperations);
338 ListenableFuture<RpcResult<ServiceRestorationOutput>> result =
339 servicehandlerImpl.serviceRestoration(new ServiceRestorationInputBuilder().setServiceName("").build());
340 result.addListener(new Runnable() {
343 endSignal.countDown();
352 public void serviceRestorationShouldBeFailedWithNonExistService() throws ExecutionException, InterruptedException {
353 ServiceRestorationInput input = ServiceDataUtils.buildServiceRestorationInput();
355 //action -> service restore
356 ServicehandlerImpl servicehandlerImpl =
357 new ServicehandlerImpl(getNewDataBroker(), pathComputationService, rendererServiceOperations,
358 notificationPublishService, pceListenerImpl, rendererListenerImpl, networkModelListenerImpl,
359 serviceDataStoreOperations);
360 ListenableFuture<RpcResult<ServiceRestorationOutput>> result = servicehandlerImpl.serviceRestoration(input);
362 result.addListener(new Runnable() {
365 endSignal.countDown();
373 public void serviceRestorationShouldBeSuccessForExistingService() throws ExecutionException, InterruptedException {
374 DataBroker dataBroker = getNewDataBroker();
377 // serviceRestoration is calling service delete method in renderer
378 Mockito.when(rendererServiceOperations.serviceDelete(any(), any())).thenReturn(Futures.immediateFuture(any()));
379 //create service to restore
380 ServicehandlerImpl servicehandlerImpl =
381 new ServicehandlerImpl(dataBroker, pathComputationService, rendererServiceOperations,
382 notificationPublishService, pceListenerImpl, rendererListenerImpl, networkModelListenerImpl,
383 serviceDataStoreOperations);
384 ServiceCreateInput createInput = ServiceDataUtils.buildServiceCreateInput();
385 serviceDataStoreOperations.createService(createInput);
387 //service Restoration test action
388 ServiceRestorationInput input = ServiceDataUtils.buildServiceRestorationInput();
389 //ServiceRestorationInput is created with the same service information that is created before
390 ListenableFuture<RpcResult<ServiceRestorationOutput>> result = servicehandlerImpl.serviceRestoration(input);
391 result.addListener(new Runnable() {
394 endSignal.countDown();
402 public void serviceRerouteShouldBeFailedWithEmptyInput() throws ExecutionException, InterruptedException {
403 ServicehandlerImpl servicehandlerImpl =
404 new ServicehandlerImpl(getNewDataBroker(), pathComputationService, rendererServiceOperations,
405 notificationPublishService, pceListenerImpl, rendererListenerImpl, networkModelListenerImpl,
406 serviceDataStoreOperations);
407 ListenableFuture<RpcResult<ServiceRerouteOutput>> result =
408 servicehandlerImpl.serviceReroute(new ServiceRerouteInputBuilder().setServiceName("").build());
409 result.addListener(new Runnable() {
412 endSignal.countDown();
420 public void serviceRerouteShouldBeFailedWithNonExistService() throws ExecutionException, InterruptedException {
421 ServiceRerouteInput input = ServiceDataUtils.buildServiceRerouteInput();
423 //action -> service reconfigure
424 ServicehandlerImpl servicehandlerImpl =
425 new ServicehandlerImpl(getNewDataBroker(), pathComputationService, rendererServiceOperations,
426 notificationPublishService, pceListenerImpl, rendererListenerImpl, networkModelListenerImpl,
427 serviceDataStoreOperations);
428 ListenableFuture<RpcResult<ServiceRerouteOutput>> result = servicehandlerImpl.serviceReroute(input);
430 result.addListener(new Runnable() {
433 endSignal.countDown();
441 public void serviceRerouteShouldBeSuccessForExistingService() throws ExecutionException, InterruptedException {
442 DataBroker dataBroker = getNewDataBroker();
445 // serviceReroute is calling service delete method in renderer
446 Mockito.when(rendererServiceOperations.serviceDelete(any(), any())).thenReturn(Futures.immediateFuture(any()));
447 //create service to be rerouted later
448 ServicehandlerImpl servicehandlerImpl =
449 new ServicehandlerImpl(dataBroker, pathComputationService, rendererServiceOperations,
450 notificationPublishService, pceListenerImpl, rendererListenerImpl, networkModelListenerImpl,
451 serviceDataStoreOperations);
452 ServiceCreateInput createInput = ServiceDataUtils.buildServiceCreateInput();
453 serviceDataStoreOperations.createService(createInput);
455 //service reroute test action
456 ServiceRerouteInput input = ServiceDataUtils.buildServiceRerouteInput();
457 //ServiceRerouteInput is created with the same service information that is created before
458 ListenableFuture<RpcResult<ServiceRerouteOutput>> result = servicehandlerImpl.serviceReroute(input);
459 result.addListener(new Runnable() {
462 endSignal.countDown();
470 public void tempServiceDeleteShouldBeFailedWithEmptyInput() throws ExecutionException, InterruptedException {
471 ServicehandlerImpl servicehandlerImpl =
472 new ServicehandlerImpl(getNewDataBroker(), pathComputationService, rendererServiceOperations,
473 notificationPublishService, pceListenerImpl, rendererListenerImpl, networkModelListenerImpl,
474 serviceDataStoreOperations);
475 ListenableFuture<RpcResult<TempServiceDeleteOutput>> result =
476 servicehandlerImpl.tempServiceDelete(new TempServiceDeleteInputBuilder()
477 .setCommonId("").build());
478 result.addListener(new Runnable() {
481 endSignal.countDown();
487 RpcResult<TempServiceDeleteOutput> rpcResult = result.get();
489 ResponseCodes.RESPONSE_FAILED, rpcResult.getResult().getConfigurationResponseCommon().getResponseCode());
491 LogMessages.SERVICE_NON_COMPLIANT,
492 rpcResult.getResult().getConfigurationResponseCommon().getResponseMessage());
496 public void tempServiceDeleteShouldBeFailedWithNonExistService() throws ExecutionException, InterruptedException {
497 TempServiceDeleteInput input = ServiceDataUtils.buildTempServiceDeleteInput();
498 ServicehandlerImpl servicehandlerImpl =
499 new ServicehandlerImpl(getNewDataBroker(), pathComputationService, rendererServiceOperations,
500 notificationPublishService, pceListenerImpl, rendererListenerImpl, networkModelListenerImpl,
501 serviceDataStoreOperations);
502 ListenableFuture<RpcResult<TempServiceDeleteOutput>> result = servicehandlerImpl.tempServiceDelete(input);
503 result.addListener(new Runnable() {
506 endSignal.countDown();
512 RpcResult<TempServiceDeleteOutput> rpcResult = result.get();
514 ResponseCodes.RESPONSE_FAILED, rpcResult.getResult().getConfigurationResponseCommon().getResponseCode());
518 public void tempServiceDeleteShouldBeSuccessForExistingService() throws ExecutionException, InterruptedException {
519 DataBroker dataBroker = getNewDataBroker();
520 Mockito.when(rendererServiceOperations.serviceDelete(any(), any())).thenReturn(Futures.immediateFuture(any()));
522 //create temp service to delete in the temp delete action
523 ServicehandlerImpl servicehandlerImpl =
524 new ServicehandlerImpl(dataBroker, pathComputationService, rendererServiceOperations,
525 notificationPublishService, pceListenerImpl, rendererListenerImpl, networkModelListenerImpl,
526 serviceDataStoreOperations);
527 TempServiceCreateInput createInput = ServiceDataUtils.buildTempServiceCreateInput();
528 serviceDataStoreOperations.createTempService(createInput);
531 TempServiceDeleteInput input = ServiceDataUtils.buildTempServiceDeleteInput(createInput.getCommonId());
532 ListenableFuture<RpcResult<TempServiceDeleteOutput>> result = servicehandlerImpl.tempServiceDelete(input);
533 result.addListener(new Runnable() {
536 endSignal.countDown();
542 RpcResult<TempServiceDeleteOutput> rpcResult = result.get();
544 ResponseCodes.RESPONSE_OK, rpcResult.getResult().getConfigurationResponseCommon().getResponseCode());
548 public void tempServiceCreateShouldBeFailedWithEmptyInput() throws ExecutionException, InterruptedException {
549 ServicehandlerImpl servicehandlerImpl =
550 new ServicehandlerImpl(getNewDataBroker(), pathComputationService, rendererServiceOperations,
551 notificationPublishService, pceListenerImpl, rendererListenerImpl, networkModelListenerImpl,
552 serviceDataStoreOperations);
553 ListenableFuture<RpcResult<TempServiceCreateOutput>> result =
554 servicehandlerImpl.tempServiceCreate(new TempServiceCreateInputBuilder().build());
555 result.addListener(new Runnable() {
558 endSignal.countDown();
564 RpcResult<TempServiceCreateOutput> rpcResult = result.get();
566 ResponseCodes.RESPONSE_FAILED, rpcResult.getResult().getConfigurationResponseCommon().getResponseCode());
571 public void tempServiceCreateShouldBeSuccessfulWhenPreformPCESuccessful()
572 throws ExecutionException, InterruptedException {
573 TempServiceCreateInput input = ServiceDataUtils.buildTempServiceCreateInput();
574 Mockito.when(pathComputationService.pathComputationRequest(any())).thenReturn(Futures.immediateFuture(any()));
576 ServicehandlerImpl servicehandlerImpl =
577 new ServicehandlerImpl(getNewDataBroker(), pathComputationService, rendererServiceOperations,
578 notificationPublishService, pceListenerImpl, rendererListenerImpl, networkModelListenerImpl,
579 serviceDataStoreOperations);
581 ListenableFuture<RpcResult<TempServiceCreateOutput>> result = servicehandlerImpl.tempServiceCreate(input);
582 result.addListener(new Runnable() {
585 endSignal.countDown();
591 RpcResult<TempServiceCreateOutput> rpcResult = result.get();
594 ResponseCodes.RESPONSE_OK, rpcResult.getResult().getConfigurationResponseCommon().getResponseCode());