@Test public void assertExecuteWhenFetchDataIsNotEmptyForMultipleTherad() throws JobExecutionException { when(jobCaller.fetchData()).thenReturn(Arrays.<Object>asList(1, 2, 3, 4)); when(jobCaller.processData(1)).thenReturn(true); when(jobCaller.processData(2)).thenReturn(true); when(jobCaller.processData(3)).thenReturn(true); when(jobCaller.processData(4)).thenReturn(true); when(configService.getConcurrentDataProcessThreadCount()).thenReturn(2); unstreamingIndividualThroughputDataFlowElasticJob.execute(null); verify(jobCaller).processData(1); verify(jobCaller).processData(2); verify(jobCaller).processData(3); verify(jobCaller).processData(4); verify(configService).getConcurrentDataProcessThreadCount(); ElasticJobAssert.verifyForIsNotMisfireAndIsNotFailover( configService, shardingService, executionContextService, executionService, failoverService, shardingContext); ElasticJobAssert.assertProcessCountStatistics(4, 0); }