Search in sources :

Example 6 with SavingsTestHelper

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;
}
Also used : SavingsOfferingBO(org.mifos.accounts.productdefinition.business.SavingsOfferingBO) SavingsTestHelper(org.mifos.accounts.savings.util.helpers.SavingsTestHelper) Test(org.junit.Test)

Example 7 with SavingsTestHelper

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;
}
Also used : SavingsOfferingBO(org.mifos.accounts.productdefinition.business.SavingsOfferingBO) SavingsTestHelper(org.mifos.accounts.savings.util.helpers.SavingsTestHelper) Test(org.junit.Test)

Example 8 with SavingsTestHelper

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());
}
Also used : MeetingBO(org.mifos.application.meeting.business.MeetingBO) SavingsBO(org.mifos.accounts.savings.business.SavingsBO) SavingsTestHelper(org.mifos.accounts.savings.util.helpers.SavingsTestHelper) Date(java.util.Date) Test(org.junit.Test)

Example 9 with SavingsTestHelper

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);
}
Also used : MeetingBO(org.mifos.application.meeting.business.MeetingBO) SavingsTestHelper(org.mifos.accounts.savings.util.helpers.SavingsTestHelper)

Example 10 with SavingsTestHelper

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;
}
Also used : SavingsOfferingBO(org.mifos.accounts.productdefinition.business.SavingsOfferingBO) SavingsTestHelper(org.mifos.accounts.savings.util.helpers.SavingsTestHelper) Test(org.junit.Test)

Aggregations

SavingsTestHelper (org.mifos.accounts.savings.util.helpers.SavingsTestHelper)18 Test (org.junit.Test)14 SavingsOfferingBO (org.mifos.accounts.productdefinition.business.SavingsOfferingBO)8 MeetingBO (org.mifos.application.meeting.business.MeetingBO)6 Date (java.util.Date)4 SavingsBO (org.mifos.accounts.savings.business.SavingsBO)4 Calendar (java.util.Calendar)3 GregorianCalendar (java.util.GregorianCalendar)3 AccountActionDateEntity (org.mifos.accounts.business.AccountActionDateEntity)3 PersonnelBO (org.mifos.customers.personnel.business.PersonnelBO)2 ArrayList (java.util.ArrayList)1 DateTime (org.joda.time.DateTime)1 Days (org.joda.time.Days)1 AccountPaymentEntity (org.mifos.accounts.business.AccountPaymentEntity)1 SavingsTrxnDetailEntity (org.mifos.accounts.savings.business.SavingsTrxnDetailEntity)1 Holiday (org.mifos.application.holiday.business.Holiday)1 FiscalCalendarRules (org.mifos.config.FiscalCalendarRules)1 SavingsTransactionHistoryDto (org.mifos.dto.screen.SavingsTransactionHistoryDto)1 PersistenceException (org.mifos.framework.exceptions.PersistenceException)1 DateTimeService (org.mifos.framework.util.DateTimeService)1