ShardingContexts implements Serializable { public ShardingContext createShardingContext(final int shardingItem) { return new ShardingContext(jobName, taskId, shardingTotalCount, jobParameter, shardingItem, shardingItemParameters.get(shardingItem)); } ShardingContexts(final String taskId, final String jobName, final int shardingTotalCount, final String jobParameter,
                            final Map<Integer, String> shardingItemParameters, final int jobEventSamplingCount); ShardingContext createShardingContext(final int shardingItem);  }
@Test public void assertCreateShardingContext() { ShardingContexts shardingContexts = createShardingContexts(); ShardingContext actual = shardingContexts.createShardingContext(1); assertThat(actual.getJobName(), is(shardingContexts.getJobName())); assertThat(actual.getTaskId(), is(shardingContexts.getTaskId())); assertThat(actual.getShardingTotalCount(), is(shardingContexts.getShardingTotalCount())); assertThat(actual.getJobParameter(), is(shardingContexts.getJobParameter())); assertThat(actual.getShardingItem(), is(1)); assertThat(actual.getShardingParameter(), is(shardingContexts.getShardingItemParameters().get(1))); }