Search in sources :

Example 1 with NoRequiredRetryException

use of com.alibaba.nacos.naming.push.v2.NoRequiredRetryException in project nacos by alibaba.

the class PushExecuteTaskTest method testRunFailedWithNoRetry.

@Test
public void testRunFailedWithNoRetry() {
    PushDelayTask delayTask = new PushDelayTask(service, 0L);
    PushExecuteTask executeTask = new PushExecuteTask(service, delayTaskExecuteEngine, delayTask);
    pushExecutor.setShouldSuccess(false);
    pushExecutor.setFailedException(new NoRequiredRetryException());
    executeTask.run();
    assertEquals(1, MetricsMonitor.getFailedPushMonitor().get());
    verify(delayTaskExecuteEngine, never()).addTask(eq(service), any(PushDelayTask.class));
}
Also used : NoRequiredRetryException(com.alibaba.nacos.naming.push.v2.NoRequiredRetryException) Test(org.junit.Test)

Aggregations

NoRequiredRetryException (com.alibaba.nacos.naming.push.v2.NoRequiredRetryException)1 Test (org.junit.Test)1