@Test
    void verifyMailSender() {
        assertTrue(communicationsManager.isMailSenderDefined());

        var props = new EmailProperties();
        props.setText("Test Body");
        props.setSubject("Subject");
        props.setFrom("cas@example.org");
        props.setCc(List.of("cc@example.org"));
        props.setBcc(List.of("bcc@example.org"));
        props.setReplyTo("bcc1@example.org");
        val body = EmailMessageBodyBuilder.builder().properties(props).build().get();
        var emailRequest = EmailMessageRequest.builder().emailProperties(props)
            .to(List.of("sample@example.net")).body(body).build();
        assertTrue(communicationsManager.email(emailRequest).isSuccess());
        val p = mock(Principal.class);
        when(p.getId()).thenReturn("casuser");
        when(p.getAttributes()).thenReturn(CollectionUtils.wrap("email", List.of("cas@example.org")));
        emailRequest = EmailMessageRequest.builder().emailProperties(props)
            .principal(p).attribute("email").body(body).build();
        assertTrue(communicationsManager.email(emailRequest).isSuccess());
    }
This is {@link DefaultCommunicationsManagerTests}.

@author Misagh Moayyed
@since 5.3.0
core/cas-server-core-notifications/src/test/java/org/apereo/cas/notifications/DefaultCommunicationsManagerTests.java