EurekaServiceDiscovery extends AbstractServiceDiscovery { @Override public List<ServiceInstance> getInstances(String serviceName) throws NullPointerException { Application application = this.eurekaClient.getApplication(serviceName); if (application == null) { return emptyList(); } List<InstanceInfo> infos = application.getInstances(); List<ServiceInstance> instances = new ArrayList<>(); for (InstanceInfo info : infos) { instances.add(buildServiceInstance(info)); } return instances; }  @Override void initialize(URL registryURL); @Override void destroy(); @Override void register(ServiceInstance serviceInstance); @Override void update(ServiceInstance serviceInstance); @Override void unregister(ServiceInstance serviceInstance); @Override Set<String> getServices(); @Override List<ServiceInstance> getInstances(String serviceName);  }
@Test public void testGetInstances() { serviceDiscovery.getServices().forEach(serviceName -> { assertNotNull(serviceDiscovery.getInstances(serviceName)); }); }