Search in sources :

Example 1 with CashFlowFormMatcher

use of org.mifos.platform.cashflow.matchers.CashFlowFormMatcher in project head by mifos.

the class CashFlowControllerTest method prepareCashFlowForm.

@Test
public void prepareCashFlowForm() throws Exception {
    CashFlowDetail cashFlowDetail = new CashFlowDetail(new ArrayList<MonthlyCashFlowDetail>());
    Mockito.when(cashFlowService.cashFlowFor(2012, 1, 12)).thenReturn(cashFlowDetail);
    CashFlowController cashFlowController = new CashFlowController(cashFlowService);
    BigDecimal loanAmount = new BigDecimal("1234");
    Double indebtednessRatio = 12d;
    CashFlowForm cashFlowForm = cashFlowController.prepareCashFlowForm(2012, 1, 12, loanAmount, indebtednessRatio, true);
    CashFlowForm expectedCashFlowForm = new CashFlowForm(cashFlowDetail, true, loanAmount, indebtednessRatio);
    assertThat(cashFlowForm, new CashFlowFormMatcher(expectedCashFlowForm));
    Mockito.verify(cashFlowService).cashFlowFor(2012, 1, 12);
}
Also used : MonthlyCashFlowDetail(org.mifos.platform.cashflow.service.MonthlyCashFlowDetail) CashFlowDetail(org.mifos.platform.cashflow.service.CashFlowDetail) CashFlowForm(org.mifos.platform.cashflow.ui.model.CashFlowForm) CashFlowFormMatcher(org.mifos.platform.cashflow.matchers.CashFlowFormMatcher) MonthlyCashFlowDetail(org.mifos.platform.cashflow.service.MonthlyCashFlowDetail) BigDecimal(java.math.BigDecimal) Test(org.junit.Test)

Aggregations

BigDecimal (java.math.BigDecimal)1 Test (org.junit.Test)1 CashFlowFormMatcher (org.mifos.platform.cashflow.matchers.CashFlowFormMatcher)1 CashFlowDetail (org.mifos.platform.cashflow.service.CashFlowDetail)1 MonthlyCashFlowDetail (org.mifos.platform.cashflow.service.MonthlyCashFlowDetail)1 CashFlowForm (org.mifos.platform.cashflow.ui.model.CashFlowForm)1