@Test
public void testIndexUnavailable() throws IndexNotFoundException {
final Configuration configuration = mock(Configuration.class);
final Indices indices = mock(Indices.class);
when(indices.numberOfMessages("name")).thenThrow(IndexNotFoundException.class).thenReturn(1L);
when(configuration.getElasticSearchMaxDocsPerIndex()).thenReturn(5);
final MessageCountRotationStrategy strategy = new MessageCountRotationStrategy(configuration,
indices);
final RotationStrategy.Result rotate = strategy.shouldRotate("name");