- commitExecutor.delegate = Mockito.mock( ExecutorService.class );
- Mockito.doThrow( new RejectedExecutionException( "mock" ) )
- .when( commitExecutor.delegate ).execute( Mockito.any( Runnable.class ) );
- Mockito.doNothing().when( commitExecutor.delegate ).shutdown();
- Mockito.doReturn( Collections.emptyList() ).when( commitExecutor.delegate ).shutdownNow();
- Mockito.doReturn( "" ).when( commitExecutor.delegate ).toString();
- Mockito.doReturn( true ).when( commitExecutor.delegate )
- .awaitTermination( Mockito.anyLong(), Mockito.any( TimeUnit.class ) );
+ commitExecutor.delegate = Mockito.mock(ExecutorService.class);
+ Mockito.doThrow(new RejectedExecutionException("mock")).when(commitExecutor.delegate)
+ .execute(Mockito.any(Runnable.class));
+ Mockito.doNothing().when(commitExecutor.delegate).shutdown();
+ Mockito.doReturn(Collections.emptyList()).when(commitExecutor.delegate).shutdownNow();
+ Mockito.doReturn("").when(commitExecutor.delegate).toString();
+ Mockito.doReturn(true).when(commitExecutor.delegate)
+ .awaitTermination(Mockito.anyLong(), Mockito.any(TimeUnit.class));