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());
}