@Test public void testUnsubscribeOnEventTypeRemoval() { ArgumentCaptor<Runnable> runnableArg = ArgumentCaptor.forClass(Runnable.class); when(taskScheduler.scheduleWithFixedDelay(runnableArg.capture(), anyLong())).thenReturn(Mockito.mock(ScheduledFuture.class)); ArgumentCaptor<SuccessCallback> successArg = ArgumentCaptor.forClass(SuccessCallback.class); ListenableFuture<SubscribeContextResponse> responseFuture = Mockito.mock(ListenableFuture.class); doNothing().when(responseFuture).addCallback(successArg.capture(), any()); when(ngsiClient.subscribeContext(any(), any(), any())).thenReturn(responseFuture); Configuration configuration = getBasicConf(); subscriptionManager.setConfiguration(configuration); runnableArg.getValue().run(); callSuccessCallback(successArg); ListenableFuture<UnsubscribeContextResponse> responseFuture2 = Mockito.mock(ListenableFuture.class); doNothing().when(responseFuture2).addCallback(successArg.capture(), any()); when(ngsiClient.unsubscribeContext(eq("http: Configuration emptyConfiguration = new Configuration(); emptyConfiguration.setEventTypeIns(Collections.emptyList()); subscriptionManager.setConfiguration(emptyConfiguration); Assert.notNull(successArg.getValue()); }
public void setConfiguration(Configuration configuration) { hostURI = configuration.getHost(); subscriptions = migrateSubscriptions(configuration); eventTypeIns = configuration.getEventTypeIns(); scheduleSubscriptionTask(); }
SubscriptionManager { public void setConfiguration(Configuration configuration) { hostURI = configuration.getHost(); subscriptions = migrateSubscriptions(configuration); eventTypeIns = configuration.getEventTypeIns(); scheduleSubscriptionTask(); } }
SubscriptionManager { public void setConfiguration(Configuration configuration) { hostURI = configuration.getHost(); subscriptions = migrateSubscriptions(configuration); eventTypeIns = configuration.getEventTypeIns(); scheduleSubscriptionTask(); }  }
SubscriptionManager { public void setConfiguration(Configuration configuration) { hostURI = configuration.getHost(); subscriptions = migrateSubscriptions(configuration); eventTypeIns = configuration.getEventTypeIns(); scheduleSubscriptionTask(); }  void setConfiguration(Configuration configuration); boolean validateSubscriptionId(String subscriptionId, String originatorUrl); @PreDestroy void shutdownGracefully(); HttpHeaders getHeadersForProvider(Provider provider); }
SubscriptionManager { public void setConfiguration(Configuration configuration) { hostURI = configuration.getHost(); subscriptions = migrateSubscriptions(configuration); eventTypeIns = configuration.getEventTypeIns(); scheduleSubscriptionTask(); }  void setConfiguration(Configuration configuration); boolean validateSubscriptionId(String subscriptionId, String originatorUrl); @PreDestroy void shutdownGracefully(); HttpHeaders getHeadersForProvider(Provider provider);  }