assertEquals("2 correct movies found by query", new HashSet<Movie>(asList(movie1, movie2)), new HashSet<Movie>(found));
}
@Test
public void testFindTwoMoviesButRestrictToOne() throws Exception {
Movie movie1 = movieRepository.save(new Movie("1", "Test-Movie1"));
Movie movie2 = movieRepository.save(new Movie("2", "Test-Movie2"));
Movie movie3 = movieRepository.save(new Movie("3", "Another-Movie3"));
List<Movie> found = movieRepository.findByTitleLike("Test*", new PageRequest(0, 1)).getContent();
assertEquals("1 movie found",1,found.size());
assertTrue("1 correct movie found by query", found.get(0).getTitle().startsWith("Test"));
}