import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
-import java.util.Arrays;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import org.opendaylight.mdsal.binding.api.NotificationService;
import org.opendaylight.mdsal.binding.api.RpcProviderService;
-import org.opendaylight.transportpce.nbinotifications.listener.NbiNotificationsListenerImpl;
+import org.opendaylight.transportpce.common.network.NetworkTransactionImpl;
+import org.opendaylight.transportpce.common.network.NetworkTransactionService;
import org.opendaylight.transportpce.test.AbstractTest;
public class NbiNotificationsProviderTest extends AbstractTest {
+ public static NetworkTransactionService networkTransactionService;
@Mock
RpcProviderService rpcProviderRegistry;
-
@Mock
private NotificationService notificationService;
- @Before
- public void init() {
+ @BeforeEach
+ void init() {
MockitoAnnotations.openMocks(this);
-
}
@Test
- public void initTest() {
- NbiNotificationsProvider provider = new NbiNotificationsProvider(
- Arrays.asList("topic1", "topic2"), Arrays.asList("topic1", "topic2"), "localhost:8080",
- "localhost:8080", rpcProviderRegistry, notificationService,
- getDataStoreContextUtil().getBindingDOMCodecServices());
- provider.init();
- verify(rpcProviderRegistry, times(1))
- .registerRpcImplementation(any(), any(NbiNotificationsImpl.class));
+ void initTest() {
+ networkTransactionService = new NetworkTransactionImpl(getDataBroker());
+ new NbiNotificationsProvider("localhost:8080", "localhost:8080",
+ rpcProviderRegistry, notificationService, getDataStoreContextUtil().getBindingDOMCodecServices(),
+ networkTransactionService);
+ verify(rpcProviderRegistry, times(1)).registerRpcImplementations(any());
verify(notificationService, times(1))
- .registerNotificationListener(any(NbiNotificationsListenerImpl.class));
+ .registerCompositeListener(any(NotificationService.CompositeListener.class));
}
}