use of org.mifos.accounts.productdefinition.business.LoanOfferingBO in project head by mifos.
the class ClientBoTest method testIsDisbursalPreventedDueToAnyExistingActiveLoansForTheSameProductDoesNotFetchLoanOfferingIfNoActiveLoanAccounts.
@Test
public void testIsDisbursalPreventedDueToAnyExistingActiveLoansForTheSameProductDoesNotFetchLoanOfferingIfNoActiveLoanAccounts() throws Exception {
// setup
client = new ClientBuilder().active().buildForUnitTests();
LoanOfferingBO loanProduct1 = new LoanProductBuilder().withGlobalProductNumber("xxxx-111").withoutLoanAmountSameForAllLoans().buildForUnitTests();
client.addAccount(loanAccount);
// stubbing
when(loanAccount.isActiveLoanAccount()).thenReturn(false);
// exercise
boolean isDisbursalPrevented = client.isDisbursalPreventedDueToAnyExistingActiveLoansForTheSameProduct(loanProduct1);
assertThat(isDisbursalPrevented, is(false));
}
use of org.mifos.accounts.productdefinition.business.LoanOfferingBO in project head by mifos.
the class ClientBoTest method testIsDisbursalPreventedDueToAnyExistingActiveLoansForTheSameProductReturnsFalseIfCustomerHasNoSuchAccountsForThatProduct.
@Test
public void testIsDisbursalPreventedDueToAnyExistingActiveLoansForTheSameProductReturnsFalseIfCustomerHasNoSuchAccountsForThatProduct() throws Exception {
// setup
client = new ClientBuilder().active().buildForUnitTests();
LoanOfferingBO loanProduct1 = new LoanProductBuilder().withGlobalProductNumber("xxxx-111").withoutLoanAmountSameForAllLoans().buildForUnitTests();
LoanOfferingBO loanProduct2 = new LoanProductBuilder().withGlobalProductNumber("xxxx-222").buildForUnitTests();
client.addAccount(loanAccount);
// stubbing
when(loanAccount.isActiveLoanAccount()).thenReturn(true);
when(loanAccount.getLoanOffering()).thenReturn(loanProduct2);
// exercise
boolean isDisbursalPrevented = client.isDisbursalPreventedDueToAnyExistingActiveLoansForTheSameProduct(loanProduct1);
assertThat(isDisbursalPrevented, is(false));
}
use of org.mifos.accounts.productdefinition.business.LoanOfferingBO in project head by mifos.
the class LoanProductBuilder method buildForIntegrationTests.
public LoanOfferingBO buildForIntegrationTests() {
category = (ProductCategoryBO) StaticHibernateUtil.getSessionTL().get(ProductCategoryBO.class, Short.valueOf("2"));
productStatusEntity = (PrdStatusEntity) StaticHibernateUtil.getSessionTL().get(PrdStatusEntity.class, this.productStatus.getValue());
LoanOfferingBO loanProduct = build();
return loanProduct;
}
use of org.mifos.accounts.productdefinition.business.LoanOfferingBO in project head by mifos.
the class LoanArrearsAgingHelperIntegrationTest method setUpLoan.
private LoanBO setUpLoan(DateTime dateTime, AccountState accountState) {
Date startDate = dateTime.toDate();
meeting = getNewMeeting(WEEKLY, EVERY_WEEK, CUSTOMER_MEETING, WeekDay.MONDAY, startDate);
center = TestObjectFactory.createWeeklyFeeCenter(this.getClass().getSimpleName() + " Center", meeting);
group = TestObjectFactory.createWeeklyFeeGroupUnderCenter(this.getClass().getSimpleName() + " Group", CustomerStatus.GROUP_ACTIVE, center);
LoanOfferingBO product = TestObjectFactory.createLoanOffering("LoanProduct", "LP", startDate, meeting);
LoanBO loan = createBasicLoanAccount(group, accountState, product, "" + loanAmount, numInstallments, interestRate);
return loan;
}
use of org.mifos.accounts.productdefinition.business.LoanOfferingBO in project head by mifos.
the class AuditInterceptorIntegrationTest method getLoanAccount.
private AccountBO getLoanAccount() {
Date startDate = new Date(System.currentTimeMillis());
createInitialCustomers();
LoanOfferingBO loanOffering = TestObjectFactory.createLoanOffering(startDate, center.getCustomerMeeting().getMeeting());
return TestObjectFactory.createLoanAccount("42423142341", group, AccountState.LOAN_ACTIVE_IN_GOOD_STANDING, startDate, loanOffering);
}
Aggregations