}
}
@Test
public void testFullPhraseSearchPageNumberTooBig() {
Topic expectedTopic = PersistedObjectsFactory.getDefaultTopic();
expectedTopic.setTitle(TOPIC_CONTENT);
saveAndFlushIndexes(Arrays.asList(expectedTopic));
configureMocks(TOPIC_CONTENT, TOPIC_CONTENT);
PageRequest pageRequest = new PageRequest("1000", 50);
Page<Topic> searchResultPage =
topicSearchDao.searchByTitleAndContent(TOPIC_CONTENT, pageRequest,
Arrays.asList(expectedTopic.getBranch().getId()));
Assert.assertEquals(searchResultPage.getNumber(), 1);
Assert.assertTrue(searchResultPage.hasContent(), "Search result must not be empty.");
for (Topic topic : searchResultPage.getContent()) {
Assert.assertEquals(expectedTopic.getTitle(), topic.getTitle(),
"Content from the index should be the same as in the database.");
}
}