    @Test
    public void shouldSendEmail() throws Exception {

        // Given
        String to = "test@codecouple.pl";
        String from = "blog@codecouple.pl";
        String title = "Title";
        String content = "Content";
        // When
        emailSender.sendEmail(to, from, title, content);
        // Then
        MimeMessage[] receivedMessages = server.getReceivedMessages();
        assertThat(receivedMessages.length).isEqualTo(1);

        MimeMessage receivedMessage = receivedMessages[0];
        assertThat(receivedMessage.getAllRecipients()[0].toString()).isEqualTo(to); //to
        assertThat(receivedMessage.getFrom()[0].toString()).isEqualTo(from); //from
        assertThat(receivedMessage.getSubject()).isEqualTo(title); //title
        assertThat(receivedMessage.getContent().toString()).contains(content); //content
        //Or
        assertThat(content).isEqualTo(GreenMailUtil.getBody(server.getReceivedMessages()[0]));
    }