@Test void quotaCheckerShouldNotThrowOnReachedMaximumQuotas() throws MailboxException { when(mockedQuotaRootResolver.getQuotaRoot(MAILBOX_PATH)).thenReturn(QUOTA_ROOT); when(mockedQuotaManager.getMessageQuota(QUOTA_ROOT)).thenReturn( Quota.<QuotaCountLimit, QuotaCountUsage>builder().used(QuotaCountUsage.count(10)).computedLimit(QuotaCountLimit.count(100)).build()); when(mockedQuotaManager.getStorageQuota(QUOTA_ROOT)).thenReturn( Quota.<QuotaSizeLimit, QuotaSizeUsage>builder().used(QuotaSizeUsage.size(100)).computedLimit(QuotaSizeLimit.size(1000)).build()); QuotaChecker quotaChecker = new QuotaChecker(mockedQuotaManager, mockedQuotaRootResolver, MAILBOX); quotaChecker.tryAddition(90, 900); }
public void tryAddition(long count, long size) throws OverQuotaException { tryCountAddition(count); trySizeAddition(size); }
QuotaChecker { public void tryAddition(long count, long size) throws OverQuotaException { tryCountAddition(count); trySizeAddition(size); } }
QuotaChecker { public void tryAddition(long count, long size) throws OverQuotaException { tryCountAddition(count); trySizeAddition(size); } QuotaChecker(QuotaManager quotaManager, QuotaRootResolver quotaRootResolver, Mailbox mailbox);  QuotaChecker(Quota<QuotaCountLimit, QuotaCountUsage> messageQuota, Quota<QuotaSizeLimit, QuotaSizeUsage> sizeQuota, QuotaRoot quotaRoot); }
QuotaChecker { public void tryAddition(long count, long size) throws OverQuotaException { tryCountAddition(count); trySizeAddition(size); } QuotaChecker(QuotaManager quotaManager, QuotaRootResolver quotaRootResolver, Mailbox mailbox);  QuotaChecker(Quota<QuotaCountLimit, QuotaCountUsage> messageQuota, Quota<QuotaSizeLimit, QuotaSizeUsage> sizeQuota, QuotaRoot quotaRoot); void tryAddition(long count, long size); }
QuotaChecker { public void tryAddition(long count, long size) throws OverQuotaException { tryCountAddition(count); trySizeAddition(size); } QuotaChecker(QuotaManager quotaManager, QuotaRootResolver quotaRootResolver, Mailbox mailbox);  QuotaChecker(Quota<QuotaCountLimit, QuotaCountUsage> messageQuota, Quota<QuotaSizeLimit, QuotaSizeUsage> sizeQuota, QuotaRoot quotaRoot); void tryAddition(long count, long size);  }