Search in sources :

Example 1 with SenderCase

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);
}
Also used : SenderCase(com.epam.ta.reportportal.entity.project.email.SenderCase)

Example 2 with SenderCase

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"));
}
Also used : SenderCase(com.epam.ta.reportportal.entity.project.email.SenderCase) Test(org.junit.jupiter.api.Test) BaseTest(com.epam.ta.reportportal.BaseTest)

Aggregations

SenderCase (com.epam.ta.reportportal.entity.project.email.SenderCase)2 BaseTest (com.epam.ta.reportportal.BaseTest)1 Test (org.junit.jupiter.api.Test)1