name = "testSettingIdHashShardingStrategyWithoutNumberOfShards")
public void testSettingIdHashShardingStrategyWithoutNumberOfShards() {
Map<String, String> shardingProperties = new HashMap<String, String>();
shardingProperties.put( "hibernate.search.default.sharding_strategy", IdHashShardingStrategy.class.getName() );
EntityIndexBinding entityIndexBinding = getSearchFactory( shardingProperties ).getIndexBinding( Foo.class );
// 1 is assumed for legacy reasons. IMO not setting the number of shards should throw an exception
assertTrue(
"Without specifying number of shards, 1 should be assumed",
entityIndexBinding.getSelectionStrategy().getIndexManagersForAllShards().length == 1
);
Assert.assertEquals( "Wrong invocation count", 1, BytemanHelper.getAndResetInvocationCount() );
}