Search in sources :

Example 1 with HandledRequest

use of com.netflix.eureka.cluster.TestableHttpReplicationClient.HandledRequest in project eureka by Netflix.

the class PeerEurekaNodeTest method expectSingleBatchRequest.

private ReplicationInstance expectSingleBatchRequest() throws InterruptedException {
    HandledRequest handledRequest = httpReplicationClient.nextHandledRequest(30, TimeUnit.SECONDS);
    assertThat(handledRequest, is(notNullValue()));
    assertThat(handledRequest.getRequestType(), is(equalTo(RequestType.Batch)));
    Object data = handledRequest.getData();
    assertThat(data, is(instanceOf(ReplicationList.class)));
    List<ReplicationInstance> replications = ((ReplicationList) data).getReplicationList();
    assertThat(replications.size(), is(equalTo(1)));
    return replications.get(0);
}
Also used : ReplicationInstance(com.netflix.eureka.cluster.protocol.ReplicationInstance) ReplicationList(com.netflix.eureka.cluster.protocol.ReplicationList) HandledRequest(com.netflix.eureka.cluster.TestableHttpReplicationClient.HandledRequest)

Example 2 with HandledRequest

use of com.netflix.eureka.cluster.TestableHttpReplicationClient.HandledRequest in project eureka by Netflix.

the class PeerEurekaNodeTest method expectRequestType.

private Object expectRequestType(RequestType requestType) throws InterruptedException {
    HandledRequest handledRequest = httpReplicationClient.nextHandledRequest(60, TimeUnit.SECONDS);
    assertThat(handledRequest, is(notNullValue()));
    assertThat(handledRequest.getRequestType(), is(equalTo(requestType)));
    return handledRequest.getData();
}
Also used : HandledRequest(com.netflix.eureka.cluster.TestableHttpReplicationClient.HandledRequest)

Aggregations

HandledRequest (com.netflix.eureka.cluster.TestableHttpReplicationClient.HandledRequest)2 ReplicationInstance (com.netflix.eureka.cluster.protocol.ReplicationInstance)1 ReplicationList (com.netflix.eureka.cluster.protocol.ReplicationList)1