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=992514f99b49986242073c46f2e6f7c0088653f7;hb=46b020d25342f0ca86d83f6a503d7565f67f829e;hp=deab1ea8b25b897996076a647d1f38879fec6e13;hpb=f3253f3398b27936e0d017f6b470b0360827b8f4;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 deab1ea8b..992514f99 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 @@ -26,20 +26,22 @@ import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; import org.mockito.junit.jupiter.MockitoExtension; import org.opendaylight.mdsal.binding.api.NotificationPublishService; +import org.opendaylight.mdsal.binding.api.RpcProviderService; import org.opendaylight.transportpce.common.InstanceIdentifiers; import org.opendaylight.transportpce.common.network.NetworkTransactionImpl; import org.opendaylight.transportpce.common.network.NetworkTransactionService; import org.opendaylight.transportpce.pce.service.PathComputationService; import org.opendaylight.transportpce.renderer.provisiondevice.RendererServiceOperations; +import org.opendaylight.transportpce.servicehandler.catalog.CatalogDataStoreOperations; import org.opendaylight.transportpce.servicehandler.impl.ServicehandlerImpl; import org.opendaylight.transportpce.servicehandler.listeners.NetworkListener; import org.opendaylight.transportpce.servicehandler.listeners.PceListener; import org.opendaylight.transportpce.servicehandler.listeners.RendererListener; import org.opendaylight.transportpce.servicehandler.service.ServiceDataStoreOperations; import org.opendaylight.transportpce.servicehandler.service.ServiceDataStoreOperationsImpl; -import org.opendaylight.transportpce.tapi.listeners.TapiPceListenerImpl; -import org.opendaylight.transportpce.tapi.listeners.TapiRendererListenerImpl; -import org.opendaylight.transportpce.tapi.listeners.TapiServiceHandlerListenerImpl; +import org.opendaylight.transportpce.tapi.listeners.TapiPceNotificationHandler; +import org.opendaylight.transportpce.tapi.listeners.TapiRendererNotificationHandler; +import org.opendaylight.transportpce.tapi.listeners.TapiServiceNotificationHandler; import org.opendaylight.transportpce.tapi.topology.TopologyUtils; import org.opendaylight.transportpce.tapi.utils.TapiConnectivityDataUtils; import org.opendaylight.transportpce.tapi.utils.TapiContext; @@ -49,8 +51,8 @@ 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.openroadm.service.rev211210.OrgOpenroadmServiceService; -import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev211210.ServiceCreateInput; +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.rev181210.CreateConnectivityServiceInput; import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.connectivity.rev181210.CreateConnectivityServiceInputBuilder; import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.connectivity.rev181210.CreateConnectivityServiceOutput; @@ -72,17 +74,21 @@ public class TapiConnectivityImplTest extends AbstractTest { @Mock private NotificationPublishService notificationPublishService; @Mock - private TapiPceListenerImpl tapipceListenerImpl; + private TapiPceNotificationHandler tapipceNotificationHandler; @Mock - private TapiRendererListenerImpl tapirendererListenerImpl; + private TapiRendererNotificationHandler tapirendererNotificationHandler; @Mock - private TapiServiceHandlerListenerImpl tapiserviceHandlerListenerImpl; + private TapiServiceNotificationHandler tapiserviceNotificationHandler; @Mock private PceListener pceListenerImpl; @Mock private RendererListener rendererListenerImpl; @Mock private NetworkListener networkModelListenerImpl; + @Mock + public CatalogDataStoreOperations catalogDataStoreOperations; + @Mock + private RpcProviderService rpcProviderService; private static final Logger LOG = LoggerFactory.getLogger(TapiConnectivityImplTest.class); private static ServiceDataStoreOperations serviceDataStoreOperations; @@ -126,12 +132,12 @@ public class TapiConnectivityImplTest extends AbstractTest { @Test void createConnServiceShouldBeFailedWithEmptyInput() throws ExecutionException, InterruptedException { - OrgOpenroadmServiceService serviceHandler = new ServicehandlerImpl(pathComputationService, + OrgOpenroadmServiceService serviceHandler = new ServicehandlerImpl(rpcProviderService, pathComputationService, rendererServiceOperations, notificationPublishService, pceListenerImpl, rendererListenerImpl, - networkModelListenerImpl, serviceDataStoreOperations); + networkModelListenerImpl, serviceDataStoreOperations, catalogDataStoreOperations); TapiConnectivityImpl tapiConnectivity = new TapiConnectivityImpl(serviceHandler, tapiContext, connectivityUtils, - tapipceListenerImpl, tapirendererListenerImpl); + tapipceNotificationHandler, tapirendererNotificationHandler); ListenableFuture> result = tapiConnectivity.createConnectivityService(new CreateConnectivityServiceInputBuilder().build()); @@ -151,15 +157,15 @@ public class TapiConnectivityImplTest extends AbstractTest { @Test void createConnServiceShouldBeSuccessfulWhenPerformPCESuccessful() throws ExecutionException, InterruptedException { - OrgOpenroadmServiceService serviceHandler = new ServicehandlerImpl(pathComputationService, + OrgOpenroadmServiceService serviceHandler = new ServicehandlerImpl(rpcProviderService, pathComputationService, rendererServiceOperations, notificationPublishService, pceListenerImpl, rendererListenerImpl, - networkModelListenerImpl, serviceDataStoreOperations); + networkModelListenerImpl, serviceDataStoreOperations, catalogDataStoreOperations); CreateConnectivityServiceInput input = TapiConnectivityDataUtils.buildConnServiceCreateInput(); when(pathComputationService.pathComputationRequest(any())).thenReturn(Futures.immediateFuture(any())); TapiConnectivityImpl tapiConnectivity = new TapiConnectivityImpl(serviceHandler, tapiContext, connectivityUtils, - tapipceListenerImpl, tapirendererListenerImpl); + tapipceNotificationHandler, tapirendererNotificationHandler); ListenableFuture> result = tapiConnectivity.createConnectivityService(input); result.addListener(new Runnable() { @@ -177,12 +183,12 @@ public class TapiConnectivityImplTest extends AbstractTest { @Test void deleteConnServiceShouldBeFailedWithEmptyInput() throws ExecutionException, InterruptedException { - OrgOpenroadmServiceService serviceHandler = new ServicehandlerImpl(pathComputationService, + OrgOpenroadmServiceService serviceHandler = new ServicehandlerImpl(rpcProviderService, pathComputationService, rendererServiceOperations, notificationPublishService, pceListenerImpl, rendererListenerImpl, - networkModelListenerImpl, serviceDataStoreOperations); + networkModelListenerImpl, serviceDataStoreOperations, catalogDataStoreOperations); TapiConnectivityImpl tapiConnectivity = new TapiConnectivityImpl(serviceHandler, tapiContext, connectivityUtils, - tapipceListenerImpl, tapirendererListenerImpl); + tapipceNotificationHandler, tapirendererNotificationHandler); ListenableFuture> result = tapiConnectivity.deleteConnectivityService(new DeleteConnectivityServiceInputBuilder().build()); @@ -202,12 +208,12 @@ public class TapiConnectivityImplTest extends AbstractTest { @Test void deleteConnServiceShouldBeFailedWithNonExistService() throws ExecutionException, InterruptedException { DeleteConnectivityServiceInput input = TapiConnectivityDataUtils.buildConnServiceDeleteInput1(); - OrgOpenroadmServiceService serviceHandler = new ServicehandlerImpl(pathComputationService, + OrgOpenroadmServiceService serviceHandler = new ServicehandlerImpl(rpcProviderService, pathComputationService, rendererServiceOperations, notificationPublishService, pceListenerImpl, rendererListenerImpl, - networkModelListenerImpl, serviceDataStoreOperations); + networkModelListenerImpl, serviceDataStoreOperations, catalogDataStoreOperations); TapiConnectivityImpl tapiConnectivity = new TapiConnectivityImpl(serviceHandler, tapiContext, connectivityUtils, - tapipceListenerImpl, tapirendererListenerImpl); + tapipceNotificationHandler, tapirendererNotificationHandler); ListenableFuture> result = tapiConnectivity.deleteConnectivityService(input); result.addListener(new Runnable() { @@ -227,12 +233,12 @@ public class TapiConnectivityImplTest extends AbstractTest { void deleteConnServiceShouldBeSuccessForExistingService() throws ExecutionException, InterruptedException { when(rendererServiceOperations.serviceDelete(any(), any())).thenReturn(Futures.immediateFuture(any())); - OrgOpenroadmServiceService serviceHandler = new ServicehandlerImpl(pathComputationService, + OrgOpenroadmServiceService serviceHandler = new ServicehandlerImpl(rpcProviderService, pathComputationService, rendererServiceOperations, notificationPublishService, pceListenerImpl, rendererListenerImpl, - networkModelListenerImpl, serviceDataStoreOperations); + networkModelListenerImpl, serviceDataStoreOperations, catalogDataStoreOperations); TapiConnectivityImpl tapiConnectivity = new TapiConnectivityImpl(serviceHandler, tapiContext, connectivityUtils, - tapipceListenerImpl, tapirendererListenerImpl); + tapipceNotificationHandler, tapirendererNotificationHandler); ServiceCreateInput createInput = TapiConnectivityDataUtils.buildServiceCreateInput(); serviceDataStoreOperations.createService(createInput);