JobExecutionMultipleShardingContext extends AbstractJobExecutionShardingContext { public JobExecutionSingleShardingContext createJobExecutionSingleShardingContext(final int item) { JobExecutionSingleShardingContext result = new JobExecutionSingleShardingContext(); try { BeanUtils.copyProperties(result, this); } catch (final IllegalAccessException | InvocationTargetException ex) { throw new JobException(ex); } result.setShardingItem(item); result.setShardingItemParameter(shardingItemParameters.get(item)); result.setOffset(offsets.get(item)); return result; }  JobExecutionSingleShardingContext createJobExecutionSingleShardingContext(final int item); @Override String toString(); String toScriptArguments();  }
@Test public void assertCreateJobExecutionSingleShardingContext() { JobExecutionMultipleShardingContext shardingContext = createShardingContext(); JobExecutionSingleShardingContext actual = shardingContext.createJobExecutionSingleShardingContext(0); assertThat(actual.getJobName(), is("testJob")); assertThat(actual.getShardingTotalCount(), is(10)); assertNull(actual.getJobParameter()); assertFalse(actual.isMonitorExecution()); assertThat(actual.getFetchDataCount(), is(0)); assertThat(actual.getShardingItem(), is(0)); assertThat(actual.getShardingItemParameter(), is("param0")); assertThat(actual.getOffset(), is("offset0")); }