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));
}
Aggregations