X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=servicehandler%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Ftransportpce%2Fservicehandler%2Fimpl%2FServicehandlerImplTest.java;h=1e5639cc0f4c3c0c516194828c5e522603b20051;hb=198afc243c98aedfc5b30b93c1a5e3052d30868c;hp=be7eb840fd5df1787586695456433a7cd0dea54b;hpb=27070ce7114dcdb1da7203c54724fa3fe59e7cc3;p=transportpce.git diff --git a/servicehandler/src/test/java/org/opendaylight/transportpce/servicehandler/impl/ServicehandlerImplTest.java b/servicehandler/src/test/java/org/opendaylight/transportpce/servicehandler/impl/ServicehandlerImplTest.java index be7eb840f..1e5639cc0 100644 --- a/servicehandler/src/test/java/org/opendaylight/transportpce/servicehandler/impl/ServicehandlerImplTest.java +++ b/servicehandler/src/test/java/org/opendaylight/transportpce/servicehandler/impl/ServicehandlerImplTest.java @@ -15,6 +15,7 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; import static org.opendaylight.transportpce.servicehandler.impl.ServicehandlerImpl.LogMessages; +import com.google.common.collect.ClassToInstanceMap; import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.ListeningExecutorService; @@ -42,14 +43,16 @@ import org.opendaylight.transportpce.servicehandler.catalog.CatalogDataStoreOper 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.PCEServiceWrapper; +import org.opendaylight.transportpce.servicehandler.service.RendererServiceWrapper; import org.opendaylight.transportpce.servicehandler.service.ServiceDataStoreOperations; import org.opendaylight.transportpce.servicehandler.service.ServiceDataStoreOperationsImpl; import org.opendaylight.transportpce.servicehandler.utils.CatalogDataUtils; import org.opendaylight.transportpce.servicehandler.utils.ServiceDataUtils; import org.opendaylight.transportpce.test.AbstractTest; -import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev220808.PathComputationRequestOutputBuilder; -import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev220808.PathComputationRerouteRequestOutputBuilder; -import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev220808.service.path.rpc.result.PathDescription; +import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev240205.PathComputationRequestOutputBuilder; +import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev240205.PathComputationRerouteRequestOutputBuilder; +import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev240205.service.path.rpc.result.PathDescription; 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.common.state.types.rev191129.State; import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.AddOpenroadmOperationalModesToCatalogInputBuilder; @@ -94,7 +97,6 @@ import org.opendaylight.yangtools.yang.common.Uint32; @ExtendWith(MockitoExtension.class) public class ServicehandlerImplTest extends AbstractTest { - @Mock private RpcProviderService rpcProviderService; @Mock @@ -122,6 +124,8 @@ public class ServicehandlerImplTest extends AbstractTest { private ListeningExecutorService executorService; private CountDownLatch endSignal; private static final int NUM_THREADS = 5; + private PCEServiceWrapper pceServiceWrapper; + private RendererServiceWrapper rendererServiceWrapper; @BeforeEach void setUp() { @@ -136,25 +140,43 @@ public class ServicehandlerImplTest extends AbstractTest { serviceRestorationInput = ServiceDataUtils.buildServiceRestorationInput(); serviceRerouteInput = ServiceDataUtils.buildServiceRerouteInput(); pathDescription = ServiceDataUtils.createPathDescription(0,1,0,1); + pceServiceWrapper = new PCEServiceWrapper(pathComputationService, notificationPublishService); + this.rendererServiceWrapper = new RendererServiceWrapper(rendererServiceOperations, notificationPublishService); } @Test void testRpcRegistration() { - new ServicehandlerImpl(rpcProviderService, - pathComputationService, rendererServiceOperations, notificationPublishService, - pceListenerImpl, rendererListenerImpl, networkModelListenerImpl, - serviceDataStoreOperations, catalogDataStoreOperations); - verify(rpcProviderService, times(1)).registerRpcImplementations(any()); + new ServicehandlerImpl(rpcProviderService, serviceDataStoreOperations, pceListenerImpl, rendererListenerImpl, + networkModelListenerImpl, catalogDataStoreOperations, pathComputationService, rendererServiceOperations, + notificationPublishService); + verify(rpcProviderService, times(1)).registerRpcImplementations(any(ClassToInstanceMap.class)); } +// @Test +// void testNotImplementedRpc() throws InterruptedException, ExecutionException { +// ListenableFuture> result = new ServicehandlerImpl(rpcProviderService, +// serviceDataStoreOperations, pceListenerImpl, rendererListenerImpl, networkModelListenerImpl, +// catalogDataStoreOperations, pathComputationService, rendererServiceOperations, +// notificationPublishService) +// .serviceSrlgGet(new ServiceSrlgGetInputBuilder().build()); +// +// result.addListener(() -> endSignal.countDown(), executorService); +// endSignal.await(); +// assertNotNull(result.get()); +// assertFalse(result.get().isSuccessful()); +// assertNull(result.get().getResult()); +// assertEquals(ErrorType.RPC, result.get().getErrors().get(0).getErrorType()); +// assertEquals(ErrorSeverity.ERROR, result.get().getErrors().get(0).getSeverity()); +// assertEquals(ErrorTag.OPERATION_NOT_SUPPORTED, result.get().getErrors().get(0).getTag()); +// assertEquals("RPC not implemented yet", result.get().getErrors().get(0).getMessage()); +// } + @Test void createServiceShouldBeFailedWithEmptyInput() throws ExecutionException, InterruptedException { ListenableFuture> result = - new ServicehandlerImpl(rpcProviderService, - pathComputationService, rendererServiceOperations, notificationPublishService, - pceListenerImpl, rendererListenerImpl, networkModelListenerImpl, - serviceDataStoreOperations, catalogDataStoreOperations) - .serviceCreate(new ServiceCreateInputBuilder().build()); + new ServiceCreateImpl(serviceDataStoreOperations, pceListenerImpl, rendererListenerImpl, + networkModelListenerImpl, pceServiceWrapper, notificationPublishService) + .invoke(new ServiceCreateInputBuilder().build()); result.addListener(() -> endSignal.countDown(), executorService); endSignal.await(); assertEquals( @@ -171,11 +193,9 @@ public class ServicehandlerImplTest extends AbstractTest { .setServiceName(serviceCreateInput.getServiceName()) .build())); ListenableFuture> result = - new ServicehandlerImpl(rpcProviderService, - pathComputationService, rendererServiceOperations, notificationPublishService, - pceListenerImpl, rendererListenerImpl, networkModelListenerImpl, - serviceDSOperations, catalogDataStoreOperations) - .serviceCreate(serviceCreateInput); + new ServiceCreateImpl(serviceDSOperations, pceListenerImpl, rendererListenerImpl, + networkModelListenerImpl, pceServiceWrapper, notificationPublishService) + .invoke(serviceCreateInput); result.addListener(() -> endSignal.countDown(), executorService); endSignal.await(); assertEquals( @@ -187,11 +207,9 @@ public class ServicehandlerImplTest extends AbstractTest { void createServiceShouldBeSuccessfulWhenPerformPCESuccessful() throws ExecutionException, InterruptedException { when(pathComputationService.pathComputationRequest(any())).thenReturn(Futures.immediateFuture(any())); ListenableFuture> result = - new ServicehandlerImpl(rpcProviderService, - pathComputationService, rendererServiceOperations, notificationPublishService, - pceListenerImpl, rendererListenerImpl, networkModelListenerImpl, - serviceDataStoreOperations, catalogDataStoreOperations) - .serviceCreate(serviceCreateInput); + new ServiceCreateImpl(serviceDataStoreOperations, pceListenerImpl, rendererListenerImpl, + networkModelListenerImpl, pceServiceWrapper, notificationPublishService) + .invoke(serviceCreateInput); result.addListener(() -> endSignal.countDown(), executorService); endSignal.await(); assertEquals( @@ -202,16 +220,13 @@ public class ServicehandlerImplTest extends AbstractTest { @Test void deleteServiceShouldBeFailedWithEmptyInput() throws ExecutionException, InterruptedException { ListenableFuture> result = - new ServicehandlerImpl(rpcProviderService, - pathComputationService, rendererServiceOperations, notificationPublishService, - pceListenerImpl, rendererListenerImpl, networkModelListenerImpl, - serviceDataStoreOperations, catalogDataStoreOperations) - .serviceDelete( - new ServiceDeleteInputBuilder() - .setServiceDeleteReqInfo(new ServiceDeleteReqInfoBuilder() - .setServiceName("") - .build()) - .build()); + new ServiceDeleteImpl(serviceDataStoreOperations, pceListenerImpl, rendererListenerImpl, + networkModelListenerImpl, rendererServiceWrapper, notificationPublishService) + .invoke(new ServiceDeleteInputBuilder() + .setServiceDeleteReqInfo(new ServiceDeleteReqInfoBuilder() + .setServiceName("") + .build()) + .build()); result.addListener(() -> endSignal.countDown(), executorService); endSignal.await(); assertEquals( @@ -222,11 +237,9 @@ public class ServicehandlerImplTest extends AbstractTest { @Test void deleteServiceShouldBeFailedWithNonExistService() throws ExecutionException, InterruptedException { ListenableFuture> result = - new ServicehandlerImpl(rpcProviderService, - pathComputationService, rendererServiceOperations, notificationPublishService, - pceListenerImpl, rendererListenerImpl, networkModelListenerImpl, - serviceDataStoreOperations, catalogDataStoreOperations) - .serviceDelete(serviceDeleteInput); + new ServiceDeleteImpl(serviceDataStoreOperations, pceListenerImpl, rendererListenerImpl, + networkModelListenerImpl, rendererServiceWrapper, notificationPublishService) + .invoke(serviceDeleteInput); result.addListener(() -> endSignal.countDown(), executorService); endSignal.await(); assertEquals( @@ -239,11 +252,9 @@ public class ServicehandlerImplTest extends AbstractTest { when(rendererServiceOperations.serviceDelete(any(), any())).thenReturn(Futures.immediateFuture(any())); serviceDataStoreOperations.createService(serviceCreateInput); ListenableFuture> result = - new ServicehandlerImpl(rpcProviderService, - pathComputationService, rendererServiceOperations, notificationPublishService, - pceListenerImpl, rendererListenerImpl, networkModelListenerImpl, - serviceDataStoreOperations, catalogDataStoreOperations) - .serviceDelete(serviceDeleteInput); + new ServiceDeleteImpl(serviceDataStoreOperations, pceListenerImpl, rendererListenerImpl, + networkModelListenerImpl, rendererServiceWrapper, notificationPublishService) + .invoke(serviceDeleteInput); result.addListener(() -> endSignal.countDown(), executorService); endSignal.await(); assertEquals( @@ -253,11 +264,10 @@ public class ServicehandlerImplTest extends AbstractTest { @Test void serviceFeasibilityCheckShouldBeFailedWithEmptyInput() throws ExecutionException, InterruptedException { - ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(rpcProviderService, pathComputationService, - rendererServiceOperations, notificationPublishService, pceListenerImpl, rendererListenerImpl, - networkModelListenerImpl, serviceDataStoreOperations, catalogDataStoreOperations); ListenableFuture> result = - servicehandlerImpl.serviceFeasibilityCheck(new ServiceFeasibilityCheckInputBuilder().build()); + new ServiceFeasibilityCheckImpl(serviceDataStoreOperations, pceListenerImpl, rendererListenerImpl, + networkModelListenerImpl, pceServiceWrapper) + .invoke(new ServiceFeasibilityCheckInputBuilder().build()); result.addListener(() -> endSignal.countDown(), executorService); endSignal.await(); assertEquals( @@ -270,11 +280,9 @@ public class ServicehandlerImplTest extends AbstractTest { throws ExecutionException, InterruptedException { when(pathComputationService.pathComputationRequest(any())).thenReturn(Futures.immediateFuture(any())); ListenableFuture> result = - new ServicehandlerImpl(rpcProviderService, - pathComputationService, rendererServiceOperations, notificationPublishService, - pceListenerImpl, rendererListenerImpl, networkModelListenerImpl, - serviceDataStoreOperations, catalogDataStoreOperations) - .serviceFeasibilityCheck(ServiceDataUtils.buildServiceFeasibilityCheckInput()); + new ServiceFeasibilityCheckImpl(serviceDataStoreOperations, pceListenerImpl, rendererListenerImpl, + networkModelListenerImpl, pceServiceWrapper) + .invoke(ServiceDataUtils.buildServiceFeasibilityCheckInput()); result.addListener(() -> endSignal.countDown(), executorService); endSignal.await(); assertEquals( @@ -285,11 +293,9 @@ public class ServicehandlerImplTest extends AbstractTest { @Test void serviceReconfigureShouldBeFailedWithEmptyInput() throws ExecutionException, InterruptedException { ListenableFuture> result = - new ServicehandlerImpl(rpcProviderService, - pathComputationService, rendererServiceOperations, notificationPublishService, - pceListenerImpl, rendererListenerImpl, networkModelListenerImpl, - serviceDataStoreOperations, catalogDataStoreOperations) - .serviceReconfigure(new ServiceReconfigureInputBuilder().setServiceName("").build()); + new ServiceReconfigureImpl(serviceDataStoreOperations, pceListenerImpl, rendererListenerImpl, + networkModelListenerImpl, rendererServiceWrapper) + .invoke(new ServiceReconfigureInputBuilder().setServiceName("").build()); result.addListener(() -> endSignal.countDown(), executorService); endSignal.await(); } @@ -299,11 +305,9 @@ public class ServicehandlerImplTest extends AbstractTest { void serviceReconfigureShouldBeFailedWithNonExistService() throws ExecutionException, InterruptedException { //action -> service reconfigure ListenableFuture> result = - new ServicehandlerImpl(rpcProviderService, - pathComputationService, rendererServiceOperations, notificationPublishService, - pceListenerImpl, rendererListenerImpl, networkModelListenerImpl, - serviceDataStoreOperations, catalogDataStoreOperations) - .serviceReconfigure(serviceReconfigureInput); + new ServiceReconfigureImpl(serviceDataStoreOperations, pceListenerImpl, rendererListenerImpl, + networkModelListenerImpl, rendererServiceWrapper) + .invoke(serviceReconfigureInput); result.addListener(() -> endSignal.countDown(), executorService); endSignal.await(); } @@ -317,11 +321,9 @@ public class ServicehandlerImplTest extends AbstractTest { //service reconfigure test action //ServiceReconfigureInput is created with the same service information that is created before ListenableFuture> result = - new ServicehandlerImpl(rpcProviderService, - pathComputationService, rendererServiceOperations, notificationPublishService, - pceListenerImpl, rendererListenerImpl, networkModelListenerImpl, - serviceDataStoreOperations, catalogDataStoreOperations) - .serviceReconfigure(serviceReconfigureInput); + new ServiceReconfigureImpl(serviceDataStoreOperations, pceListenerImpl, rendererListenerImpl, + networkModelListenerImpl, rendererServiceWrapper) + .invoke(serviceReconfigureInput); result.addListener(() -> endSignal.countDown(), executorService); endSignal.await(); } @@ -329,13 +331,11 @@ public class ServicehandlerImplTest extends AbstractTest { @Test void serviceReRestorationShouldBeFailedWithEmptyInput() throws ExecutionException, InterruptedException { ListenableFuture> result = - new ServicehandlerImpl(rpcProviderService, - pathComputationService, rendererServiceOperations, notificationPublishService, - pceListenerImpl, rendererListenerImpl, networkModelListenerImpl, - serviceDataStoreOperations, catalogDataStoreOperations) - .serviceRestoration(new ServiceRestorationInputBuilder() - .setServiceName("") - .build()); + new ServiceRestorationImpl(serviceDataStoreOperations, pceListenerImpl, rendererListenerImpl, + networkModelListenerImpl, rendererServiceWrapper) + .invoke(new ServiceRestorationInputBuilder() + .setServiceName("") + .build()); result.addListener(() -> endSignal.countDown(), executorService); endSignal.await(); } @@ -344,11 +344,9 @@ public class ServicehandlerImplTest extends AbstractTest { void serviceRestorationShouldBeFailedWithNonExistService() throws ExecutionException, InterruptedException { //action -> service restore ListenableFuture> result = - new ServicehandlerImpl(rpcProviderService, - pathComputationService, rendererServiceOperations, notificationPublishService, - pceListenerImpl, rendererListenerImpl, networkModelListenerImpl, - serviceDataStoreOperations, catalogDataStoreOperations) - .serviceRestoration(serviceRestorationInput); + new ServiceRestorationImpl(serviceDataStoreOperations, pceListenerImpl, rendererListenerImpl, + networkModelListenerImpl, rendererServiceWrapper) + .invoke(serviceRestorationInput); result.addListener(() -> endSignal.countDown(), executorService); endSignal.await(); } @@ -362,11 +360,9 @@ public class ServicehandlerImplTest extends AbstractTest { //service Restoration test action //ServiceRestorationInput is created with the same service information that is created before ListenableFuture> result = - new ServicehandlerImpl(rpcProviderService, - pathComputationService, rendererServiceOperations, notificationPublishService, - pceListenerImpl, rendererListenerImpl, networkModelListenerImpl, - serviceDataStoreOperations, catalogDataStoreOperations) - .serviceRestoration(serviceRestorationInput); + new ServiceRestorationImpl(serviceDataStoreOperations, pceListenerImpl, rendererListenerImpl, + networkModelListenerImpl, rendererServiceWrapper) + .invoke(serviceRestorationInput); result.addListener(() -> endSignal.countDown(), executorService); endSignal.await(); } @@ -374,13 +370,10 @@ public class ServicehandlerImplTest extends AbstractTest { @Test void serviceRerouteShouldBeFailedWithEmptyInput() throws ExecutionException, InterruptedException { ListenableFuture> result = - new ServicehandlerImpl(rpcProviderService, - pathComputationService, rendererServiceOperations, notificationPublishService, - pceListenerImpl, rendererListenerImpl, networkModelListenerImpl, - serviceDataStoreOperations, catalogDataStoreOperations) - .serviceReroute(new ServiceRerouteInputBuilder() - .setServiceName("") - .build()); + new ServiceRerouteImpl(serviceDataStoreOperations, pceServiceWrapper) + .invoke(new ServiceRerouteInputBuilder() + .setServiceName("") + .build()); result.addListener(() -> endSignal.countDown(), executorService); endSignal.await(); assertEquals( @@ -392,11 +385,8 @@ public class ServicehandlerImplTest extends AbstractTest { void serviceRerouteShouldBeFailedWithNonExistService() throws ExecutionException, InterruptedException { //action -> service reconfigure ListenableFuture> result = - new ServicehandlerImpl(rpcProviderService, - pathComputationService, rendererServiceOperations, notificationPublishService, - pceListenerImpl, rendererListenerImpl, networkModelListenerImpl, - serviceDataStoreOperations, catalogDataStoreOperations) - .serviceReroute(serviceRerouteInput); + new ServiceRerouteImpl(serviceDataStoreOperations, pceServiceWrapper) + .invoke(serviceRerouteInput); result.addListener(() -> endSignal.countDown(), executorService); endSignal.await(); assertEquals( @@ -463,11 +453,8 @@ public class ServicehandlerImplTest extends AbstractTest { .build()); serviceDataStoreOperations.createService(serviceCreateInput); ListenableFuture> result = - new ServicehandlerImpl(rpcProviderService, - pathComputationService, rendererServiceOperations, notificationPublishService, - pceListenerImpl, rendererListenerImpl, networkModelListenerImpl, - serviceDataStoreOperations, catalogDataStoreOperations) - .serviceReroute(serviceRerouteInput); + new ServiceRerouteImpl(serviceDataStoreOperations, pceServiceWrapper) + .invoke(serviceRerouteInput); result.addListener(() -> endSignal.countDown(), executorService); endSignal.await(); assertEquals( @@ -478,13 +465,11 @@ public class ServicehandlerImplTest extends AbstractTest { @Test void tempServiceDeleteShouldBeFailedWithEmptyInput() throws ExecutionException, InterruptedException { ListenableFuture> result = - new ServicehandlerImpl(rpcProviderService, - pathComputationService, rendererServiceOperations, notificationPublishService, - pceListenerImpl, rendererListenerImpl, networkModelListenerImpl, - serviceDataStoreOperations, catalogDataStoreOperations) - .tempServiceDelete(new TempServiceDeleteInputBuilder() - .setCommonId("") - .build()); + new TempServiceDeleteImpl(serviceDataStoreOperations, pceListenerImpl, rendererListenerImpl, + rendererServiceWrapper) + .invoke(new TempServiceDeleteInputBuilder() + .setCommonId("") + .build()); result.addListener(() -> endSignal.countDown(), executorService); endSignal.await(); RpcResult rpcResult = result.get(); @@ -499,11 +484,9 @@ public class ServicehandlerImplTest extends AbstractTest { @Test void tempServiceDeleteShouldBeFailedWithNonExistService() throws ExecutionException, InterruptedException { ListenableFuture> result = - new ServicehandlerImpl(rpcProviderService, - pathComputationService, rendererServiceOperations, notificationPublishService, - pceListenerImpl, rendererListenerImpl, networkModelListenerImpl, - serviceDataStoreOperations, catalogDataStoreOperations) - .tempServiceDelete(ServiceDataUtils.buildTempServiceDeleteInput()); + new TempServiceDeleteImpl(serviceDataStoreOperations, pceListenerImpl, rendererListenerImpl, + rendererServiceWrapper) + .invoke(ServiceDataUtils.buildTempServiceDeleteInput()); result.addListener(() -> endSignal.countDown(), executorService); endSignal.await(); assertEquals( @@ -518,11 +501,9 @@ public class ServicehandlerImplTest extends AbstractTest { TempServiceCreateInput createInput = ServiceDataUtils.buildTempServiceCreateInput(); serviceDataStoreOperations.createTempService(createInput, pathDescription); ListenableFuture> result = - new ServicehandlerImpl(rpcProviderService, - pathComputationService, rendererServiceOperations, notificationPublishService, - pceListenerImpl, rendererListenerImpl, networkModelListenerImpl, - serviceDataStoreOperations, catalogDataStoreOperations) - .tempServiceDelete(ServiceDataUtils.buildTempServiceDeleteInput(createInput.getCommonId())); + new TempServiceDeleteImpl(serviceDataStoreOperations, pceListenerImpl, rendererListenerImpl, + rendererServiceWrapper) + .invoke(ServiceDataUtils.buildTempServiceDeleteInput(createInput.getCommonId())); result.addListener(() -> endSignal.countDown(), executorService); endSignal.await(); assertEquals( @@ -533,11 +514,9 @@ public class ServicehandlerImplTest extends AbstractTest { @Test void tempServiceCreateShouldBeFailedWithEmptyInput() throws ExecutionException, InterruptedException { ListenableFuture> result = - new ServicehandlerImpl(rpcProviderService, - pathComputationService, rendererServiceOperations, notificationPublishService, - pceListenerImpl, rendererListenerImpl, networkModelListenerImpl, - serviceDataStoreOperations, catalogDataStoreOperations) - .tempServiceCreate(new TempServiceCreateInputBuilder().build()); + new TempServiceCreateImpl(serviceDataStoreOperations, pceListenerImpl, rendererListenerImpl, + networkModelListenerImpl, pceServiceWrapper) + .invoke(new TempServiceCreateInputBuilder().build()); result.addListener(() -> endSignal.countDown(), executorService); endSignal.await(); assertEquals( @@ -555,11 +534,9 @@ public class ServicehandlerImplTest extends AbstractTest { .setCommonId("bad_commonId") .build())); ListenableFuture> result = - new ServicehandlerImpl(rpcProviderService, - pathComputationService, rendererServiceOperations, notificationPublishService, - pceListenerImpl, rendererListenerImpl, networkModelListenerImpl, - serviceDSOperations, catalogDataStoreOperations) - .tempServiceCreate(ServiceDataUtils.buildTempServiceCreateInput()); + new TempServiceCreateImpl(serviceDSOperations, pceListenerImpl, rendererListenerImpl, + networkModelListenerImpl, pceServiceWrapper) + .invoke(ServiceDataUtils.buildTempServiceCreateInput()); result.addListener(() -> endSignal.countDown(), executorService); endSignal.await(); assertEquals( @@ -575,11 +552,9 @@ public class ServicehandlerImplTest extends AbstractTest { throws ExecutionException, InterruptedException { when(pathComputationService.pathComputationRequest(any())).thenReturn(Futures.immediateFuture(any())); ListenableFuture> result = - new ServicehandlerImpl(rpcProviderService, - pathComputationService, rendererServiceOperations, notificationPublishService, - pceListenerImpl, rendererListenerImpl, networkModelListenerImpl, - serviceDataStoreOperations, catalogDataStoreOperations) - .tempServiceCreate(ServiceDataUtils.buildTempServiceCreateInput()); + new TempServiceCreateImpl(serviceDataStoreOperations, pceListenerImpl, rendererListenerImpl, + networkModelListenerImpl, pceServiceWrapper) + .invoke(ServiceDataUtils.buildTempServiceCreateInput()); result.addListener(() -> endSignal.countDown(), executorService); endSignal.await(); assertEquals( @@ -591,11 +566,8 @@ public class ServicehandlerImplTest extends AbstractTest { public void addOpenroadmOperationalModesToCatalogShouldBeFailedWithEmptyInput() throws ExecutionException, InterruptedException { ListenableFuture> result = - new ServicehandlerImpl(rpcProviderService, - pathComputationService, rendererServiceOperations, notificationPublishService, - pceListenerImpl, rendererListenerImpl, networkModelListenerImpl, - serviceDataStoreOperations, catalogDataStoreOperations) - .addOpenroadmOperationalModesToCatalog(new AddOpenroadmOperationalModesToCatalogInputBuilder().build()); + new AddOpenroadmOperationalModesToCatalogImpl(catalogDataStoreOperations) + .invoke(new AddOpenroadmOperationalModesToCatalogInputBuilder().build()); Assert.assertEquals( ResponseCodes.RESPONSE_FAILED, result.get().getResult().getConfigurationResponseCommon().getResponseCode()); @@ -605,11 +577,8 @@ public class ServicehandlerImplTest extends AbstractTest { public void addSpecificOperationalModesToCatalogShouldBeFailedWithEmptyInput() throws ExecutionException, InterruptedException { ListenableFuture> result = - new ServicehandlerImpl(rpcProviderService, - pathComputationService, rendererServiceOperations, notificationPublishService, - pceListenerImpl, rendererListenerImpl, networkModelListenerImpl, - serviceDataStoreOperations, catalogDataStoreOperations) - .addSpecificOperationalModesToCatalog(new AddSpecificOperationalModesToCatalogInputBuilder().build()); + new AddSpecificOperationalModesToCatalogImpl(catalogDataStoreOperations) + .invoke(new AddSpecificOperationalModesToCatalogInputBuilder().build()); Assert.assertEquals( ResponseCodes.RESPONSE_FAILED, result.get().getResult().getConfigurationResponseCommon().getResponseCode()); @@ -619,11 +588,8 @@ public class ServicehandlerImplTest extends AbstractTest { public void addOpenroadmOperationalModesToCatalogShouldBeSuccessfulWhenAddORToCatalog() throws ExecutionException, InterruptedException { ListenableFuture> result = - new ServicehandlerImpl(rpcProviderService, - pathComputationService, rendererServiceOperations, notificationPublishService, - pceListenerImpl, rendererListenerImpl, networkModelListenerImpl, - serviceDataStoreOperations, catalogDataStoreOperations) - .addOpenroadmOperationalModesToCatalog(CatalogDataUtils.buildAddORToCatalogInput()); + new AddOpenroadmOperationalModesToCatalogImpl(catalogDataStoreOperations) + .invoke(CatalogDataUtils.buildAddORToCatalogInput()); Assert.assertEquals( ResponseCodes.RESPONSE_OK, result.get().getResult().getConfigurationResponseCommon().getResponseCode()); @@ -633,11 +599,8 @@ public class ServicehandlerImplTest extends AbstractTest { public void addSpecificOperationalModesToCatalogShouldBeSuccessfulWhenAddSpecificToCatalog() throws ExecutionException, InterruptedException { ListenableFuture> result = - new ServicehandlerImpl(rpcProviderService, - pathComputationService, rendererServiceOperations, notificationPublishService, - pceListenerImpl, rendererListenerImpl, networkModelListenerImpl, - serviceDataStoreOperations, catalogDataStoreOperations) - .addSpecificOperationalModesToCatalog(CatalogDataUtils.buildAddSpecificToCatalogInput()); + new AddSpecificOperationalModesToCatalogImpl(catalogDataStoreOperations) + .invoke(CatalogDataUtils.buildAddSpecificToCatalogInput()); Assert.assertEquals( ResponseCodes.RESPONSE_OK, result.get().getResult().getConfigurationResponseCommon().getResponseCode());