SubscriptionManagerService implements SubscriptionManager { public synchronized void addProvider(EventProvider providerRef) { this.providers.add(providerRef); trySubscribePendingFeeds(); }  synchronized void activate(ComponentContext context); synchronized void deactivate(ComponentContext context); @Override void refresh(); synchronized void subscribe(String... feedIDs); synchronized void unsubscribe(String... feedIDs); synchronized void addProvider(EventProvider providerRef); synchronized void removeProvider(EventProvider providerRef);  }
@Test public void addProviderTest() { subManager.subscribe(feedID); Mockito.verify(eventProvider, Mockito.never()).subscribeTopics(EventProvider.TELEMETRY_TOPIC_PREFIX+feedID); subManager.activate(compContext); subManager.addProvider(eventProvider); Mockito.verify(eventProvider, Mockito.times(1)).subscribeTopics(EventProvider.TELEMETRY_TOPIC_PREFIX+feedID); subManager.unsubscribe(feedID); Mockito.verify(eventProvider, Mockito.never()).unsubscribeTopics(EventProvider.TELEMETRY_TOPIC_PREFIX+feedID); }