- private NbiNotificationsImpl nbiNotificationsImpl;
-
- @Before
- public void setUp() {
- JsonStringConverter<org.opendaylight.yang.gen.v1
- .nbi.notifications.rev201130.NotificationService> converter = new JsonStringConverter<>(
- getDataStoreContextUtil().getBindingDOMCodecServices());
- nbiNotificationsImpl = new NbiNotificationsImpl(converter, "localhost:8080");
+
+ @Mock
+ RpcProviderService rpcProviderRegistry;
+ @Mock
+ private NotificationService notificationService;
+
+ private NbiNotificationsProvider nbiNotifications;
+ public static NetworkTransactionService networkTransactionService;
+ private TopicManager topicManager;
+ private JsonStringConverter<NotificationProcessService> converterProcess;
+ private JsonStringConverter<NotificationAlarmService> converterAlarm;
+ private JsonStringConverter<NotificationTapiService> converterTapi;
+
+ @BeforeEach
+ void setUp() throws ExecutionException, InterruptedException {
+ topicManager = TopicManager.getInstance();
+ networkTransactionService = new NetworkTransactionImpl(getDataBroker());
+ converterProcess = new JsonStringConverter<>(getDataStoreContextUtil().getBindingDOMCodecServices());
+ converterAlarm = new JsonStringConverter<>(getDataStoreContextUtil().getBindingDOMCodecServices());
+ converterTapi = new JsonStringConverter<>(getDataStoreContextUtil().getBindingDOMCodecServices());
+ topicManager.setTapiConverter(converterTapi);
+ NotificationServiceDataUtils.createTapiContext(networkTransactionService);
+
+ nbiNotifications = new NbiNotificationsProvider("localhost:8080", "localhost:8080",
+ rpcProviderRegistry, notificationService, getDataStoreContextUtil().getBindingDOMCodecServices(),
+ networkTransactionService);
+ }
+
+ @Test
+ void getNotificationsServiceEmptyDataTest() throws InterruptedException, ExecutionException {
+ ListenableFuture<RpcResult<GetNotificationsProcessServiceOutput>> result =
+ new GetNotificationsProcessServiceImpl(converterProcess, "localhost:8080")
+ .invoke(new GetNotificationsProcessServiceInputBuilder().build());
+ assertNull(result.get().getResult().getNotificationsProcessService(), "Should be null");