use of org.mifos.accounts.savings.util.helpers.SavingsTestHelper in project head by mifos.
the class PrdOfferingPersistenceIntegrationTest method testGetPrdOfferingNameCountWithDifferentName.
@Test
public void testGetPrdOfferingNameCountWithDifferentName() throws PersistenceException {
SavingsOfferingBO savingsOffering = new SavingsTestHelper().createSavingsOffering("fsaf6", "ads6");
Assert.assertEquals(Integer.valueOf("0"), new PrdOfferingPersistence().getProductOfferingNameCount("Savings product"));
savingsOffering = null;
}
use of org.mifos.accounts.savings.util.helpers.SavingsTestHelper in project head by mifos.
the class PrdOfferingPersistenceIntegrationTest method testGetPrdOfferingShortNameCountWithDifferentName.
@Test
public void testGetPrdOfferingShortNameCountWithDifferentName() throws PersistenceException {
SavingsOfferingBO savingsOffering = new SavingsTestHelper().createSavingsOffering("fsaf6", "ads6");
Assert.assertEquals(Integer.valueOf("0"), new PrdOfferingPersistence().getProductOfferingShortNameCount("SAVP"));
savingsOffering = null;
}
use of org.mifos.accounts.savings.util.helpers.SavingsTestHelper in project head by mifos.
the class GenerateMeetingsForCustomerAndSavingsHelperIntegrationTest method getSavingsAccountForCenter.
private SavingsBO getSavingsAccountForCenter() throws Exception {
createInitialObjects();
client1 = TestObjectFactory.createClient("client1", CustomerStatus.CLIENT_ACTIVE, group);
client2 = TestObjectFactory.createClient("client2", CustomerStatus.CLIENT_ACTIVE, group);
SavingsTestHelper helper = new SavingsTestHelper();
savingsOffering = helper.createSavingsOffering("dfasdasd1", "sad1");
return helper.createSavingsAccount(savingsOffering, center, AccountState.SAVINGS_ACTIVE, userContext);
}
use of org.mifos.accounts.savings.util.helpers.SavingsTestHelper in project head by mifos.
the class SavingsPersistenceIntegrationTest method testGetMissedDepositsPaidAfterDueDate.
@Test
public void testGetMissedDepositsPaidAfterDueDate() throws Exception {
SavingsTestHelper helper = new SavingsTestHelper();
MeetingBO meeting = TestObjectFactory.createMeeting(TestObjectFactory.getTypicalMeeting());
center = TestObjectFactory.createWeeklyFeeCenter("Center", meeting);
group = TestObjectFactory.createWeeklyFeeGroupUnderCenter("Group", CustomerStatus.GROUP_ACTIVE, center);
savingsOffering = helper.createSavingsOffering("SavingPrd1", "cvfg", Short.valueOf("1"), Short.valueOf("1"));
;
savings = TestObjectFactory.createSavingsAccount("43245434", group, Short.valueOf("16"), new Date(System.currentTimeMillis()), savingsOffering);
AccountActionDateEntity accountActionDateEntity = savings.getAccountActionDate((short) 1);
SavingBOTestUtils.setActionDate(accountActionDateEntity, offSetCurrentDate(7));
accountActionDateEntity.setPaymentStatus(PaymentStatus.PAID);
Calendar currentDateCalendar = new GregorianCalendar();
java.sql.Date currentDate = new java.sql.Date(currentDateCalendar.getTimeInMillis());
SavingBOTestUtils.setPaymentDate(accountActionDateEntity, currentDate);
savings.update();
StaticHibernateUtil.flushSession();
savings = savingsDao.findById(savings.getAccountId());
savings.setUserContext(userContext);
StaticHibernateUtil.flushSession();
Assert.assertEquals(savingsPersistence.getMissedDepositsPaidAfterDueDate(savings.getAccountId()), 1);
}
use of org.mifos.accounts.savings.util.helpers.SavingsTestHelper in project head by mifos.
the class SavingsPersistenceIntegrationTest method testGetMissedDeposits.
@Test
public void testGetMissedDeposits() throws Exception {
SavingsTestHelper helper = new SavingsTestHelper();
MeetingBO meeting = TestObjectFactory.createMeeting(TestObjectFactory.getTypicalMeeting());
center = TestObjectFactory.createWeeklyFeeCenter("Center", meeting);
group = TestObjectFactory.createWeeklyFeeGroupUnderCenter("Group", CustomerStatus.GROUP_ACTIVE, center);
savingsOffering = helper.createSavingsOffering("SavingPrd1", "wsed", Short.valueOf("1"), Short.valueOf("1"));
savings = TestObjectFactory.createSavingsAccount("43245434", group, Short.valueOf("16"), new Date(System.currentTimeMillis()), savingsOffering);
AccountActionDateEntity accountActionDateEntity = savings.getAccountActionDate((short) 1);
SavingBOTestUtils.setActionDate(accountActionDateEntity, offSetCurrentDate(7));
savings.update();
StaticHibernateUtil.flushSession();
savings = savingsDao.findById(savings.getAccountId());
savings.setUserContext(userContext);
StaticHibernateUtil.flushSession();
Calendar currentDateCalendar = new GregorianCalendar();
java.sql.Date currentDate = new java.sql.Date(currentDateCalendar.getTimeInMillis());
Assert.assertEquals(savingsPersistence.getMissedDeposits(savings.getAccountId(), currentDate), 1);
}
Aggregations