diff --git a/src/test/java/org/apache/sysds/test/component/misc/ThreadPool.java b/src/test/java/org/apache/sysds/test/component/misc/ThreadPool.java index 41659e57261..b19e2cf6633 100644 --- a/src/test/java/org/apache/sysds/test/component/misc/ThreadPool.java +++ b/src/test/java/org/apache/sysds/test/component/misc/ThreadPool.java @@ -295,8 +295,8 @@ public void justWorksShutdownNowNotMain() throws InterruptedException, Execution } @Test - public void mock1() throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException, - InterruptedException, ExecutionException, TimeoutException { + public void mock1() throws NoSuchFieldException, SecurityException, IllegalArgumentException, + IllegalAccessException, InterruptedException, ExecutionException, TimeoutException { ExecutorService p = mock(ExecutorService.class); ExecutorService c = new CommonThreadPool(p); @@ -347,8 +347,8 @@ public void mock1() throws NoSuchFieldException, SecurityException, IllegalArgum } @Test - public void mock2() throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException, - InterruptedException, ExecutionException, TimeoutException { + public void mock2() throws NoSuchFieldException, SecurityException, IllegalArgumentException, + IllegalAccessException, InterruptedException, ExecutionException, TimeoutException { CommonThreadPool p = mock(CommonThreadPool.class); when(p.isShutdown()).thenCallRealMethod(); @@ -390,8 +390,11 @@ public void invokeAndShutdownV2() throws InterruptedException { ExecutorService c = new CommonThreadPool(p); Collection> cc = (Collection>) null; List> f = new ArrayList>(); - f.add(mock(Future.class)); + f.add(mock(FI.class)); when(p.invokeAll(cc)).thenReturn(f); CommonThreadPool.invokeAndShutdown(c, null); } + + private interface FI extends Future { + } }