Search in sources :

Example 1 with HealthCheckHandler

use of com.netflix.appinfo.HealthCheckHandler in project eureka by Netflix.

the class InstanceInfoReplicatorTest method setUp.

@Before
public void setUp() throws Exception {
    discoveryClient = mock(DiscoveryClient.class);
    HealthCheckHandler healthCheckHandler = mock(HealthCheckHandler.class);
    when(discoveryClient.getHealthCheckHandler()).thenReturn(healthCheckHandler);
    when(healthCheckHandler.getStatus(any(InstanceInfo.InstanceStatus.class))).thenReturn(null);
    InstanceInfo.Builder builder = InstanceInfo.Builder.newBuilder().setIPAddr("10.10.101.00").setHostName("Hosttt").setAppName("EurekaTestApp-" + UUID.randomUUID()).setDataCenterInfo(new DataCenterInfo() {

        @Override
        public Name getName() {
            return Name.MyOwn;
        }
    }).setLeaseInfo(LeaseInfo.Builder.newBuilder().setRenewalIntervalInSecs(30).build());
    InstanceInfo instanceInfo = builder.build();
    instanceInfo.setStatus(InstanceInfo.InstanceStatus.DOWN);
    this.replicator = new InstanceInfoReplicator(discoveryClient, instanceInfo, refreshRateSeconds, burstSize);
}
Also used : DataCenterInfo(com.netflix.appinfo.DataCenterInfo) HealthCheckHandler(com.netflix.appinfo.HealthCheckHandler) InstanceInfo(com.netflix.appinfo.InstanceInfo) Before(org.junit.Before)

Aggregations

DataCenterInfo (com.netflix.appinfo.DataCenterInfo)1 HealthCheckHandler (com.netflix.appinfo.HealthCheckHandler)1 InstanceInfo (com.netflix.appinfo.InstanceInfo)1 Before (org.junit.Before)1