import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
-import java.util.Arrays;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.mockito.Mock;
@Mock
RpcProviderService rpcProviderRegistry;
-
@Mock
private NotificationService notificationService;
@Test
void initTest() {
networkTransactionService = new NetworkTransactionImpl(getDataBroker());
- NbiNotificationsProvider provider = new NbiNotificationsProvider(
- Arrays.asList("topic1", "topic2"), Arrays.asList("topic1", "topic2"), "localhost:8080",
- "localhost:8080", rpcProviderRegistry, notificationService,
- getDataStoreContextUtil().getBindingDOMCodecServices(), networkTransactionService);
- provider.init();
- verify(rpcProviderRegistry, times(2))
- .registerRpcImplementation(any(), any(NbiNotificationsImpl.class));
+ 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));
}