use of com.netflix.eureka.util.batcher.TaskProcessor.ProcessingResult in project eureka by Netflix.
the class ReplicationTaskProcessorTest method testBatchableTaskCongestionFailureHandling.
@Test
public void testBatchableTaskCongestionFailureHandling() throws Exception {
TestableInstanceReplicationTask task = aReplicationTask().build();
replicationClient.withNetworkStatusCode(503);
ProcessingResult status = replicationTaskProcessor.process(Collections.<ReplicationTask>singletonList(task));
assertThat(status, is(ProcessingResult.Congestion));
assertThat(task.getProcessingState(), is(ProcessingState.Pending));
}
use of com.netflix.eureka.util.batcher.TaskProcessor.ProcessingResult in project eureka by Netflix.
the class ReplicationTaskProcessorTest method testBatchableTaskNetworkFailureHandling.
@Test
public void testBatchableTaskNetworkFailureHandling() throws Exception {
TestableInstanceReplicationTask task = aReplicationTask().build();
replicationClient.withNetworkError(1);
ProcessingResult status = replicationTaskProcessor.process(Collections.<ReplicationTask>singletonList(task));
assertThat(status, is(ProcessingResult.TransientError));
assertThat(task.getProcessingState(), is(ProcessingState.Pending));
}
Aggregations