JobShardingStrategyFactory { public static JobShardingStrategy getStrategy(final String type) { if (Strings.isNullOrEmpty(type)) { return STRATEGIES.get(DEFAULT_STRATEGY); } if (!STRATEGIES.containsKey(type)) { throw new JobConfigurationException("Can not find sharding sharding type '%s'.", type); } return STRATEGIES.get(type); }  static JobShardingStrategy getStrategy(final String type);  }
@Test public void assertGetDefaultStrategy() { assertThat(JobShardingStrategyFactory.getStrategy(null), instanceOf(AverageAllocationJobShardingStrategy.class)); }
@Test(expected = JobConfigurationException.class) public void assertGetInvalidStrategy() { JobShardingStrategyFactory.getStrategy("INVALID"); }
@Test public void assertGetStrategy() { assertThat(JobShardingStrategyFactory.getStrategy("ODEVITY"), instanceOf(OdevitySortByNameJobShardingStrategy.class)); }