}
@Test
public void testCreateReviewAndFindAndDelete()
throws DuplicateInstanceException, InstanceNotFoundException {
User user1 = userService.registerUser("userPassword", new UserDetails(
"name", "lastName", "user1@udc.es", "user1"));
reviewService.createReviewType("global");
reviewService.createReviewType("quality");
ReviewRatingDto rvdto1 = new ReviewRatingDto("global", 2);
ReviewRatingDto rvdto2 = new ReviewRatingDto("quality", 5);
List<ReviewRatingDto> reviewRatingsDto = new ArrayList<ReviewRatingDto>();
reviewRatingsDto.add(rvdto1);
reviewRatingsDto.add(rvdto2);
Review r1 = reviewService.createReview("review 1", user.getUserId(),
journal.getJournalId(), reviewRatingsDto);
try {
reviewService.createReview("review 1", user.getUserId(),
journal.getJournalId(), reviewRatingsDto);
} catch (DuplicateInstanceException e) {
}
Review r2 = reviewService.createReview("review 2", user1.getUserId(),
journal.getJournalId(), reviewRatingsDto);
Block<Review> reviewsBlock = reviewService.findReviewsByJournal(
journal.getJournalId(), 0, 10);
assertEquals(2, reviewsBlock.getList().size());