JobShardingStrategyFactory { public static JobShardingStrategy getStrategy(final String jobShardingStrategyClassName) { return getStrategy(null, jobShardingStrategyClassName); }  static JobShardingStrategy getStrategy(final String jobShardingStrategyClassName); static JobShardingStrategy getStrategy(final GlobalConfigurationService globalConfigService, final String jobShardingStrategyFullPath);  }
@Test public void assertGetDefaultStrategy() { assertThat(JobShardingStrategyFactory.getStrategy(null), instanceOf(AverageAllocationJobShardingStrategy.class)); }
@Test(expected = IllegalStateException.class) public void assertGetStrategyFailureWhenNotStrategyClass() { JobShardingStrategyFactory.getStrategy(Object.class.getName()); }
@Test(expected = JobShardingStrategyClassConfigurationException.class) public void assertGetStrategyFailureWhenStrategyClassInvalid() { JobShardingStrategyFactory.getStrategy(InvalidJobShardingStrategy.class.getName()); }
@Test public void assertGetStrategySuccess() { assertThat(JobShardingStrategyFactory.getStrategy(AverageAllocationJobShardingStrategy.class.getName()), instanceOf(AverageAllocationJobShardingStrategy.class)); }