use of org.mifos.framework.util.DateTimeService in project head by mifos.
the class SavingsTestHelper method createSavingsOffering.
public SavingsOfferingBO createSavingsOffering(String offeringName, String shortName, Short depGLCode, Short intGLCode) {
MeetingBO meetingIntCalc = TestObjectFactory.createMeeting(TestObjectFactory.getTypicalMeeting());
MeetingBO meetingIntPost = TestObjectFactory.createMeeting(TestObjectFactory.getTypicalMeeting());
return TestObjectFactory.createSavingsProduct(offeringName, shortName, ApplicableTo.GROUPS, new DateTimeService().getCurrentJavaDateTime(), PrdStatus.SAVINGS_ACTIVE, 300.0, RecommendedAmountUnit.PER_INDIVIDUAL, 24.0, 200.0, 200.0, SavingsType.VOLUNTARY, InterestCalcType.MINIMUM_BALANCE, meetingIntCalc, meetingIntPost, depGLCode, intGLCode);
}
use of org.mifos.framework.util.DateTimeService in project head by mifos.
the class CollectionSheetServiceImplIntegrationTest method tearDown.
@After
public void tearDown() throws Exception {
try {
saveCollectionSheetUtils.clearObjects();
} catch (Exception e) {
// TODO Whoops, cleanup didnt work, reset db
}
new DateTimeService().resetToCurrentSystemDateTime();
StaticHibernateUtil.flushSession();
}
use of org.mifos.framework.util.DateTimeService in project head by mifos.
the class SystemInfoTest method testGetDateTime.
@Test
public void testGetDateTime() {
DateTime referenceDateTime = new DateTime(2008, 12, 5, 1, 10, 0, 0);
DateTimeService dateTimeService = new DateTimeService();
try {
// set a fixed datetime which is what SystemInfo should get back
dateTimeService.setCurrentDateTimeFixed(referenceDateTime);
Assert.assertEquals("System info date time should be from the DateTimeService", referenceDateTime, info.getDateTime());
} finally {
dateTimeService.resetToCurrentSystemDateTime();
}
}
use of org.mifos.framework.util.DateTimeService in project head by mifos.
the class ActivityMapperTest method testAdjustmentPermittedForSameDayPayments.
@Test
public void testAdjustmentPermittedForSameDayPayments() {
new DateTimeService().setCurrentDateTime(TestUtils.getDateTime(10, 10, 2010));
Assert.assertTrue(activityMapper.isAdjustmentPermittedForBackDatedPayments(TestUtils.getDate(10, 10, 2010), userContext, new Short("1"), new Short("1")));
verify(legacyRolesPermissionsDao, never()).isActivityAllowed(Matchers.<UserContext>anyObject(), Matchers.<ActivityContext>anyObject());
}
use of org.mifos.framework.util.DateTimeService in project head by mifos.
the class ActivityMapperTest method testAdjustmentPermittedForBackDatedPayments.
@Test
public void testAdjustmentPermittedForBackDatedPayments() {
new DateTimeService().setCurrentDateTime(TestUtils.getDateTime(11, 10, 2010));
when(legacyRolesPermissionsDao.isActivityAllowed(eq(userContext), Matchers.argThat(new ActivityContextTypeSafeMatcher()))).thenReturn(true);
Assert.assertTrue(activityMapper.isAdjustmentPermittedForBackDatedPayments(TestUtils.getDate(10, 10, 2010), userContext, new Short("1"), new Short("1")));
verify(legacyRolesPermissionsDao).isActivityAllowed(eq(userContext), Matchers.argThat(new ActivityContextTypeSafeMatcher()));
}
Aggregations