Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bad3f208 authored by Vincent Breitmoser's avatar Vincent Breitmoser
Browse files

add unit test for negative response in smtp pipeline

parent 64c6a14e
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -845,7 +845,7 @@ public class SmtpTransportTest {
    }

    @Test
    public void sendMessagePipelining_with250and550ReplyforRecipients_shouldThrow() throws Exception {
    public void sendMessagePipelining_with250and550ReplyforRecipients_shouldThrowFirst() throws Exception {
        Message message = getMessageWithTwoRecipients();
        MockSmtpServer server = createServerAndSetupForPlainAuthentication("PIPELINING");
        server.expect("MAIL FROM:<user@localhost>");
@@ -853,7 +853,7 @@ public class SmtpTransportTest {
        server.expect("RCPT TO:<user3@localhost>");
        server.expect("DATA");
        server.output("250 OK");
        server.output("250 OK");
        server.output("550 remote mail to <user2@localhost> not allowed");
        server.output("550 remote mail to <user3@localhost> not allowed");
        server.output("354 End data with <CR><LF>.<CR><LF>");
        server.expect(".");
@@ -868,7 +868,7 @@ public class SmtpTransportTest {
            fail("Expected exception");
        } catch (NegativeSmtpReplyException e) {
            assertEquals(550, e.getReplyCode());
            assertEquals("remote mail to <user3@localhost> not allowed", e.getReplyText());
            assertEquals("remote mail to <user2@localhost> not allowed", e.getReplyText());
        }

        server.verifyConnectionClosed();