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=d65f99d96872d8a61b426617a0a2c2bb7fece440;hpb=f5cb5dd25e896eb6cdcb37c897ee4451f7ec4cbf;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 d65f99d96..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,6 +26,7 @@ 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; @@ -38,9 +39,9 @@ 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; @@ -50,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; @@ -73,11 +74,11 @@ 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 @@ -86,6 +87,8 @@ public class TapiConnectivityImplTest extends AbstractTest { private NetworkListener networkModelListenerImpl; @Mock public CatalogDataStoreOperations catalogDataStoreOperations; + @Mock + private RpcProviderService rpcProviderService; private static final Logger LOG = LoggerFactory.getLogger(TapiConnectivityImplTest.class); private static ServiceDataStoreOperations serviceDataStoreOperations; @@ -129,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, catalogDataStoreOperations); TapiConnectivityImpl tapiConnectivity = new TapiConnectivityImpl(serviceHandler, tapiContext, connectivityUtils, - tapipceListenerImpl, tapirendererListenerImpl); + tapipceNotificationHandler, tapirendererNotificationHandler); ListenableFuture> result = tapiConnectivity.createConnectivityService(new CreateConnectivityServiceInputBuilder().build()); @@ -154,7 +157,7 @@ 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, catalogDataStoreOperations); @@ -162,7 +165,7 @@ public class TapiConnectivityImplTest extends AbstractTest { 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() { @@ -180,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, catalogDataStoreOperations); TapiConnectivityImpl tapiConnectivity = new TapiConnectivityImpl(serviceHandler, tapiContext, connectivityUtils, - tapipceListenerImpl, tapirendererListenerImpl); + tapipceNotificationHandler, tapirendererNotificationHandler); ListenableFuture> result = tapiConnectivity.deleteConnectivityService(new DeleteConnectivityServiceInputBuilder().build()); @@ -205,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, catalogDataStoreOperations); TapiConnectivityImpl tapiConnectivity = new TapiConnectivityImpl(serviceHandler, tapiContext, connectivityUtils, - tapipceListenerImpl, tapirendererListenerImpl); + tapipceNotificationHandler, tapirendererNotificationHandler); ListenableFuture> result = tapiConnectivity.deleteConnectivityService(input); result.addListener(new Runnable() { @@ -230,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, catalogDataStoreOperations); TapiConnectivityImpl tapiConnectivity = new TapiConnectivityImpl(serviceHandler, tapiContext, connectivityUtils, - tapipceListenerImpl, tapirendererListenerImpl); + tapipceNotificationHandler, tapirendererNotificationHandler); ServiceCreateInput createInput = TapiConnectivityDataUtils.buildServiceCreateInput(); serviceDataStoreOperations.createService(createInput);