ReviewController { @RequestMapping(value = "/getReview", method = RequestMethod.POST) public List<Review> GetReviews(@Validated(Create.class) @RequestBody Review review) { return reviewService.getReviewsByPlace(review.getPlace()); } @Autowired  ReviewController(ReviewService reviewService);  ReviewController(); void setReviewService(ReviewService service); @RequestMapping(value = "/createReview", method = RequestMethod.POST) Review createReview(@Validated(Create.class) @RequestBody Review review); @RequestMapping(value = "/getReview", method = RequestMethod.POST) List<Review> GetReviews(@Validated(Create.class) @RequestBody Review review);  }
@Test public void testGetReviews() { when(service.getReviewsByPlace(review.getPlace())).thenReturn(reviews); assertEquals(reviews, controller.GetReviews(review)); }
@Test public void testInvalidGetReviews() { when(service.getReviewsByPlace(review.getPlace())).thenReturn(reviews); when(service.getReviewsByPlace(review2.getPlace())).thenReturn(reviews); assertEquals(controller.GetReviews(review2), controller.GetReviews(review)); }