use of com.epam.ta.reportportal.entity.project.email.SenderCase in project commons-dao by reportportal.
the class ProjectUtilsTest method getEmailSenderCasesWithRecipientsOnly.
private Set<SenderCase> getEmailSenderCasesWithRecipientsOnly() {
SenderCase firstSenderCase = new SenderCase();
firstSenderCase.setId(1L);
firstSenderCase.setRecipients((Stream.of(userLoginsToExclude, userEmailsToExclude, userLoginsNotToExclude, userEmailsNotToExclude).flatMap(Arrays::stream).collect(Collectors.toSet())));
SenderCase secondSenderCase = new SenderCase();
secondSenderCase.setId(2L);
secondSenderCase.setRecipients((Stream.of(userLoginsToExclude, userEmailsToExclude, userLoginsNotToExclude, userEmailsNotToExclude).flatMap(Arrays::stream).collect(Collectors.toSet())));
return Sets.newHashSet(firstSenderCase, secondSenderCase);
}
use of com.epam.ta.reportportal.entity.project.email.SenderCase in project commons-dao by reportportal.
the class SenderCaseRepositoryTest method deleteRecipients.
@Test
void deleteRecipients() {
final int removed = senderCaseRepository.deleteRecipients(1L, Collections.singleton("first"));
Assertions.assertEquals(1, removed);
final SenderCase updated = senderCaseRepository.findById(1L).get();
Assertions.assertEquals(1, updated.getRecipients().size());
Assertions.assertFalse(updated.getRecipients().contains("first"));
}
Aggregations