### Question:
HotelServiceImpl implements HotelService { public ReviewsSummary getReviewSummary(Hotel hotel) { List<RatingCount> ratingCounts = this.hotelSummaryRepository.findRatingCounts(hotel); return new ReviewsSummaryImpl(ratingCounts); }  Hotel getHotel(City city, String name); Page<Review> getReviews(Hotel hotel, Pageable pageable); Review getReview(Hotel hotel, int reviewNumber); Review addReview(Hotel hotel, ReviewDetails details); ReviewsSummary getReviewSummary(Hotel hotel); @Autowired void setHotelRepository(HotelRepository hotelRepository); @Autowired void setHotelSummaryRepository(HotelSummaryRepository hotelSummaryRepository); @Autowired void setReviewRepository(ReviewRepository reviewRepository);  }### Answer:
@Test public void shouldGetReviewSummary() throws Exception { List<RatingCount> ratingCounts = new ArrayList<RatingCount>(); ratingCounts.add(new RatingCount(Rating.EXCELLENT, 10)); ratingCounts.add(new RatingCount(Rating.AVERAGE, 9)); ratingCounts.add(new RatingCount(Rating.GOOD, 8)); given(hotelSummaryRepository.findRatingCounts(hotel)).willReturn(ratingCounts); ReviewsSummary summary = hotelService.getReviewSummary(hotel); assertThat(summary.getNumberOfReviewsWithRating(Rating.EXCELLENT), is(10L)); assertThat(summary.getNumberOfReviewsWithRating(Rating.AVERAGE), is(9L)); assertThat(summary.getNumberOfReviewsWithRating(Rating.GOOD), is(8L)); assertThat(summary.getNumberOfReviewsWithRating(Rating.POOR), is(0L)); }