@Test public void updateSubscribersVerifyExecutorServiceCalls() { ChargingStation chargingStation = getRegisteredAndConfiguredChargingStation(); when(subscriptionRepository.findAll()).thenReturn(SUBSCRIPTIONS); subscribeService.updateSubscribers(chargingStation, FIVE_MINUTES_AGO); verify(executorService, times(SUBSCRIPTIONS.size())).execute(any(SubscriptionUpdater.class)); }
public void updateSubscribers(ChargingStation chargingStation, Date timestampStatusChange) { StatusChange change = new StatusChange(chargingStation.getId(), timestampStatusChange, chargingStation.getState(), chargingStation.getNumberOfFreeEvses()); List<Subscription> subscriptions = subscriptionRepository.findAll(); for (Subscription subscription : subscriptions) { executorService.execute(new SubscriptionUpdater(subscriberClient, subscription, change)); } }
VasSubscriberService { public void updateSubscribers(ChargingStation chargingStation, Date timestampStatusChange) { StatusChange change = new StatusChange(chargingStation.getId(), timestampStatusChange, chargingStation.getState(), chargingStation.getNumberOfFreeEvses()); List<Subscription> subscriptions = subscriptionRepository.findAll(); for (Subscription subscription : subscriptions) { executorService.execute(new SubscriptionUpdater(subscriberClient, subscription, change)); } } }
VasSubscriberService { public void updateSubscribers(ChargingStation chargingStation, Date timestampStatusChange) { StatusChange change = new StatusChange(chargingStation.getId(), timestampStatusChange, chargingStation.getState(), chargingStation.getNumberOfFreeEvses()); List<Subscription> subscriptions = subscriptionRepository.findAll(); for (Subscription subscription : subscriptions) { executorService.execute(new SubscriptionUpdater(subscriberClient, subscription, change)); } }  }
VasSubscriberService { public void updateSubscribers(ChargingStation chargingStation, Date timestampStatusChange) { StatusChange change = new StatusChange(chargingStation.getId(), timestampStatusChange, chargingStation.getState(), chargingStation.getNumberOfFreeEvses()); List<Subscription> subscriptions = subscriptionRepository.findAll(); for (Subscription subscription : subscriptions) { executorService.execute(new SubscriptionUpdater(subscriberClient, subscription, change)); } }  void updateSubscribers(ChargingStation chargingStation, Date timestampStatusChange); void setSubscriptionRepository(SubscriptionRepository subscriptionRepository); void setExecutorService(ExecutorService executorService); void setSubscriberClient(SubscriberClient subscriberClient); }
VasSubscriberService { public void updateSubscribers(ChargingStation chargingStation, Date timestampStatusChange) { StatusChange change = new StatusChange(chargingStation.getId(), timestampStatusChange, chargingStation.getState(), chargingStation.getNumberOfFreeEvses()); List<Subscription> subscriptions = subscriptionRepository.findAll(); for (Subscription subscription : subscriptions) { executorService.execute(new SubscriptionUpdater(subscriberClient, subscription, change)); } }  void updateSubscribers(ChargingStation chargingStation, Date timestampStatusChange); void setSubscriptionRepository(SubscriptionRepository subscriptionRepository); void setExecutorService(ExecutorService executorService); void setSubscriberClient(SubscriberClient subscriberClient);  }