@Test
public void testGetHosts() {

    String zone = "us-east-1c";
    String hostname = "1.2.3.4";
    Application app = new Application();
    AmazonInfo amazonInfo = AmazonInfo.Builder.newBuilder()
            .addMetadata(MetaDataKey.availabilityZone, zone).build();
    InstanceInfo instance = InstanceInfo.Builder.newBuilder()
            .setInstanceId(UUID.randomUUID().toString())
            .setDataCenterInfo(amazonInfo)
            .setHostName(hostname)
            .setAppName(APPLICATION_NAME)
            .build();
    app.addInstance(instance);
    when(eurekaClient.getApplication(APPLICATION_NAME)).thenReturn(app);
    List<Host> hosts = hostsSupplier.getHosts();
    assertFalse(hosts.isEmpty());
    assertEquals(hostname, hosts.get(0).getHostName());
    assertEquals(zone, hosts.get(0).getRack());
}