X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=tapi%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Ftransportpce%2Ftapi%2Fconnectivity%2FTapiConnectivityImplTest.java;h=837a61fe6d2b08dad3334f02981fe13d596e9390;hb=db87ba733190c2e59997e00e0fe9199c9c74234d;hp=e5c6aa68fcbbd34a21c793325e27584f1364e641;hpb=2f5d0456526325091bdef21785cd9db32e6bab0c;p=transportpce.git diff --git a/tapi/src/test/java/org/opendaylight/transportpce/tapi/connectivity/TapiConnectivityImplTest.java b/tapi/src/test/java/org/opendaylight/transportpce/tapi/connectivity/TapiConnectivityImplTest.java index e5c6aa68f..837a61fe6 100644 --- a/tapi/src/test/java/org/opendaylight/transportpce/tapi/connectivity/TapiConnectivityImplTest.java +++ b/tapi/src/test/java/org/opendaylight/transportpce/tapi/connectivity/TapiConnectivityImplTest.java @@ -50,6 +50,11 @@ import org.opendaylight.transportpce.tapi.utils.TapiLink; import org.opendaylight.transportpce.tapi.utils.TapiLinkImpl; import org.opendaylight.transportpce.tapi.utils.TapiTopologyDataUtils; import org.opendaylight.transportpce.test.AbstractTest; +import org.opendaylight.transportpce.test.utils.TopologyDataUtils; +import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev210915.ServiceDeleteOutput; +import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev210915.ServiceDeleteOutputBuilder; +import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev230526.configuration.response.common.ConfigurationResponseCommon; +import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev230526.configuration.response.common.ConfigurationResponseCommonBuilder; import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.OrgOpenroadmServiceService; import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.ServiceCreateInput; import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.connectivity.rev221121.CreateConnectivityServiceInput; @@ -176,7 +181,7 @@ public class TapiConnectivityImplTest extends AbstractTest { }, executorService); endSignal.await(); - + LOG.info("INPUT= {}", input.toString()); RpcResult rpcResult = result.get(); assertTrue(rpcResult.isSuccessful()); } @@ -211,7 +216,6 @@ public class TapiConnectivityImplTest extends AbstractTest { OrgOpenroadmServiceService serviceHandler = new ServicehandlerImpl(rpcProviderService, pathComputationService, rendererServiceOperations, notificationPublishService, pceListenerImpl, rendererListenerImpl, networkModelListenerImpl, serviceDataStoreOperations, catalogDataStoreOperations); - TapiConnectivityImpl tapiConnectivity = new TapiConnectivityImpl(serviceHandler, tapiContext, connectivityUtils, tapipceNotificationHandler, tapirendererNotificationHandler, networkTransactionService); ListenableFuture> result = @@ -231,7 +235,15 @@ public class TapiConnectivityImplTest extends AbstractTest { @Test void deleteConnServiceShouldBeSuccessForExistingService() throws ExecutionException, InterruptedException { - when(rendererServiceOperations.serviceDelete(any(), any())).thenReturn(Futures.immediateFuture(any())); + ConfigurationResponseCommon crc = new ConfigurationResponseCommonBuilder() + .setRequestId("request 1") + .setResponseCode("OK") + .setAckFinalIndicator("requestProcessed").build(); + ServiceDeleteOutput sdo = new ServiceDeleteOutputBuilder() + .setConfigurationResponseCommon(crc) + .build(); + when(rendererServiceOperations.serviceDelete(any(), any())) + .thenReturn(Futures.immediateFuture(sdo)); OrgOpenroadmServiceService serviceHandler = new ServicehandlerImpl(rpcProviderService, pathComputationService, rendererServiceOperations, notificationPublishService, pceListenerImpl, rendererListenerImpl, @@ -239,11 +251,9 @@ public class TapiConnectivityImplTest extends AbstractTest { TapiConnectivityImpl tapiConnectivity = new TapiConnectivityImpl(serviceHandler, tapiContext, connectivityUtils, tapipceNotificationHandler, tapirendererNotificationHandler, networkTransactionService); - ServiceCreateInput createInput = TapiConnectivityDataUtils.buildServiceCreateInput(); serviceDataStoreOperations.createService(createInput); tapiContext.updateConnectivityContext(TapiConnectivityDataUtils.createConnService(), new HashMap<>()); - DeleteConnectivityServiceInput input = TapiConnectivityDataUtils.buildConnServiceDeleteInput(); ListenableFuture> result = tapiConnectivity.deleteConnectivityService(input); @@ -255,8 +265,8 @@ public class TapiConnectivityImplTest extends AbstractTest { }, executorService); endSignal.await(); - + LOG.debug("RESULT = {}", result.toString()); RpcResult rpcResult = result.get(); assertTrue(rpcResult.isSuccessful()); } -} \ No newline at end of file +}