import org.opendaylight.mdsal.binding.api.DataBroker;
import org.opendaylight.mdsal.binding.api.DataTreeChangeListener;
import org.opendaylight.mdsal.binding.api.NotificationPublishService;
+import org.opendaylight.transportpce.networkmodel.service.NetworkModelService;
+import org.opendaylight.transportpce.pce.service.PathComputationService;
+import org.opendaylight.transportpce.renderer.provisiondevice.RendererServiceOperations;
+import org.opendaylight.transportpce.servicehandler.listeners.NetworkModelNotificationHandler;
+import org.opendaylight.transportpce.servicehandler.listeners.PceNotificationHandler;
+import org.opendaylight.transportpce.servicehandler.listeners.RendererNotificationHandler;
import org.opendaylight.transportpce.servicehandler.service.ServiceDataStoreOperations;
import org.opendaylight.transportpce.test.AbstractTest;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.networkmodel.rev201116.TransportpceNetworkmodelListener;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev220808.TransportpcePceListener;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev210915.TransportpceRendererListener;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.OrgOpenroadmServiceService;
import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.service.list.Services;
@ExtendWith(MockitoExtension.class)
-public class ServicehandlerProviderTest extends AbstractTest {
+public class ServiceHandlerProviderTest extends AbstractTest {
@Mock
- DataBroker dataBroker;
+ RendererServiceOperations rendererServiceOperations;
@Mock
- ServiceDataStoreOperations serviceDataStoreOperations;
+ PathComputationService pathComputationService;
@Mock
- TransportpcePceListener pceListenerImpl;
+ NetworkModelService networkModelService;
@Mock
- TransportpceRendererListener rendererListenerImpl;
+ DataBroker dataBroker;
@Mock
- TransportpceNetworkmodelListener networkModelListenerImpl;
+ ServiceDataStoreOperations serviceDataStoreOperations;
@Mock
NotificationPublishService notificationPublishService;
@Mock
- OrgOpenroadmServiceService servicehandler;
- @Mock
DataTreeChangeListener<Services> serviceListener;
+ private final PceNotificationHandler pceNotificationHandler = new PceNotificationHandler(rendererServiceOperations,
+ pathComputationService, notificationPublishService, serviceDataStoreOperations);
+ private final RendererNotificationHandler rendererNotificationHandler = new RendererNotificationHandler(
+ pathComputationService, notificationPublishService, networkModelService);
+ private final NetworkModelNotificationHandler networkModelNotificationHandler = new NetworkModelNotificationHandler(
+ notificationPublishService, serviceDataStoreOperations);
+
@Test
void testInitRegisterServiceHandlerToRpcRegistry() {
- new ServicehandlerProvider(dataBroker, getNotificationService() ,
- serviceDataStoreOperations, pceListenerImpl, rendererListenerImpl, networkModelListenerImpl,
- notificationPublishService, servicehandler, serviceListener);
-
+ new ServiceHandlerProvider(dataBroker, getNotificationService(),
+ serviceDataStoreOperations, pceNotificationHandler, rendererNotificationHandler,
+ networkModelNotificationHandler, serviceListener);
verify(dataBroker, times(1)).registerDataTreeChangeListener(any(), any());
}
-}
\ No newline at end of file
+}