JAMES-2015 return empty instead of null in SMTPAuthSuccessful
Project: http://git-wip-us.apache.org/repos/asf/james-project/repo Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/6e6fdae8 Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/6e6fdae8 Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/6e6fdae8 Branch: refs/heads/master Commit: 6e6fdae820ebba821bc2850eba066bbf71aa13a7 Parents: 5a781fb Author: Luc DUZAN <[email protected]> Authored: Wed May 10 09:15:22 2017 +0200 Committer: benwa <[email protected]> Committed: Wed May 17 15:12:55 2017 +0700 ---------------------------------------------------------------------- .../org/apache/james/transport/matchers/SMTPAuthSuccessful.java | 3 ++- .../apache/james/transport/matchers/SMTPAuthSuccessfulTest.java | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/james-project/blob/6e6fdae8/mailet/standard/src/main/java/org/apache/james/transport/matchers/SMTPAuthSuccessful.java ---------------------------------------------------------------------- diff --git a/mailet/standard/src/main/java/org/apache/james/transport/matchers/SMTPAuthSuccessful.java b/mailet/standard/src/main/java/org/apache/james/transport/matchers/SMTPAuthSuccessful.java index 9d36095..016aeca 100644 --- a/mailet/standard/src/main/java/org/apache/james/transport/matchers/SMTPAuthSuccessful.java +++ b/mailet/standard/src/main/java/org/apache/james/transport/matchers/SMTPAuthSuccessful.java @@ -21,6 +21,7 @@ package org.apache.james.transport.matchers; +import com.google.common.collect.ImmutableList; import org.apache.mailet.base.GenericMatcher; import org.apache.mailet.Mail; import org.apache.mailet.MailAddress; @@ -48,7 +49,7 @@ public class SMTPAuthSuccessful extends GenericMatcher { if (authUser != null) { return mail.getRecipients(); } else { - return null; + return ImmutableList.of(); } } } http://git-wip-us.apache.org/repos/asf/james-project/blob/6e6fdae8/mailet/standard/src/test/java/org/apache/james/transport/matchers/SMTPAuthSuccessfulTest.java ---------------------------------------------------------------------- diff --git a/mailet/standard/src/test/java/org/apache/james/transport/matchers/SMTPAuthSuccessfulTest.java b/mailet/standard/src/test/java/org/apache/james/transport/matchers/SMTPAuthSuccessfulTest.java index 238374e..0ca0337 100644 --- a/mailet/standard/src/test/java/org/apache/james/transport/matchers/SMTPAuthSuccessfulTest.java +++ b/mailet/standard/src/test/java/org/apache/james/transport/matchers/SMTPAuthSuccessfulTest.java @@ -65,7 +65,7 @@ public class SMTPAuthSuccessfulTest { Collection<MailAddress> results = testee.match(fakeMail); - assertThat(results).isNull(); + assertThat(results).isEmpty(); } } --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
