use of org.mifos.accounts.productdefinition.business.SavingsOfferingBO in project head by mifos.
the class ReportProductOfferingServiceIntegrationTest method testGetSavingsOffering2ReturnsSavingsOffering.
@Test
public void testGetSavingsOffering2ReturnsSavingsOffering() throws Exception {
SavingsOfferingBO savingsOffering2 = SavingsOfferingBO.createInstanceForTest(SAVINGS_OFFERING_2_ID);
expect(savingsProductBusinessServiceMock.getSavingsProduct(SAVINGS_OFFERING_2_ID)).andReturn(savingsOffering2);
replay(savingsProductBusinessServiceMock);
SavingsOfferingBO retrievedSavingsOffering = reportProductOfferingService.getSavingsOffering2();
verify(savingsProductBusinessServiceMock);
Assert.assertEquals(savingsOffering2, retrievedSavingsOffering);
}
use of org.mifos.accounts.productdefinition.business.SavingsOfferingBO in project head by mifos.
the class ReportProductOfferingServiceIntegrationTest method testGetSavingsOffering1ReturnsSavingsOffering.
@Test
public void testGetSavingsOffering1ReturnsSavingsOffering() throws Exception {
SavingsOfferingBO savingsOffering1 = SavingsOfferingBO.createInstanceForTest(SAVINGS_OFFERING_1_ID);
expect(savingsProductBusinessServiceMock.getSavingsProduct(SAVINGS_OFFERING_1_ID)).andReturn(savingsOffering1);
replay(savingsProductBusinessServiceMock);
SavingsOfferingBO retrievedSavingsOffering = reportProductOfferingService.getSavingsOffering1();
verify(savingsProductBusinessServiceMock);
Assert.assertEquals(savingsOffering1, retrievedSavingsOffering);
}
use of org.mifos.accounts.productdefinition.business.SavingsOfferingBO in project head by mifos.
the class ClientCreationTest method throwsCheckedExceptionWhenValidationForDuplicateSavingsFails.
@Test(expected = CustomerException.class)
public void throwsCheckedExceptionWhenValidationForDuplicateSavingsFails() throws Exception {
// setup
List<AccountFeesEntity> accountFees = new ArrayList<AccountFeesEntity>();
List<SavingsOfferingBO> noSavings = new ArrayList<SavingsOfferingBO>();
// stubbing
doThrow(new CustomerException(ClientConstants.ERRORS_DUPLICATE_OFFERING_SELECTED)).when(mockedClient).validateNoDuplicateSavings(noSavings);
// exercise test
customerService.createClient(mockedClient, meeting, accountFees, noSavings);
// verify
verify(mockedClient).validateNoDuplicateSavings(noSavings);
}
use of org.mifos.accounts.productdefinition.business.SavingsOfferingBO in project head by mifos.
the class CustomerPersistenceIntegrationTest method getSavingsAccount.
private AccountBO getSavingsAccount(final CustomerBO customer, final String prdOfferingname, final String shortName) throws Exception {
Date startDate = new Date(System.currentTimeMillis());
SavingsOfferingBO savingsOffering = TestObjectFactory.createSavingsProduct(prdOfferingname, shortName, startDate, RecommendedAmountUnit.COMPLETE_GROUP);
return TestObjectFactory.createSavingsAccount("432434", customer, Short.valueOf("16"), startDate, savingsOffering);
}
use of org.mifos.accounts.productdefinition.business.SavingsOfferingBO in project head by mifos.
the class SavingsIntPostingHelperIntegrationTest method setUp.
@Before
public void setUp() throws Exception {
databaseCleaner.clean();
DateTime startOfFiscalYear = new DateTime().withDate(2010, 1, 1);
MeetingBO meetingFrequency = new MeetingBuilder().customerMeeting().startingFrom(startOfFiscalYear.toDate()).monthly().every(1).onDayOfMonth(1).build();
createCenterGroupClientHierarchy(meetingFrequency);
MeetingBO interestCalculationFrequency = new MeetingBuilder().savingsInterestCalulationSchedule().monthly().every(2).build();
IntegrationTestObjectMother.saveMeeting(interestCalculationFrequency);
MeetingBO interestPostingFrequency = new MeetingBuilder().savingsInterestPostingSchedule().monthly().every(2).build();
IntegrationTestObjectMother.saveMeeting(interestPostingFrequency);
SavingsOfferingBO mandatoryMinimumBalance = new SavingsProductBuilder().appliesToClientsOnly().withName("mandatoryMinimumBalance1").withShortName("mm01").mandatory().minimumBalance().withInterestCalculationSchedule(interestPostingFrequency).withInterestPostingSchedule(interestPostingFrequency).withMandatoryAmount("300").withInterestRate(Double.valueOf("12")).withMaxWithdrawalAmount(TestUtils.createMoney("200")).withMinAmountRequiredForInterestCalculation("200").buildForIntegrationTests();
IntegrationTestObjectMother.saveSavingsProducts(mandatoryMinimumBalance);
DateTime nextInterestPostingDate = new DateTime().minusDays(1);
savings1 = new SavingsAccountBuilder().active().withSavingsProduct(mandatoryMinimumBalance).withCustomer(client).withCreatedBy(IntegrationTestObjectMother.testUser()).withActivationDate(startOfFiscalYear).withNextInterestPostingDateOf(nextInterestPostingDate).withBalanceOf(TestUtils.createMoney("0")).withDepositOn("300", startOfFiscalYear).withDepositOn("200", startOfFiscalYear.plusMonths(1)).build();
IntegrationTestObjectMother.saveSavingsAccount(savings1);
}
Aggregations