cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject [1/2] git commit: updated refs/heads/4.7 to d681574
Date Tue, 05 Jan 2016 14:26:47 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/4.7 9be76b350 -> d6815742b


QuotaStatementTest: fix the method invocation verification


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

Branch: refs/heads/4.7
Commit: 0eac900fc4953fb36c6b37e7c0ee52184443efbd
Parents: 9be76b3
Author: Abhinandan Prateek <abhinandan.prateek@shapeblue.com>
Authored: Mon Jan 4 16:28:42 2016 +0530
Committer: Rohit Yadav <rohit.yadav@shapeblue.com>
Committed: Tue Jan 5 11:04:33 2016 +0530

----------------------------------------------------------------------
 .../test/org/apache/cloudstack/quota/QuotaStatementTest.java | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/0eac900f/framework/quota/test/org/apache/cloudstack/quota/QuotaStatementTest.java
----------------------------------------------------------------------
diff --git a/framework/quota/test/org/apache/cloudstack/quota/QuotaStatementTest.java b/framework/quota/test/org/apache/cloudstack/quota/QuotaStatementTest.java
index f2a0ded..d1cc7ac 100644
--- a/framework/quota/test/org/apache/cloudstack/quota/QuotaStatementTest.java
+++ b/framework/quota/test/org/apache/cloudstack/quota/QuotaStatementTest.java
@@ -22,7 +22,6 @@ import com.cloud.utils.db.TransactionLegacy;
 import junit.framework.TestCase;
 import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
 import org.apache.cloudstack.quota.QuotaStatementImpl.STATEMENT_PERIODS;
-import org.apache.cloudstack.quota.constant.QuotaConfig;
 import org.apache.cloudstack.quota.dao.QuotaAccountDao;
 import org.apache.cloudstack.quota.dao.QuotaUsageDao;
 import org.apache.cloudstack.quota.vo.QuotaAccountVO;
@@ -224,6 +223,7 @@ public class QuotaStatementTest extends TestCase {
 
     }
 
+
     @Test
     public void testSendStatement() throws UnsupportedEncodingException, MessagingException
{
         Calendar date = Calendar.getInstance();
@@ -242,13 +242,11 @@ public class QuotaStatementTest extends TestCase {
         Mockito.when(quotaUsage.findTotalQuotaUsage(Mockito.anyLong(), Mockito.anyLong(),
Mockito.anyInt(), Mockito.any(Date.class), Mockito.any(Date.class)))
                 .thenReturn(new BigDecimal(100));
 
-        QuotaAlertManagerImpl.DeferredQuotaEmail email = new QuotaAlertManagerImpl.DeferredQuotaEmail(accountVO,
acc, new BigDecimal(100),
-                QuotaConfig.QuotaEmailTemplateTypes.QUOTA_LOW);
         // call real method on send monthly statement
-        Mockito.doCallRealMethod().when(quotaStatement).sendStatement();
+        quotaStatement.sendStatement();
         Calendar period[] = quotaStatement.statementTime(date, STATEMENT_PERIODS.MONTHLY);
         if (period != null){
-            Mockito.verify(alertManager, Mockito.times(1)).sendQuotaAlert(email);
+            Mockito.verify(alertManager, Mockito.times(1)).sendQuotaAlert(Mockito.any(QuotaAlertManagerImpl.DeferredQuotaEmail.class));
         }
     }
 


Mime
View raw message