assertEquals("one recommendation", movie2, recommendations.get(0).getMovie());
assertEquals("one recommendation", 3, recommendations.get(0).getRating());
}
@Test
public void testRateMovie() throws Exception {
Movie movie = movieRepository.save(new Movie("1", "Test-Movie"));
User user = userRepository.save(new User("me", "me", "me"));
user.rate(template, movie, 5, "comment");
movie = movieRepository.findById("1");
final Rating rating = IteratorUtil.first(movie.getRatings());
assertEquals("rating stars", 5, rating.getStars());
assertEquals("rating comment", "comment", rating.getComment());
assertEquals("rating user", user, rating.getUser());
assertEquals("rating movie", movie, rating.getMovie());
}