use of com.netflix.eureka.cluster.protocol.ReplicationInstance in project eureka by Netflix.
the class PeerEurekaNodeTest method testHeartbeatReplicationFailure.
@Test
public void testHeartbeatReplicationFailure() throws Throwable {
httpReplicationClient.withNetworkStatusCode(200, 200);
// Not found, to trigger registration
httpReplicationClient.withBatchReply(404);
createPeerEurekaNode().heartbeat(instanceInfo.getAppName(), instanceInfo.getId(), instanceInfo, null, false);
// Heartbeat replied with an error
ReplicationInstance replicationInstance = expectSingleBatchRequest();
assertThat(replicationInstance.getAction(), is(equalTo(Action.Heartbeat)));
// Second, registration task is scheduled
replicationInstance = expectSingleBatchRequest();
assertThat(replicationInstance.getAction(), is(equalTo(Action.Register)));
}
use of com.netflix.eureka.cluster.protocol.ReplicationInstance in project eureka by Netflix.
the class PeerEurekaNodeTest method testStatusUpdateBatchReplication.
@Test
public void testStatusUpdateBatchReplication() throws Throwable {
createPeerEurekaNode().statusUpdate(instanceInfo.getAppName(), instanceInfo.getId(), InstanceStatus.DOWN, instanceInfo);
ReplicationInstance replicationInstance = expectSingleBatchRequest();
assertThat(replicationInstance.getAction(), is(equalTo(Action.StatusUpdate)));
}
Aggregations