diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/concurrent/CompletableFutureTaskTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/concurrent/CompletableFutureTaskTest.java index 75f47416ed2..27d7da6e8b8 100644 --- a/dubbo-common/src/test/java/org/apache/dubbo/common/concurrent/CompletableFutureTaskTest.java +++ b/dubbo-common/src/test/java/org/apache/dubbo/common/concurrent/CompletableFutureTaskTest.java @@ -88,12 +88,13 @@ public void run() { } - @Test +@Test public void testCustomExecutor() { Executor mockedExecutor = mock(Executor.class); CompletableFuture completableFuture = CompletableFuture.supplyAsync(() -> { return 0; - }, mockedExecutor); - verify(mockedExecutor, times(1)).execute(any()); + }); + completableFuture.thenRunAsync(mock(Runnable.class), mockedExecutor).whenComplete((s, e) -> + verify(mockedExecutor, times(1)).execute(any(Runnable.class))); } } \ No newline at end of file