Skip to content

Commit

Permalink
EPMRPP-89476 || CRUD for Slack Notification rule
Browse files Browse the repository at this point in the history
  • Loading branch information
APiankouski authored Apr 25, 2024
1 parent d48694b commit ab72f42
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public void validateCreateRQ(Project project, SenderCaseDTO senderCaseDTO) {
.map(NotificationConfigConverter.TO_CASE_RESOURCE)
.filter(existing -> equalsWithoutRuleName(existing, senderCaseDTO)).findFirst();
expect(duplicate, Optional::isEmpty).verify(BAD_REQUEST_ERROR,
"Project notification settings contain duplicate cases"
"Project notification settings contain duplicate cases for this communication channel"
);
}

Expand All @@ -75,16 +75,18 @@ public void validateUpdateRQ(Project project, SenderCaseDTO senderCaseDTO) {
.map(NotificationConfigConverter.TO_CASE_RESOURCE)
.filter(o1 -> equalsWithoutRuleName(o1, senderCaseDTO)).findFirst();
expect(duplicate, Optional::isEmpty).verify(BAD_REQUEST_ERROR,
"Project notification settings contain duplicate cases"
"Project notification settings contain duplicate cases for this communication channel"
);
}

private void validateSenderCase(Project project, SenderCaseDTO senderCaseDTO) {
validateRecipients(senderCaseDTO);

expect(senderCaseDTO.getType(), Objects::nonNull).verify(ErrorType.BAD_REQUEST_ERROR,
"Notification type");

if (senderCaseDTO.getType().equals("email")) {
validateRecipients(senderCaseDTO);
}

normalizeCreateNotificationRQ(project, senderCaseDTO);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ public void createNotificationWithDuplicateContentButWithDifferentRuleNameTest()

assertTrue(assertThrows(ReportPortalException.class,
() -> service.createNotification(project, createNotificationRQ, rpUser)
).getMessage().contains("Project notification settings contain duplicate cases"));
).getMessage().contains("Project notification settings contain duplicate cases for this communication channel"));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ public void updateNotificationWithDuplicateContentButWithDifferentRuleNameTest()

assertTrue(assertThrows(ReportPortalException.class,
() -> service.updateNotification(project, updateNotificationRQ, rpUser)
).getMessage().contains("Project notification settings contain duplicate cases"));
).getMessage().contains("Project notification settings contain duplicate cases for this communication channel"));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ void createProjectPositive() throws Exception {
.with(token(oAuthHelper.getSuperadminToken()))).andExpect(status().isCreated());
final Optional<Project> createdProjectOptional = projectRepository.findByName("TestProject".toLowerCase());
assertTrue(createdProjectOptional.isPresent());
assertEquals(14, createdProjectOptional.get().getProjectAttributes().size());
assertEquals(15, createdProjectOptional.get().getProjectAttributes().size());
assertEquals(5, createdProjectOptional.get().getProjectIssueTypes().size());
}

Expand Down

0 comments on commit ab72f42

Please sign in to comment.