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);
}
Aggregations