use of org.mifos.accounts.savings.util.helpers.SavingsTestHelper in project head by mifos.
the class PrdOfferingPersistenceIntegrationTest method testGetAllowedPrdOfferingsByType.
@Test
public void testGetAllowedPrdOfferingsByType() throws PersistenceException {
SavingsOfferingBO savingsOffering = new SavingsTestHelper().createSavingsOffering("Eddikhar", "Edkh");
Assert.assertNotNull(new PrdOfferingPersistence().getAllowedPrdOfferingsByType(savingsOffering.getPrdOfferingId().toString(), ProductType.SAVINGS.getValue().toString()));
savingsOffering = null;
}
use of org.mifos.accounts.savings.util.helpers.SavingsTestHelper in project head by mifos.
the class PrdOfferingPersistenceIntegrationTest method testGetAllowedPrdOfferingsForMixProduct.
@Test
public void testGetAllowedPrdOfferingsForMixProduct() throws PersistenceException {
SavingsOfferingBO savingsOffering = new SavingsTestHelper().createSavingsOffering("Eddikhar", "Edkh");
Assert.assertNotNull(new PrdOfferingPersistence().getAllowedPrdOfferingsForMixProduct(savingsOffering.getPrdOfferingId().toString(), ProductType.SAVINGS.getValue().toString()));
savingsOffering = null;
}
use of org.mifos.accounts.savings.util.helpers.SavingsTestHelper in project head by mifos.
the class GenerateMeetingsForCustomerAndSavingsHelperIntegrationTest method testExecuteForSavingsAccountForGroup.
@Test
public void testExecuteForSavingsAccountForGroup() throws Exception {
MeetingBO meeting = TestObjectFactory.createMeeting(TestObjectFactory.getTypicalMeeting());
center = TestObjectFactory.createWeeklyFeeCenter("Center_Active_test", meeting);
group = TestObjectFactory.createWeeklyFeeGroupUnderCenter("Group_Active_test", CustomerStatus.GROUP_ACTIVE, center);
SavingsTestHelper helper = new SavingsTestHelper();
savingsOffering = createSavingsOffering("dfasdasd1", "sad1", InterestCalcType.MINIMUM_BALANCE, SavingsType.VOLUNTARY, TestGeneralLedgerCode.ASSETS, TestGeneralLedgerCode.CASH_AND_BANK_BALANCES, RecommendedAmountUnit.COMPLETE_GROUP);
savings = helper.createSavingsAccount(savingsOffering, group, AccountState.SAVINGS_ACTIVE, userContext);
Date meetingStartDate = savings.getCustomer().getCustomerMeeting().getMeeting().getStartDate();
int noOfInstallments = savings.getAccountActionDates().size();
AccountTestUtils.changeInstallmentDatesToPreviousDateExceptLastInstallment(savings, 7);
StaticHibernateUtil.flushSession();
savings = TestObjectFactory.getObject(SavingsBO.class, savings.getAccountId());
new GenerateMeetingsForCustomerAndSavingsTask().getTaskHelper().execute(System.currentTimeMillis());
StaticHibernateUtil.flushAndClearSession();
savings = TestObjectFactory.getObject(SavingsBO.class, savings.getAccountId());
group = TestObjectFactory.getCustomer(group.getCustomerId());
center = TestObjectFactory.getCustomer(center.getCustomerId());
Assert.assertEquals(noOfInstallments + 10, savings.getAccountActionDates().size());
Assert.assertEquals(new java.sql.Date(DateUtils.getDateWithoutTimeStamp(meetingStartDate.getTime()).getTime()).toString(), group.getCustomerMeeting().getMeeting().getStartDate().toString());
}
use of org.mifos.accounts.savings.util.helpers.SavingsTestHelper in project head by mifos.
the class TagGeneratorIntegrationTest method createInitialObjectsForSavings.
private void createInitialObjectsForSavings() throws Exception {
MeetingBO meeting = TestObjectFactory.createMeeting(TestObjectFactory.getTypicalMeeting());
center = TestObjectFactory.createWeeklyFeeCenter("Center_Active_test", meeting);
group = TestObjectFactory.createWeeklyFeeGroupUnderCenter("Group_Active_test", CustomerStatus.GROUP_ACTIVE, center);
SavingsTestHelper helper = new SavingsTestHelper();
savingsOffering = helper.createSavingsOffering("prd1", "cdfg");
savings = helper.createSavingsAccount("000100000000017", savingsOffering, group, AccountStates.SAVINGS_ACC_APPROVED, userContext);
}
use of org.mifos.accounts.savings.util.helpers.SavingsTestHelper in project head by mifos.
the class PrdOfferingPersistenceIntegrationTest method testGetPrdOfferingShortNameCountWithSameName.
@Test
public void testGetPrdOfferingShortNameCountWithSameName() throws PersistenceException {
SavingsOfferingBO savingsOffering = new SavingsTestHelper().createSavingsOffering("Savings product", "SAVP");
Assert.assertEquals(Integer.valueOf("1"), new PrdOfferingPersistence().getProductOfferingShortNameCount("SAVP"));
savingsOffering = null;
}
Aggregations