This is the codeAbility Sharing Platform! Learn more about the codeAbility Sharing Platform.

Skip to content
Snippets Groups Projects
Commit 5afa1914 authored by Eduard Frankford's avatar Eduard Frankford
Browse files

fixing lint

parent 63ad072a
2 merge requests!188Merging Peer Reviewing et. al to Master,!164211 peer reviewing functionality
......@@ -45,12 +45,12 @@ public class ReviewService {
Review review = new Review();
review.setResource(reviewRequest.getResource());
review.setLink(reviewRequest.getLink());
Set<ReviewRating> reviewRatings = new HashSet<>();
User loggedInUser = userService.getUserWithAuthorities().orElse(null);
if (loggedInUser == null) {
throw new UsernameNotFoundException("User not found");
}
review.setRequestedBy(loggedInUser.getId());
Set<ReviewRating> reviewRatings = new HashSet<>();
reviewRequest
.getUsers()
......@@ -160,10 +160,10 @@ public class ReviewService {
throw new UsernameNotFoundException("User not found, unable to update ReviewRating");
}
Review review = reviewRepository.findById(reviewDTO.getId()).get();
if (review.getRequestedBy().equals(user.getId()) && !reviewDTO.getStatus().get(0).equals("DELETION REQUESTED")) {
if (review.getRequestedBy().equals(user.getId()) && !"DELETION REQUESTED".equals(reviewDTO.getStatus().get(0))) {
throw new IllegalAccessException("User is not allowed to update ReviewRating");
}
if (review.getRequestedBy().equals(user.getId()) && reviewDTO.getStatus().get(0).equals("DELETION REQUESTED")) {
if (review.getRequestedBy().equals(user.getId()) && "DELETION REQUESTED".equals(reviewDTO.getStatus().get(0))) {
deleteReview(review.getId());
return;
}
......
......@@ -35,6 +35,7 @@ import org.springframework.web.servlet.support.ServletUriComponentsBuilder;
* <p>
*/
@Service
@SuppressWarnings("PMD")
public class SearchService {
private final Logger log = LoggerFactory.getLogger(SearchService.class);
......
......@@ -173,8 +173,7 @@ public class InfoMailServiceIT {
public void setup() {
MockitoAnnotations.openMocks(this);
doNothing().when(javaMailSender).send(any(MimeMessage.class));
mailService =
new MailService(jHipsterProperties, javaMailSender, messageSource, templateEngine, userRepository, userWatchListService);
mailService = new MailService(jHipsterProperties, messageSource, templateEngine, userRepository, userWatchListService);
}
private String original = null;
......
......@@ -76,8 +76,7 @@ class MailServiceIT {
public void setup() {
MockitoAnnotations.openMocks(this);
doNothing().when(javaMailSender).send(any(MimeMessage.class));
mailService =
new MailService(jHipsterProperties, javaMailSender, messageSource, templateEngine, userRepository, userWatchListService);
mailService = new MailService(jHipsterProperties, messageSource, templateEngine, userRepository, userWatchListService);
}
@Test
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment