ReviewService { public List<Review> getReviewsByPlace(String place) { List<Review> reviews = reviewRepository.findReviewsByPlace(place); return reviews; } @Autowired  ReviewService(ReviewRepository myReviewRepository);  ReviewService(); void setServices(PlanService planService, UserService userService, EmailService emailService); List<Review> getReviewsByPlace(String place); Review addReview(Review review); void deleteReview(int Id); void setReviewRepository(ReviewRepository repository);  }
@Test public void testGetReviewByPlace(){ when(repository.findReviewsByPlace(review.getPlace())).thenReturn(reviews); assertEquals(reviews, service.getReviewsByPlace(review.getPlace())); }
@Test public void testInvalidGetReviewByPlace(){ when(repository.findReviewsByPlace(review.getPlace())).thenReturn(reviews); when(repository.findReviewsByPlace(review2.getPlace())).thenReturn(reviews); assertEquals(service.getReviewsByPlace(review2.getPlace()), service.getReviewsByPlace(review.getPlace())); }