ConfigurationReader reader = new ConfigurationReader(Continent.class, WeatherReport.class);
Hive hive = getHive();
HiveShardSelector selector = new HiveShardSelector(reader.getHiveConfiguration(), hive);
WeatherReport report = WeatherReportImpl.generate();
ShardId id = selector.selectShardIdForNewObject(report);
Assert.assertNotNull(id);
Collection<Integer> nodeIds = Transform.map(new Unary<Node, Integer>() {
public Integer f(Node n) {
return n.getId();
}
}, hive.getNodes());
assertTrue(Filter.grepItemAgainstList(new Integer(id.getId()), nodeIds));
}