Path description YANG update
[transportpce.git] / servicehandler / src / test / java / org / opendaylight / transportpce / servicehandler / ModelMappingUtilsTest.java
1 /*
2  * Copyright © 2018 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;
9
10
11 import static org.junit.jupiter.api.Assertions.assertEquals;
12 import static org.junit.jupiter.api.Assertions.assertNotNull;
13 import static org.junit.jupiter.api.Assertions.assertNull;
14
15 import com.google.common.util.concurrent.ListenableFuture;
16 import com.google.common.util.concurrent.ListeningExecutorService;
17 import com.google.common.util.concurrent.MoreExecutors;
18 import java.time.OffsetDateTime;
19 import java.time.ZoneOffset;
20 import java.time.format.DateTimeFormatter;
21 import java.util.Map;
22 import java.util.Set;
23 import java.util.concurrent.CountDownLatch;
24 import java.util.concurrent.ExecutionException;
25 import java.util.concurrent.Executors;
26 import org.junit.jupiter.api.AfterEach;
27 import org.junit.jupiter.api.BeforeEach;
28 import org.junit.jupiter.api.Test;
29 import org.opendaylight.transportpce.common.ResponseCodes;
30 import org.opendaylight.transportpce.servicehandler.utils.ServiceDataUtils;
31 import org.opendaylight.transportpce.test.AbstractTest;
32 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev220808.PathComputationRequestOutput;
33 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev220808.PathComputationRequestOutputBuilder;
34 import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev211210.ConnectionType;
35 import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev211210.configuration.response.common.ConfigurationResponseCommonBuilder;
36 import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev211210.sdnc.request.header.SdncRequestHeaderBuilder;
37 import org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constraints.rev211210.constraints.CoRoutingBuilder;
38 import org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constraints.rev211210.constraints.co.routing.ServiceIdentifierListBuilder;
39 import org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constraints.rev211210.routing.constraints.HardConstraintsBuilder;
40 import org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constraints.rev211210.routing.constraints.SoftConstraintsBuilder;
41 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev211210.ServiceCreateInput;
42 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev211210.ServiceCreateInputBuilder;
43 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev211210.ServiceCreateOutput;
44 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev211210.ServiceDeleteInput;
45 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev211210.ServiceDeleteInputBuilder;
46 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev211210.ServiceDeleteOutput;
47 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev211210.ServiceFeasibilityCheckInput;
48 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev211210.ServiceFeasibilityCheckInputBuilder;
49 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev211210.ServiceFeasibilityCheckOutput;
50 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev211210.ServiceReconfigureInput;
51 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev211210.ServiceReconfigureInputBuilder;
52 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev211210.ServiceRerouteInput;
53 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev211210.ServiceRerouteInputBuilder;
54 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev211210.ServiceRestorationInput;
55 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev211210.ServiceRestorationInputBuilder;
56 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev211210.ServiceRestorationOutput;
57 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev211210.TempServiceCreateInput;
58 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev211210.TempServiceCreateInputBuilder;
59 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev211210.TempServiceCreateOutput;
60 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev211210.service.list.Services;
61 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev211210.service.list.ServicesBuilder;
62 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev211210.service.list.ServicesKey;
63 import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev230501.path.description.AToZDirectionBuilder;
64 import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev230501.path.description.ZToADirectionBuilder;
65 import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev220118.response.parameters.sp.ResponseParametersBuilder;
66 import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev220118.response.parameters.sp.response.parameters.PathDescriptionBuilder;
67 import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev171017.service.path.list.ServicePaths;
68 import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev171017.service.path.list.ServicePathsBuilder;
69 import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev171017.service.path.list.ServicePathsKey;
70 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.DateAndTime;
71 import org.opendaylight.yangtools.yang.common.RpcResult;
72 import org.opendaylight.yangtools.yang.common.Uint32;
73
74 public class ModelMappingUtilsTest extends AbstractTest {
75
76     private ListeningExecutorService executorService;
77     private CountDownLatch endSignal;
78     private static final int NUM_THREADS = 5;
79
80     @BeforeEach
81     void setUp() {
82         executorService = MoreExecutors.listeningDecorator(Executors.newFixedThreadPool(NUM_THREADS));
83         endSignal = new CountDownLatch(1);
84     }
85
86     @AfterEach
87     void tearDown() {
88         executorService.shutdownNow();
89     }
90
91     private ServiceReconfigureInput buildServiceConfigurationInput() {
92         return new ServiceReconfigureInputBuilder()
93             .setNewServiceName("service 1").setServiceName("service 1").setCommonId("common id")
94             .setConnectionType(ConnectionType.Service).setCustomer("customer").setCustomerContact("customer contact")
95             .setDueDate(new DateAndTime(DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ssxxx")
96                 .format(OffsetDateTime.now(ZoneOffset.UTC))))
97             .setEndDate(new DateAndTime(DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ssxxx")
98                 .format(OffsetDateTime.now(ZoneOffset.UTC).plusDays(10))))
99             .setNcCode("nc node").setNciCode("nci node").setSecondaryNciCode("secondry").setOperatorContact("operator")
100             .setServiceAEnd(ServiceDataUtils.getServiceAEndBuildReconfigure().build())
101             .setServiceZEnd(ServiceDataUtils.getServiceZEndBuildReconfigure().build())
102             .setHardConstraints(new HardConstraintsBuilder()
103                 .setCustomerCode(Set.of("Some customer-code"))
104                 .setCoRouting(new CoRoutingBuilder()
105                     .setServiceIdentifierList(Map.of(
106                         new org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constraints.rev211210
107                             .constraints.co.routing.ServiceIdentifierListKey("Some existing-service"),
108                         new ServiceIdentifierListBuilder().setServiceIdentifier("Some existing-service")
109                             .build()))
110                     .build())
111                 .build())
112             .setSoftConstraints(new SoftConstraintsBuilder()
113                 .setCustomerCode(Set.of("Some customer-code"))
114                 .setCoRouting(new CoRoutingBuilder()
115                     .setServiceIdentifierList(Map.of(
116                         new org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constraints.rev211210
117                             .constraints.co.routing.ServiceIdentifierListKey("Some existing-service"),
118                         new ServiceIdentifierListBuilder().setServiceIdentifier("Some existing-service")
119                             .build()))
120                     .build())
121                 .build())
122             .build();
123     }
124
125     private PathComputationRequestOutput buildPathComputationOutput() {
126         return new PathComputationRequestOutputBuilder()
127             .setConfigurationResponseCommon(new ConfigurationResponseCommonBuilder()
128                 .setRequestId("request 1")
129                 .setAckFinalIndicator(ResponseCodes.FINAL_ACK_NO)
130                 .setResponseCode(ResponseCodes.RESPONSE_OK)
131                 .setResponseMessage("PCE calculation in progress")
132                 .build())
133             .setResponseParameters(new ResponseParametersBuilder()
134                 .setPathDescription(new PathDescriptionBuilder()
135                     .setAToZDirection(new AToZDirectionBuilder()
136                         .setAToZWavelengthNumber(Uint32.valueOf(1))
137                         .setRate(Uint32.valueOf(1))
138                         .build())
139                     .setZToADirection(new ZToADirectionBuilder()
140                         .setZToAWavelengthNumber(Uint32.valueOf(1))
141                         .setRate(Uint32.valueOf(1))
142                         .build())
143                     .build())
144                 .build())
145             .build();
146     }
147
148     @Test
149     //TODO : is this unit test relevant ?
150     void mappingServicesNullServiceCreateInput() {
151         Services services = ModelMappingUtils.mappingServices(null, null);
152         assertEquals(new ServicesBuilder().withKey(new ServicesKey("unknown")).build(), services);
153     }
154
155     @Test
156     void mappingServiceNotNullServiceReconfigureInput() {
157         Services services = ModelMappingUtils.mappingServices(null, buildServiceConfigurationInput());
158         assertEquals("service 1", services.getServiceName());
159     }
160
161     @Test
162     void mappingServiceValid() {
163         Services services = ModelMappingUtils.mappingServices(ServiceDataUtils.buildServiceCreateInput(), null);
164         assertEquals("service 1", services.getServiceName());
165     }
166
167     @Test
168     //TODO : is this unit test relevant ?
169     void mappingServicesPathNullServiceCreateInput() {
170         ServicePaths services = ModelMappingUtils.mappingServicePaths(null, buildPathComputationOutput());
171         assertEquals(new ServicePathsBuilder().withKey(new ServicePathsKey("unknown")).build(), services);
172     }
173
174     @Test
175     void mappingServicePathWithServiceInputWithHardConstraints() {
176         ServiceCreateInput createInput = ServiceDataUtils.buildServiceCreateInputWithHardConstraints();
177         ServiceInput serviceInput = new ServiceInput(createInput);
178         ServicePaths services = ModelMappingUtils.mappingServicePaths(serviceInput, buildPathComputationOutput());
179         assertEquals(serviceInput.getServiceName(), services.getServicePathName());
180         assertNotNull(services.getHardConstraints());
181     }
182
183     @Test
184     void mappingServicePathWithServiceInputWithSoftConstraints() {
185         ServiceCreateInput createInput = ServiceDataUtils.buildServiceCreateInputWithSoftConstraints();
186         ServiceInput serviceInput = new ServiceInput(createInput);
187         ServicePaths services = ModelMappingUtils.mappingServicePaths(serviceInput, buildPathComputationOutput());
188         assertEquals(serviceInput.getServiceName(), services.getServicePathName());
189         assertNotNull(services.getSoftConstraints());
190     }
191
192     @Test
193     void createServiceDeleteInputWithServiceRerouteInput() {
194         ServiceRerouteInput serviceRerouteinput = new ServiceRerouteInputBuilder().setServiceName("reroute").build();
195         Services services = new ServicesBuilder()
196                     .withKey(new ServicesKey("reroute"))
197                     .setSdncRequestHeader(new SdncRequestHeaderBuilder().setRequestId("123").build())
198                     .build();
199         var serviceDeleteInput = ModelMappingUtils.createServiceDeleteInput(serviceRerouteinput, services);
200         assertEquals("reroute", serviceDeleteInput.getServiceName());
201         assertEquals("123", serviceDeleteInput.getServiceHandlerHeader().getRequestId());
202     }
203
204     @Test
205     void  createServiceDeleteInputWithServiceReconfigureInput() {
206         ServiceReconfigureInput serviceReconfigureInput = new ServiceReconfigureInputBuilder()
207                 .setServiceName("reconf")
208                 .build();
209         var serviceDeleteInput = ModelMappingUtils.createServiceDeleteInput(serviceReconfigureInput);
210         assertEquals("reconf", serviceDeleteInput.getServiceName());
211         assertEquals("reconf-reconfigure", serviceDeleteInput.getServiceHandlerHeader().getRequestId());
212     }
213
214     @Test
215     void createServiceDeleteInputWithServiceRestorationInput() {
216         Services services = new ServicesBuilder()
217                 .withKey(new ServicesKey("rest"))
218                 .setSdncRequestHeader(new SdncRequestHeaderBuilder().setRequestId("123").build())
219                 .build();
220         ServiceRestorationInput serviceRestorationInput = new ServiceRestorationInputBuilder()
221                 .setServiceName("rest")
222                 .build();
223         var serviceDeleteInput = ModelMappingUtils.createServiceDeleteInput(serviceRestorationInput, services);
224         assertEquals("rest", serviceDeleteInput.getServiceName());
225         assertEquals("123", serviceDeleteInput.getServiceHandlerHeader().getRequestId());
226     }
227
228     @Test
229     void createDeleteServiceReplyWithServiceDeleteInputWithSdncHeader()
230             throws ExecutionException, InterruptedException  {
231         ServiceDeleteInput input = new ServiceDeleteInputBuilder()
232                 .setSdncRequestHeader(new SdncRequestHeaderBuilder().setRequestId("12").build())
233                 .build();
234         ListenableFuture<RpcResult<ServiceDeleteOutput>> serviceDeleteOutputF =
235             ModelMappingUtils.createDeleteServiceReply(input, "ack", "message", "200");
236         serviceDeleteOutputF.addListener(new Runnable() {
237             @Override
238             public void run() {
239                 endSignal.countDown();
240             }
241         }, executorService);
242
243         endSignal.await();
244         RpcResult<ServiceDeleteOutput> serviceDeleteOutput = serviceDeleteOutputF.get();
245         assertEquals("200", serviceDeleteOutput.getResult().getConfigurationResponseCommon().getResponseCode());
246         assertEquals("ack", serviceDeleteOutput.getResult().getConfigurationResponseCommon().getAckFinalIndicator());
247         assertEquals("message", serviceDeleteOutput.getResult().getConfigurationResponseCommon().getResponseMessage());
248         assertEquals("12", serviceDeleteOutput.getResult().getConfigurationResponseCommon().getRequestId());
249     }
250
251     @Test
252     void createDeleteServiceReplyWithServiceDeleteInputWithoutSdncHeader()
253             throws ExecutionException, InterruptedException  {
254         ServiceDeleteInput input = new ServiceDeleteInputBuilder().build();
255         ListenableFuture<RpcResult<ServiceDeleteOutput>> serviceDeleteOutputF =
256             ModelMappingUtils.createDeleteServiceReply(input, "ack", "message", "200");
257         serviceDeleteOutputF.addListener(new Runnable() {
258             @Override
259             public void run() {
260                 endSignal.countDown();
261             }
262         }, executorService);
263
264         endSignal.await();
265         RpcResult<ServiceDeleteOutput> serviceDeleteOutput = serviceDeleteOutputF.get();
266         assertEquals("200", serviceDeleteOutput.getResult().getConfigurationResponseCommon().getResponseCode());
267         assertEquals("ack", serviceDeleteOutput.getResult().getConfigurationResponseCommon().getAckFinalIndicator());
268         assertEquals("message", serviceDeleteOutput.getResult().getConfigurationResponseCommon().getResponseMessage());
269         assertNull(serviceDeleteOutput.getResult().getConfigurationResponseCommon().getRequestId());
270     }
271
272     @Test
273     void createCreateServiceReplyWithServiceCreatInputWithSdncRequestHeader()
274             throws ExecutionException, InterruptedException {
275         ServiceCreateInput input = new ServiceCreateInputBuilder()
276                 .setSdncRequestHeader(new SdncRequestHeaderBuilder().setRequestId("12").build())
277                 .build();
278         ListenableFuture<RpcResult<ServiceCreateOutput>> serviceCreatOutputF =
279             ModelMappingUtils.createCreateServiceReply(input, "ack", "message", "200");
280         serviceCreatOutputF.addListener(new Runnable() {
281             @Override
282             public void run() {
283                 endSignal.countDown();
284             }
285         }, executorService);
286
287         endSignal.await();
288         RpcResult<ServiceCreateOutput> serviceCreatOutput = serviceCreatOutputF.get();
289         assertEquals("200", serviceCreatOutput.getResult().getConfigurationResponseCommon().getResponseCode());
290         assertEquals("ack", serviceCreatOutput.getResult().getConfigurationResponseCommon().getAckFinalIndicator());
291         assertEquals("message", serviceCreatOutput.getResult().getConfigurationResponseCommon().getResponseMessage());
292         assertEquals("12", serviceCreatOutput.getResult().getConfigurationResponseCommon().getRequestId());
293     }
294
295     @Test
296     void createCreateServiceReplyWithServiceCreatInputWithoutSdncRequestHeader()
297         throws ExecutionException, InterruptedException {
298         ServiceCreateInput input = new ServiceCreateInputBuilder().build();
299         ListenableFuture<RpcResult<ServiceCreateOutput>> serviceCreatOutputF =
300             ModelMappingUtils.createCreateServiceReply(input, "ack", "message", "200");
301         serviceCreatOutputF.addListener(new Runnable() {
302             @Override
303             public void run() {
304                 endSignal.countDown();
305             }
306         }, executorService);
307
308         endSignal.await();
309         RpcResult<ServiceCreateOutput> serviceCreatOutput = serviceCreatOutputF.get();
310         assertEquals("200", serviceCreatOutput.getResult().getConfigurationResponseCommon().getResponseCode());
311         assertEquals("ack", serviceCreatOutput.getResult().getConfigurationResponseCommon().getAckFinalIndicator());
312         assertEquals("message", serviceCreatOutput.getResult().getConfigurationResponseCommon().getResponseMessage());
313         assertNull(serviceCreatOutput.getResult().getConfigurationResponseCommon().getRequestId());
314     }
315
316     @Test
317     void createCreateServiceReplyWithTempServiceCreatInputWithSdncRequestHeader()
318         throws ExecutionException, InterruptedException {
319         TempServiceCreateInput input = new TempServiceCreateInputBuilder()
320                 .setSdncRequestHeader(new SdncRequestHeaderBuilder().setRequestId("12").build())
321                 .build();
322         ListenableFuture<RpcResult<TempServiceCreateOutput>> serviceCreatOutputF =
323             ModelMappingUtils.createCreateServiceReply(input, "ack", "message", "200");
324         serviceCreatOutputF.addListener(new Runnable() {
325             @Override
326             public void run() {
327                 endSignal.countDown();
328             }
329         }, executorService);
330
331         endSignal.await();
332         RpcResult<TempServiceCreateOutput> serviceCreatOutput = serviceCreatOutputF.get();
333         assertEquals("200", serviceCreatOutput.getResult().getConfigurationResponseCommon().getResponseCode());
334         assertEquals("ack", serviceCreatOutput.getResult().getConfigurationResponseCommon().getAckFinalIndicator());
335         assertEquals("message", serviceCreatOutput.getResult().getConfigurationResponseCommon().getResponseMessage());
336         assertEquals("12", serviceCreatOutput.getResult().getConfigurationResponseCommon().getRequestId());
337     }
338
339     @Test
340     void createCreateServiceReplyWithTempServiceCreatInputWithoutSdncRequestHeader()
341         throws ExecutionException, InterruptedException {
342         TempServiceCreateInput input = new TempServiceCreateInputBuilder().build();
343         ListenableFuture<RpcResult<TempServiceCreateOutput>> serviceCreatOutputF =
344             ModelMappingUtils.createCreateServiceReply(input, "ack", "message", "200");
345         serviceCreatOutputF.addListener(new Runnable() {
346             @Override
347             public void run() {
348                 endSignal.countDown();
349             }
350         }, executorService);
351
352         endSignal.await();
353         RpcResult<TempServiceCreateOutput> serviceCreatOutput = serviceCreatOutputF.get();
354         assertEquals("200", serviceCreatOutput.getResult().getConfigurationResponseCommon().getResponseCode());
355         assertEquals("ack", serviceCreatOutput.getResult().getConfigurationResponseCommon().getAckFinalIndicator());
356         assertEquals("message", serviceCreatOutput.getResult().getConfigurationResponseCommon().getResponseMessage());
357         assertNull(serviceCreatOutput.getResult().getConfigurationResponseCommon().getRequestId());
358     }
359
360     @Test
361     void createCreateServiceReplyWithServiceFeasibilityCheckInputWithSdncRequestHeader()
362         throws ExecutionException, InterruptedException {
363         ServiceFeasibilityCheckInput input = new ServiceFeasibilityCheckInputBuilder()
364                 .setSdncRequestHeader(new SdncRequestHeaderBuilder().setRequestId("12").build())
365                 .build();
366         ListenableFuture<RpcResult<ServiceFeasibilityCheckOutput>> serviceCreatOutputF =
367             ModelMappingUtils.createCreateServiceReply(input, "ack", "message", "200");
368         serviceCreatOutputF.addListener(new Runnable() {
369             @Override
370             public void run() {
371                 endSignal.countDown();
372             }
373         }, executorService);
374
375         endSignal.await();
376         RpcResult<ServiceFeasibilityCheckOutput> serviceCreatOutput = serviceCreatOutputF.get();
377         assertEquals("200", serviceCreatOutput.getResult().getConfigurationResponseCommon().getResponseCode());
378         assertEquals("ack", serviceCreatOutput.getResult().getConfigurationResponseCommon().getAckFinalIndicator());
379         assertEquals("message", serviceCreatOutput.getResult().getConfigurationResponseCommon().getResponseMessage());
380         assertEquals("12", serviceCreatOutput.getResult().getConfigurationResponseCommon().getRequestId());
381     }
382
383     @Test
384     void createCreateServiceReplyWithServiceFeasibilityCheckInputWithoutSdncRequestHeader()
385         throws ExecutionException, InterruptedException {
386         ServiceFeasibilityCheckInput input = new ServiceFeasibilityCheckInputBuilder().build();
387         ListenableFuture<RpcResult<ServiceFeasibilityCheckOutput>> serviceCreatOutputF =
388             ModelMappingUtils.createCreateServiceReply(input, "ack", "message", "200");
389         serviceCreatOutputF.addListener(new Runnable() {
390             @Override
391             public void run() {
392                 endSignal.countDown();
393             }
394         }, executorService);
395
396         endSignal.await();
397         RpcResult<ServiceFeasibilityCheckOutput> serviceCreatOutput = serviceCreatOutputF.get();
398         assertEquals("200", serviceCreatOutput.getResult().getConfigurationResponseCommon().getResponseCode());
399         assertEquals("ack", serviceCreatOutput.getResult().getConfigurationResponseCommon().getAckFinalIndicator());
400         assertEquals("message", serviceCreatOutput.getResult().getConfigurationResponseCommon().getResponseMessage());
401         assertNull(serviceCreatOutput.getResult().getConfigurationResponseCommon().getRequestId());
402     }
403
404     @Test
405     void testCreateRestoreServiceReply() throws ExecutionException, InterruptedException {
406         ListenableFuture<RpcResult<ServiceRestorationOutput>> serviceRestorationOutputF =
407             ModelMappingUtils.createRestoreServiceReply("message");
408         serviceRestorationOutputF.addListener(new Runnable() {
409             @Override
410             public void run() {
411                 endSignal.countDown();
412             }
413         }, executorService);
414
415         endSignal.await();
416     }
417 }