Skip to content

Commit

Permalink
add unit test for negative response in smtp pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
Valodim committed Dec 5, 2018
1 parent 64c6a14 commit bad3f20
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -845,15 +845,15 @@ public void sendMessagePipelining_without354ReplyforData_shouldThrow() throws Ex
}

@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>");
server.expect("RCPT TO:<user2@localhost>");
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(".");
Expand All @@ -868,7 +868,7 @@ public void sendMessagePipelining_with250and550ReplyforRecipients_shouldThrow()
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();
Expand Down

0 comments on commit bad3f20

Please sign in to comment.