You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by ma...@apache.org on 2017/09/28 07:58:26 UTC

[2/9] james-project git commit: JAMES-2159 Fail fast when smtp auth failed in tests

JAMES-2159 Fail fast when smtp auth failed in tests


Project: http://git-wip-us.apache.org/repos/asf/james-project/repo
Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/0b286ab2
Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/0b286ab2
Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/0b286ab2

Branch: refs/heads/master
Commit: 0b286ab2b44127077dd127186d4b647ac0e9043c
Parents: c803800
Author: Matthieu Baechler <ma...@apache.org>
Authored: Tue Sep 12 18:16:59 2017 +0200
Committer: Antoine Duprat <ad...@linagora.com>
Committed: Wed Sep 27 16:07:08 2017 +0200

----------------------------------------------------------------------
 .../src/main/java/org/apache/james/utils/SMTPMessageSender.java  | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/0b286ab2/server/testing/src/main/java/org/apache/james/utils/SMTPMessageSender.java
----------------------------------------------------------------------
diff --git a/server/testing/src/main/java/org/apache/james/utils/SMTPMessageSender.java b/server/testing/src/main/java/org/apache/james/utils/SMTPMessageSender.java
index b08c5d2..837fc29 100644
--- a/server/testing/src/main/java/org/apache/james/utils/SMTPMessageSender.java
+++ b/server/testing/src/main/java/org/apache/james/utils/SMTPMessageSender.java
@@ -49,7 +49,9 @@ public class SMTPMessageSender implements Closeable {
         throws NoSuchAlgorithmException, IOException, InvalidKeySpecException, InvalidKeyException {
         AuthenticatingSMTPClient smtpClient = new AuthenticatingSMTPClient();
         smtpClient.connect(ip, port);
-        smtpClient.auth(AuthenticatingSMTPClient.AUTH_METHOD.PLAIN, username, password);
+        if (smtpClient.auth(AuthenticatingSMTPClient.AUTH_METHOD.PLAIN, username, password) == false) {
+            throw new RuntimeException("auth failed");
+        }
         return new SMTPMessageSender(smtpClient, senderDomain);
     }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org