@Test public void testGetPeriodicPaymentCompoundSemiPaymentSemiAnnually() { AmortizationAttributes amAttrs = generateAmortizationAttributesObjectTemplate(); amAttrs.setLoanAmount(USD50000.divide(5)); amAttrs.setInterestRateAsPercent(10.); amAttrs.setCompoundingPeriodsPerYear(TimePeriod.SemiAnnually.getPeriodsPerYear()); amAttrs.setAmortizationPeriodInMonths(12); amAttrs.setPaymentFrequency(TimePeriod.SemiAnnually.getPeriodsPerYear()); MonetaryAmount result = AmortizationCalculator.getPeriodicPayment(amAttrs); MonetaryAmount expectedResult = ofUSD(5378.05); assertEquals("Amortized, compounded semi-annual, payment semimonthly", expectedResult, result); }
@Test public void testPaymentDateSemiAnnual() { testPaymentDatesWithMonthlyIntervals(TimePeriod.SemiAnnually.getPeriodsPerYear()); }