use of org.mifos.accounts.productdefinition.business.LoanOfferingBO in project head by mifos.
the class FinancialBusinessServiceIntegrationTest method getLoanAccount.
private LoanBO getLoanAccount() {
Date startDate = new Date(System.currentTimeMillis());
MeetingBO meeting = TestObjectFactory.createMeeting(TestObjectFactory.getTypicalMeeting());
center = TestObjectFactory.createWeeklyFeeCenter(this.getClass().getSimpleName() + " Center", meeting);
group = TestObjectFactory.createWeeklyFeeGroupUnderCenter(this.getClass().getSimpleName() + " Group", CustomerStatus.GROUP_ACTIVE, center);
LoanOfferingBO loanOffering = TestObjectFactory.createLoanOffering(this.getClass().getSimpleName() + "", "FL", startDate, meeting);
return TestObjectFactory.createLoanAccount("42423142341", group, AccountState.LOAN_ACTIVE_IN_GOOD_STANDING, startDate, loanOffering);
}
use of org.mifos.accounts.productdefinition.business.LoanOfferingBO in project head by mifos.
the class AccountFeesEntityIntegrationTest method getLoanAccount.
private AccountBO getLoanAccount() {
MeetingBO meeting = TestObjectFactory.createMeeting(TestObjectFactory.getNewMeetingForToday(WEEKLY, EVERY_WEEK, CUSTOMER_MEETING));
center = TestObjectFactory.createWeeklyFeeCenter("Center", meeting);
group = TestObjectFactory.createWeeklyFeeGroupUnderCenter("Group", CustomerStatus.GROUP_ACTIVE, center);
LoanOfferingBO loanOffering = TestObjectFactory.createLoanOffering("Loan", ApplicableTo.GROUPS, new Date(System.currentTimeMillis()), PrdStatus.LOAN_ACTIVE, 300.0, 1.2, 3, InterestType.FLAT, meeting);
return TestObjectFactory.createLoanAccount("42423142341", group, AccountState.LOAN_ACTIVE_IN_GOOD_STANDING, new Date(System.currentTimeMillis()), loanOffering);
}
use of org.mifos.accounts.productdefinition.business.LoanOfferingBO in project head by mifos.
the class LoanBOForReversalIntegrationTest method createLoanAccount.
private void createLoanAccount() {
long transactionCount = getStatisticsService().getSuccessfulTransactionCount();
Date startDate = new Date(System.currentTimeMillis());
createInitialCustomers();
LoanOfferingBO loanOffering = TestObjectFactory.createLoanOffering(startDate, center.getCustomerMeeting().getMeeting());
loan = TestObjectFactory.createLoanAccount("42423142341", group, AccountState.LOAN_APPROVED, startDate, loanOffering);
long numberOfTransactions = getStatisticsService().getSuccessfulTransactionCount() - transactionCount;
// TODO: numberOfTransactions needs to be 0, but is 8
Assert.assertTrue("numberOfTransactions=" + numberOfTransactions + " should be less than: " + 8, numberOfTransactions <= 8);
}
use of org.mifos.accounts.productdefinition.business.LoanOfferingBO in project head by mifos.
the class AccountServiceIntegrationTest method getLoanAccount.
private AccountBO getLoanAccount() {
Date startDate = new Date(System.currentTimeMillis());
MeetingBO meeting = TestObjectFactory.createMeeting(TestObjectFactory.getNewMeetingForToday(WEEKLY, EVERY_WEEK, CUSTOMER_MEETING));
center = TestObjectFactory.createWeeklyFeeCenter("Center", meeting);
group = TestObjectFactory.createWeeklyFeeGroupUnderCenter("Group", CustomerStatus.GROUP_ACTIVE, center);
LoanOfferingBO loanOffering = TestObjectFactory.createLoanOffering(startDate, meeting);
return TestObjectFactory.createLoanAccount("42423142341", group, AccountState.LOAN_ACTIVE_IN_GOOD_STANDING, startDate, loanOffering);
}
use of org.mifos.accounts.productdefinition.business.LoanOfferingBO in project head by mifos.
the class LoanPrdActionStrutsTest method testUpdate.
@Test
public void testUpdate() throws Exception {
FeeBO fee = TestObjectFactory.createPeriodicAmountFee("Loan Periodic", FeeCategory.LOAN, "100.0", RecurrenceType.MONTHLY, (short) 1);
LoanOfferingBO product = createLoanOfferingBO("Loan Offering", "LOAN");
setRequestPathInfo("/loanproductaction.do");
addRequestParameter("method", "manage");
addRequestParameter("prdOfferingId", product.getPrdOfferingId().toString());
addRequestParameter(Constants.CURRENTFLOWKEY, flowKey);
actionPerform();
flowKey = (String) request.getAttribute(Constants.CURRENTFLOWKEY);
setRequestPathInfo("/loanproductaction.do");
addRequestParameter("method", "editPreview");
addRequestParameter(Constants.CURRENTFLOWKEY, flowKey);
addRequestParameter("prdOfferingName", "Loan Product");
addRequestParameter("prdOfferingShortName", "LOAP");
addRequestParameter("prdCategory", "1");
addRequestParameter("startDate", offSetCurrentDate(0, userContext.getPreferredLocale()));
addRequestParameter("endDate", offSetCurrentDate(1, userContext.getPreferredLocale()));
addRequestParameter("prdApplicableMaster", "1");
addRequestParameter("minLoanAmount", "2000");
addRequestParameter("maxLoanAmount", "11000");
addRequestParameter("defaultLoanAmount", "5000");
addRequestParameter("interestTypes", "1");
addRequestParameter("maxInterestRate", "12");
addRequestParameter("minInterestRate", "1");
addRequestParameter("defInterestRate", "4");
addRequestParameter("freqOfInstallments", "2");
addRequestParameter("prdOfferinFees", new String[] { fee.getFeeId().toString() });
addRequestParameter("loanOfferingFunds", new String[] { "1" });
addRequestParameter("recurAfter", "1");
addRequestParameter("maxNoInstallments", "14");
addRequestParameter("minNoInstallments", "2");
addRequestParameter("defNoInstallments", "11");
addRequestParameter("intDedDisbursementFlag", "1");
addRequestParameter("prdStatus", "2");
addRequestParameter("loanAmtCalcType", "1");
addRequestParameter("calcInstallmentType", "1");
actionPerform();
setRequestPathInfo("/loanproductaction.do");
addRequestParameter("method", "update");
addRequestParameter(Constants.CURRENTFLOWKEY, flowKey);
actionPerform();
verifyNoActionErrors();
verifyNoActionMessages();
verifyForward(ActionForwards.update_success.toString());
StaticHibernateUtil.flushSession();
product = (LoanOfferingBO) TestObjectFactory.getObject(LoanOfferingBO.class, product.getPrdOfferingId());
Assert.assertEquals("Loan Product", product.getPrdOfferingName());
Assert.assertEquals("LOAP", product.getPrdOfferingShortName());
Assert.assertEquals(PrdStatus.SAVINGS_ACTIVE, product.getStatus());
for (LoanAmountSameForAllLoanBO loanAmountSameForAllLoanBO : product.getLoanAmountSameForAllLoan()) {
Assert.assertEquals(new Double("11000"), loanAmountSameForAllLoanBO.getMaxLoanAmount());
Assert.assertEquals(new Double("2000"), loanAmountSameForAllLoanBO.getMinLoanAmount());
Assert.assertEquals(new Double("5000"), loanAmountSameForAllLoanBO.getDefaultLoanAmount());
}
Assert.assertEquals(Short.valueOf("1"), product.getLoanOfferingMeeting().getMeeting().getMeetingDetails().getRecurAfter());
Assert.assertEquals(Short.valueOf("2"), product.getLoanOfferingMeeting().getMeeting().getMeetingDetails().getRecurrenceType().getRecurrenceId());
Assert.assertEquals(1, product.getLoanOfferingFees().size());
Assert.assertNull(((FlowManager) request.getSession().getAttribute(Constants.FLOWMANAGER)).getFlow(flowKey));
TestObjectFactory.removeObject(product);
fee = null;
}
Aggregations