james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From btell...@apache.org
Subject [17/21] james-project git commit: MAILBOX-342 Simplify CassandraPerUserMaxQuotaManagerTest
Date Fri, 06 Jul 2018 09:27:43 GMT
MAILBOX-342 Simplify CassandraPerUserMaxQuotaManagerTest


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

Branch: refs/heads/master
Commit: e9ff0dcea200ab9891be5650323b86a167c50c74
Parents: 93a122d
Author: benwa <btellier@linagora.com>
Authored: Thu Jul 5 16:44:21 2018 +0700
Committer: benwa <btellier@linagora.com>
Committed: Fri Jul 6 16:25:51 2018 +0700

----------------------------------------------------------------------
 .../cassandra/quota/CassandraPerUserMaxQuotaManagerTest.java  | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/e9ff0dce/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/quota/CassandraPerUserMaxQuotaManagerTest.java
----------------------------------------------------------------------
diff --git a/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/quota/CassandraPerUserMaxQuotaManagerTest.java
b/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/quota/CassandraPerUserMaxQuotaManagerTest.java
index 57fec83..0ffb069 100644
--- a/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/quota/CassandraPerUserMaxQuotaManagerTest.java
+++ b/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/quota/CassandraPerUserMaxQuotaManagerTest.java
@@ -21,6 +21,7 @@ package org.apache.james.mailbox.cassandra.quota;
 
 import org.apache.james.backends.cassandra.CassandraCluster;
 import org.apache.james.backends.cassandra.DockerCassandraRule;
+import org.apache.james.mailbox.cassandra.mail.utils.GuiceUtils;
 import org.apache.james.mailbox.cassandra.modules.CassandraQuotaModule;
 import org.apache.james.mailbox.quota.MaxQuotaManager;
 import org.apache.james.mailbox.store.quota.GenericMaxQuotaManagerTest;
@@ -36,10 +37,8 @@ public class CassandraPerUserMaxQuotaManagerTest extends GenericMaxQuotaManagerT
     @Override
     protected MaxQuotaManager provideMaxQuotaManager() {
         cassandra = CassandraCluster.create(new CassandraQuotaModule(), cassandraServer.getIp(),
cassandraServer.getBindingPort());
-        return new CassandraPerUserMaxQuotaManager(
-            new CassandraPerUserMaxQuotaDao(cassandra.getConf()),
-            new CassandraPerDomainMaxQuotaDao(cassandra.getConf()),
-            new CassandraGlobalMaxQuotaDao(cassandra.getConf()));
+        return GuiceUtils.testInjector(cassandra)
+            .getInstance(CassandraPerUserMaxQuotaManager.class);
     }
 
     @After


---------------------------------------------------------------------
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