@Override
  public List<ServiceDTO> getServiceInstances(String serviceId) {
    Application application = eurekaClient.getApplication(serviceId);
    if (application == null || CollectionUtils.isEmpty(application.getInstances())) {
      Tracer.logEvent("Apollo.Discovery.NotFound", serviceId);
      return Collections.emptyList();
    }
    return application.getInstances().stream().map(instanceInfoToServiceDTOFunc)
        .collect(Collectors.toList());
  }
@Test
  public void testGetServiceInstances() throws URISyntaxException {
    String someUri = "http://1.2.3.4:8080/some-path/";
    String someInstanceId = "someInstanceId";
    InstanceInfo someServiceInstance = mockServiceInstance(someServiceId, someInstanceId,
        someUri);

    String anotherUri = "http://2.3.4.5:9090/anotherPath";
    String anotherInstanceId = "anotherInstanceId";
    InstanceInfo anotherServiceInstance = mockServiceInstance(someServiceId, anotherInstanceId,
        anotherUri);

    when(eurekaClient.getApplication(someServiceId)).thenReturn(someApplication);
    when(someApplication.getInstances())
        .thenReturn(Lists.newArrayList(someServiceInstance, anotherServiceInstance));

    List<ServiceDTO> serviceDTOList = defaultDiscoveryService.getServiceInstances(someServiceId);

    assertEquals(2, serviceDTOList.size());
    check(someServiceInstance, serviceDTOList.get(0));
    check(anotherServiceInstance, serviceDTOList.get(1));
  }