Skip to content

Commit

Permalink
[MINOR] Fix ThreadPoolTest Lint
Browse files Browse the repository at this point in the history
This commit fixes the instance of linting error in our tests.
  • Loading branch information
Baunsgaard committed Aug 21, 2023
1 parent 18d7936 commit bd82dab
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -390,8 +390,11 @@ public void invokeAndShutdownV2() throws InterruptedException {
ExecutorService c = new CommonThreadPool(p);
Collection<Callable<Integer>> cc = (Collection<Callable<Integer>>) null;
List<Future<Integer>> f = new ArrayList<Future<Integer>>();
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<Integer> {
}
}

0 comments on commit bd82dab

Please sign in to comment.