Search in sources :

Example 11 with ProcessingResult

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));
}
Also used : ProcessingResult(com.netflix.eureka.util.batcher.TaskProcessor.ProcessingResult) Test(org.junit.Test)

Example 12 with ProcessingResult

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));
}
Also used : ProcessingResult(com.netflix.eureka.util.batcher.TaskProcessor.ProcessingResult) Test(org.junit.Test)

Aggregations

ProcessingResult (com.netflix.eureka.util.batcher.TaskProcessor.ProcessingResult)12 Test (org.junit.Test)9 InstanceInfo (com.netflix.appinfo.InstanceInfo)1