james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From btell...@apache.org
Subject [10/10] james-project git commit: JAMES-2441 Remove some useless exceptions
Date Mon, 02 Jul 2018 04:49:36 GMT
JAMES-2441 Remove some useless exceptions


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

Branch: refs/heads/master
Commit: dca7006e48f51e8b6a5c3a5a4b312e2628e10965
Parents: dc2c3ea
Author: benwa <btellier@linagora.com>
Authored: Fri Jun 29 10:49:21 2018 +0700
Committer: benwa <btellier@linagora.com>
Committed: Mon Jul 2 11:48:53 2018 +0700

----------------------------------------------------------------------
 .../modules/spamassassin/SpamAssassinConfigurationLoader.java | 5 ++---
 .../spamassassin/SpamAssassinConfigurationLoaderTest.java     | 7 +++----
 2 files changed, 5 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/dca7006e/server/container/guice/mailbox-plugin-spamassassin/src/main/java/org/apache/james/modules/spamassassin/SpamAssassinConfigurationLoader.java
----------------------------------------------------------------------
diff --git a/server/container/guice/mailbox-plugin-spamassassin/src/main/java/org/apache/james/modules/spamassassin/SpamAssassinConfigurationLoader.java
b/server/container/guice/mailbox-plugin-spamassassin/src/main/java/org/apache/james/modules/spamassassin/SpamAssassinConfigurationLoader.java
index 9eaf2b2..819fcf0 100644
--- a/server/container/guice/mailbox-plugin-spamassassin/src/main/java/org/apache/james/modules/spamassassin/SpamAssassinConfigurationLoader.java
+++ b/server/container/guice/mailbox-plugin-spamassassin/src/main/java/org/apache/james/modules/spamassassin/SpamAssassinConfigurationLoader.java
@@ -21,7 +21,6 @@ package org.apache.james.modules.spamassassin;
 
 import java.util.Optional;
 
-import org.apache.commons.configuration.ConfigurationException;
 import org.apache.commons.configuration.PropertiesConfiguration;
 import org.apache.james.mailbox.spamassassin.SpamAssassinConfiguration;
 import org.apache.james.util.Host;
@@ -37,12 +36,12 @@ public class SpamAssassinConfigurationLoader {
         return new SpamAssassinConfiguration(Optional.empty());
     }
 
-    public static SpamAssassinConfiguration fromProperties(PropertiesConfiguration configuration)
throws ConfigurationException {
+    public static SpamAssassinConfiguration fromProperties(PropertiesConfiguration configuration)
{
         Host host = getHost(configuration);
         return new SpamAssassinConfiguration(Optional.of(host));
     }
 
-    private static Host getHost(PropertiesConfiguration propertiesReader) throws ConfigurationException
{
+    private static Host getHost(PropertiesConfiguration propertiesReader) {
         return Host.from(propertiesReader.getString(SPAMASSASSIN_HOST, DEFAULT_HOST), 
                 propertiesReader.getInteger(SPAMASSASSIN_PORT, DEFAULT_PORT));
     }

http://git-wip-us.apache.org/repos/asf/james-project/blob/dca7006e/server/container/guice/mailbox-plugin-spamassassin/src/test/java/org/apache/james/modules/spamassassin/SpamAssassinConfigurationLoaderTest.java
----------------------------------------------------------------------
diff --git a/server/container/guice/mailbox-plugin-spamassassin/src/test/java/org/apache/james/modules/spamassassin/SpamAssassinConfigurationLoaderTest.java
b/server/container/guice/mailbox-plugin-spamassassin/src/test/java/org/apache/james/modules/spamassassin/SpamAssassinConfigurationLoaderTest.java
index 81a3341..13fe8d4 100644
--- a/server/container/guice/mailbox-plugin-spamassassin/src/test/java/org/apache/james/modules/spamassassin/SpamAssassinConfigurationLoaderTest.java
+++ b/server/container/guice/mailbox-plugin-spamassassin/src/test/java/org/apache/james/modules/spamassassin/SpamAssassinConfigurationLoaderTest.java
@@ -22,7 +22,6 @@ import static org.assertj.core.api.Assertions.assertThat;
 
 import org.apache.commons.configuration.PropertiesConfiguration;
 import org.apache.james.mailbox.spamassassin.SpamAssassinConfiguration;
-import org.apache.james.modules.spamassassin.SpamAssassinConfigurationLoader;
 import org.apache.james.util.Host;
 import org.junit.Test;
 
@@ -35,19 +34,19 @@ public class SpamAssassinConfigurationLoaderTest {
     }
 
     @Test
-    public void isEnableShouldReturnTrueWhenEnable() throws Exception {
+    public void isEnableShouldReturnTrueWhenEnable() {
         SpamAssassinConfiguration configuration = SpamAssassinConfigurationLoader.fromProperties(new
PropertiesConfiguration());
         assertThat(configuration.isEnable()).isTrue();
     }
 
     @Test
-    public void hostShouldReturnDefaultWhenConfigurationIsEmpty() throws Exception {
+    public void hostShouldReturnDefaultWhenConfigurationIsEmpty() {
         SpamAssassinConfiguration configuration = SpamAssassinConfigurationLoader.fromProperties(new
PropertiesConfiguration());
         assertThat(configuration.getHost().get()).isEqualTo(Host.from(SpamAssassinConfigurationLoader.DEFAULT_HOST,
SpamAssassinConfigurationLoader.DEFAULT_PORT));
     }
 
     @Test
-    public void hostShouldReturnCustomWhenConfigurationIsProvided() throws Exception {
+    public void hostShouldReturnCustomWhenConfigurationIsProvided() {
         PropertiesConfiguration propertiesConfiguration = new PropertiesConfiguration();
         String host = "10.69.1.123";
         propertiesConfiguration.addProperty("spamassassin.host", host);


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


Mime
View raw message