You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by re...@apache.org on 2016/01/05 15:26:47 UTC

[1/2] git commit: updated refs/heads/4.7 to d681574

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 <ab...@shapeblue.com>
Authored: Mon Jan 4 16:28:42 2016 +0530
Committer: Rohit Yadav <ro...@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));
         }
     }
 


[2/2] git commit: updated refs/heads/4.7 to d681574

Posted by re...@apache.org.
Merge pull request #1306 from shapeblue/4.7-quota-test

4.7 quota testQuotaStatementTest: fix the method invocation verification

* pr/1306:
  QuotaStatementTest: fix the method invocation verification

Signed-off-by: Remi Bergsma <gi...@remi.nl>


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

Branch: refs/heads/4.7
Commit: d6815742b866dfa227166e4dc23dbcce9a4ced67
Parents: 9be76b3 0eac900
Author: Remi Bergsma <gi...@remi.nl>
Authored: Tue Jan 5 15:24:46 2016 +0100
Committer: Remi Bergsma <gi...@remi.nl>
Committed: Tue Jan 5 15:24:47 2016 +0100

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