ExecutorImpl implements Executor { private <T> Future<T> submitTask(String action, Callable<T> execution) { try { return executor.submit(execution); } catch (RejectedExecutionException e) { logger.warn(errorCode("TASK_REJECTED"), "reject task due to server is shutting down, action={}", action, e); return new CancelledFuture<>(); } } ExecutorImpl(int poolSize, String name, LogManager logManager); void shutdown(); void awaitTermination(long timeoutInMs); @Override Future<T> submit(String action, Callable<T> task); @Override void submit(String action, Task task, Duration delay);  }
@Test void submitTask() throws ExecutionException, InterruptedException { Future<Void> future = executor.submit("action", () -> { ActionLog actionLog = LogManager.CURRENT_ACTION_LOG.get(); assertThat(actionLog.action).isEqualTo("task:action"); assertThat(actionLog.context).doesNotContainKey("root_action"); assertThat(actionLog.trace).isFalse(); }); assertThat(future.get()).isNull(); }