import org.opendaylight.transportpce.pce.service.PathComputationService;
import org.opendaylight.transportpce.renderer.provisiondevice.RendererServiceOperations;
import org.opendaylight.transportpce.servicehandler.ServiceInput;
-import org.opendaylight.transportpce.servicehandler.listeners.NetworkModelListenerImpl;
-import org.opendaylight.transportpce.servicehandler.listeners.PceListenerImpl;
-import org.opendaylight.transportpce.servicehandler.listeners.RendererListenerImpl;
+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.servicehandler.utils.ServiceDataUtils;
@Mock
private NotificationPublishService notificationPublishService;
@Mock
- private PceListenerImpl pceListenerImpl;
+ private PceListener pceListenerImpl;
@Mock
- private RendererListenerImpl rendererListenerImpl;
+ private RendererListener rendererListenerImpl;
@Mock
- private NetworkModelListenerImpl networkModelListenerImpl;
+ private NetworkListener networkModelListenerImpl;
private ServiceDataStoreOperations serviceDataStoreOperations;
private ServiceCreateInput serviceCreateInput;
@Test
void createServiceShouldBeFailedWithEmptyInput() throws ExecutionException, InterruptedException {
- ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(getNewDataBroker(), pathComputationService,
+ ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(pathComputationService,
rendererServiceOperations, notificationPublishService, pceListenerImpl, rendererListenerImpl,
networkModelListenerImpl, serviceDataStoreOperations);
ListenableFuture<RpcResult<ServiceCreateOutput>> result = servicehandlerImpl
new ServicesBuilder()
.setServiceName(serviceCreateInput.getServiceName())
.build()));
- ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(getNewDataBroker(), pathComputationService,
+ ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(pathComputationService,
rendererServiceOperations, notificationPublishService, pceListenerImpl, rendererListenerImpl,
networkModelListenerImpl, serviceDSOperations);
ListenableFuture<RpcResult<ServiceCreateOutput>> result = servicehandlerImpl.serviceCreate(serviceCreateInput);
void createServiceShouldBeSuccessfulWhenPerformPCESuccessful()
throws ExecutionException, InterruptedException {
when(pathComputationService.pathComputationRequest(any())).thenReturn(Futures.immediateFuture(any()));
- ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(getNewDataBroker(), pathComputationService,
+ ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(pathComputationService,
rendererServiceOperations, notificationPublishService, pceListenerImpl, rendererListenerImpl,
networkModelListenerImpl, serviceDataStoreOperations);
ListenableFuture<RpcResult<ServiceCreateOutput>> result = servicehandlerImpl.serviceCreate(serviceCreateInput);
@Test
void deleteServiceShouldBeFailedWithEmptyInput() throws ExecutionException, InterruptedException {
- ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(getNewDataBroker(), pathComputationService,
+ ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(pathComputationService,
rendererServiceOperations, notificationPublishService, pceListenerImpl, rendererListenerImpl,
networkModelListenerImpl, serviceDataStoreOperations);
ListenableFuture<RpcResult<ServiceDeleteOutput>> result = servicehandlerImpl.serviceDelete(
@Test
void deleteServiceShouldBeFailedWithNonExistService() throws ExecutionException, InterruptedException {
ServicehandlerImpl servicehandlerImpl =
- new ServicehandlerImpl(getNewDataBroker(), pathComputationService, rendererServiceOperations,
+ new ServicehandlerImpl(pathComputationService, rendererServiceOperations,
notificationPublishService, pceListenerImpl, rendererListenerImpl, networkModelListenerImpl,
serviceDataStoreOperations);
ListenableFuture<RpcResult<ServiceDeleteOutput>> result = servicehandlerImpl.serviceDelete(serviceDeleteInput);
@Test
void deleteServiceShouldBeSuccessForExistingService() throws ExecutionException, InterruptedException {
when(rendererServiceOperations.serviceDelete(any(), any())).thenReturn(Futures.immediateFuture(any()));
- ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(getNewDataBroker(), pathComputationService,
+ ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(pathComputationService,
rendererServiceOperations, notificationPublishService, pceListenerImpl, rendererListenerImpl,
networkModelListenerImpl, serviceDataStoreOperations);
serviceDataStoreOperations.createService(serviceCreateInput);
@Test
void serviceFeasibilityCheckShouldBeFailedWithEmptyInput() throws ExecutionException, InterruptedException {
- ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(getNewDataBroker(), pathComputationService,
+ ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(pathComputationService,
rendererServiceOperations, notificationPublishService, pceListenerImpl, rendererListenerImpl,
networkModelListenerImpl, serviceDataStoreOperations);
ListenableFuture<RpcResult<ServiceFeasibilityCheckOutput>> result =
void serviceFeasibilityCheckShouldBeSuccessfulWhenPerformPCESuccessful()
throws ExecutionException, InterruptedException {
when(pathComputationService.pathComputationRequest(any())).thenReturn(Futures.immediateFuture(any()));
- ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(getNewDataBroker(), pathComputationService,
+ ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(pathComputationService,
rendererServiceOperations, notificationPublishService, pceListenerImpl, rendererListenerImpl,
networkModelListenerImpl, serviceDataStoreOperations);
ListenableFuture<RpcResult<ServiceFeasibilityCheckOutput>> result =
@Test
void serviceReconfigureShouldBeFailedWithEmptyInput() throws ExecutionException, InterruptedException {
- ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(getNewDataBroker(), pathComputationService,
+ ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(pathComputationService,
rendererServiceOperations, notificationPublishService, pceListenerImpl, rendererListenerImpl,
networkModelListenerImpl, serviceDataStoreOperations);
ListenableFuture<RpcResult<ServiceReconfigureOutput>> result =
@Test
void serviceReconfigureShouldBeFailedWithNonExistService() throws ExecutionException, InterruptedException {
//action -> service reconfigure
- ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(getNewDataBroker(), pathComputationService,
+ ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(pathComputationService,
rendererServiceOperations, notificationPublishService, pceListenerImpl, rendererListenerImpl,
networkModelListenerImpl, serviceDataStoreOperations);
ListenableFuture<RpcResult<ServiceReconfigureOutput>> result = servicehandlerImpl.serviceReconfigure(
// serviceReconfigure is calling service delete method in renderer
when(rendererServiceOperations.serviceDelete(any(), any())).thenReturn(Futures.immediateFuture(any()));
//create service to reconfigure
- ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(getNewDataBroker(), pathComputationService,
+ ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(pathComputationService,
rendererServiceOperations, notificationPublishService, pceListenerImpl, rendererListenerImpl,
networkModelListenerImpl, serviceDataStoreOperations);
serviceDataStoreOperations.createService(serviceCreateInput);
@Test
void serviceReRestorationShouldBeFailedWithEmptyInput() throws ExecutionException, InterruptedException {
- ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(getNewDataBroker(), pathComputationService,
+ ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(pathComputationService,
rendererServiceOperations, notificationPublishService, pceListenerImpl, rendererListenerImpl,
networkModelListenerImpl, serviceDataStoreOperations);
ListenableFuture<RpcResult<ServiceRestorationOutput>> result = servicehandlerImpl
@Test
void serviceRestorationShouldBeFailedWithNonExistService() throws ExecutionException, InterruptedException {
//action -> service restore
- ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(getNewDataBroker(), pathComputationService,
+ ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(pathComputationService,
rendererServiceOperations, notificationPublishService, pceListenerImpl, rendererListenerImpl,
networkModelListenerImpl, serviceDataStoreOperations);
ListenableFuture<RpcResult<ServiceRestorationOutput>> result = servicehandlerImpl.serviceRestoration(
// serviceRestoration is calling service delete method in renderer
when(rendererServiceOperations.serviceDelete(any(), any())).thenReturn(Futures.immediateFuture(any()));
//create service to restore
- ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(getNewDataBroker(), pathComputationService,
+ ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(pathComputationService,
rendererServiceOperations, notificationPublishService, pceListenerImpl, rendererListenerImpl,
networkModelListenerImpl, serviceDataStoreOperations);
serviceDataStoreOperations.createService(serviceCreateInput);
@Test
void serviceRerouteShouldBeFailedWithEmptyInput() throws ExecutionException, InterruptedException {
- ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(getNewDataBroker(), pathComputationService,
+ ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(pathComputationService,
rendererServiceOperations, notificationPublishService, pceListenerImpl, rendererListenerImpl,
networkModelListenerImpl, serviceDataStoreOperations);
ListenableFuture<RpcResult<ServiceRerouteOutput>> result =
@Test
void serviceRerouteShouldBeFailedWithNonExistService() throws ExecutionException, InterruptedException {
//action -> service reconfigure
- ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(getNewDataBroker(), pathComputationService,
+ ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(pathComputationService,
rendererServiceOperations, notificationPublishService, pceListenerImpl, rendererListenerImpl,
networkModelListenerImpl, serviceDataStoreOperations);
ListenableFuture<RpcResult<ServiceRerouteOutput>> result = servicehandlerImpl
.build());
serviceDataStoreOperations.createService(serviceCreateInput);
- ListenableFuture<RpcResult<ServiceRerouteOutput>> result = new ServicehandlerImpl(getNewDataBroker(),
- pathComputationService, rendererServiceOperations, notificationPublishService, pceListenerImpl,
+ ListenableFuture<RpcResult<ServiceRerouteOutput>> result = new ServicehandlerImpl(pathComputationService,
+ rendererServiceOperations, notificationPublishService, pceListenerImpl,
rendererListenerImpl, networkModelListenerImpl, serviceDataStoreOperations)
.serviceReroute(serviceRerouteInput);
result.addListener(() -> endSignal.countDown(), executorService);
@Test
void tempServiceDeleteShouldBeFailedWithEmptyInput() throws ExecutionException, InterruptedException {
- ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(getNewDataBroker(), pathComputationService,
+ ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(pathComputationService,
rendererServiceOperations, notificationPublishService, pceListenerImpl, rendererListenerImpl,
networkModelListenerImpl, serviceDataStoreOperations);
ListenableFuture<RpcResult<TempServiceDeleteOutput>> result =
@Test
void tempServiceDeleteShouldBeFailedWithNonExistService() throws ExecutionException, InterruptedException {
- ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(getNewDataBroker(), pathComputationService,
+ ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(pathComputationService,
rendererServiceOperations, notificationPublishService, pceListenerImpl, rendererListenerImpl,
networkModelListenerImpl, serviceDataStoreOperations);
ListenableFuture<RpcResult<TempServiceDeleteOutput>> result = servicehandlerImpl.tempServiceDelete(
when(rendererServiceOperations.serviceDelete(any(), any())).thenReturn(Futures.immediateFuture(any()));
//create temp service to delete in the temp delete action
- ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(getNewDataBroker(), pathComputationService,
+ ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(pathComputationService,
rendererServiceOperations, notificationPublishService, pceListenerImpl, rendererListenerImpl,
networkModelListenerImpl, serviceDataStoreOperations);
TempServiceCreateInput createInput = ServiceDataUtils.buildTempServiceCreateInput();
@Test
void tempServiceCreateShouldBeFailedWithEmptyInput() throws ExecutionException, InterruptedException {
- ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(getNewDataBroker(), pathComputationService,
+ ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(pathComputationService,
rendererServiceOperations, notificationPublishService, pceListenerImpl, rendererListenerImpl,
networkModelListenerImpl, serviceDataStoreOperations);
ListenableFuture<RpcResult<TempServiceCreateOutput>> result =
throws ExecutionException, InterruptedException {
when(pathComputationService.pathComputationRequest(any())).thenReturn(Futures.immediateFuture(any()));
- ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(getNewDataBroker(), pathComputationService,
+ ServicehandlerImpl servicehandlerImpl = new ServicehandlerImpl(pathComputationService,
rendererServiceOperations, notificationPublishService, pceListenerImpl, rendererListenerImpl,
networkModelListenerImpl, serviceDataStoreOperations);