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);
}
Aggregations