use of org.mifos.customers.center.persistence.CenterPersistence in project head by mifos.
the class CenterBOIntegrationTest method testSuccessfulCreateWithoutFee.
@Test
public void testSuccessfulCreateWithoutFee() throws Exception {
String name = "Center";
meeting = getMeeting();
center = new CenterBO(TestUtils.makeUser(), name, null, getCustomFields(), null, null, null, officeBo, meeting, personnelBo, new CustomerPersistence());
new CenterPersistence().saveCenter(center);
StaticHibernateUtil.flushSession();
center = TestObjectFactory.getCenter(center.getCustomerId());
Assert.assertEquals(name, center.getDisplayName());
Assert.assertEquals(officeId, center.getOffice().getOfficeId());
Assert.assertEquals(2, center.getCustomFields().size());
}
use of org.mifos.customers.center.persistence.CenterPersistence in project head by mifos.
the class TestObjectFactory method createCenter.
public static CenterBO createCenter(final String customerName, final MeetingBO meeting, final Short officeId, final Short personnelId, final List<FeeDto> fees) {
CenterBO center;
try {
center = new CenterBO(TestUtils.makeUserWithLocales(), customerName, null, null, fees, null, null, new OfficePersistence().getOffice(officeId), meeting, ApplicationContextProvider.getBean(LegacyPersonnelDao.class).getPersonnel(personnelId), new CustomerPersistence());
new CenterPersistence().saveCenter(center);
StaticHibernateUtil.flushSession();
} catch (Exception e) {
throw new RuntimeException(e);
}
return center;
}
use of org.mifos.customers.center.persistence.CenterPersistence in project head by mifos.
the class GroupPersistenceIntegrationTest method setUp.
@Before
public void setUp() throws Exception {
this.officePersistence = new OfficePersistence();
this.centerPersistence = new CenterPersistence();
this.groupPersistence = new GroupPersistence();
initializeStatisticsService();
}
use of org.mifos.customers.center.persistence.CenterPersistence in project head by mifos.
the class GroupActionStrutsTest method createCenterWithoutFee.
private void createCenterWithoutFee() throws Exception {
meeting = new MeetingBO(WeekDay.MONDAY, EVERY_WEEK, new Date(), MeetingType.CUSTOMER_MEETING, "Delhi");
center = new CenterBO(userContext, "MyCenter", null, null, null, "1234", null, TestObjectFactory.getBranchOffice(), meeting, TestObjectFactory.getTestUser(), new CustomerPersistence());
new CenterPersistence().saveCenter(center);
StaticHibernateUtil.flushAndClearSession();
}
use of org.mifos.customers.center.persistence.CenterPersistence in project head by mifos.
the class CenterBOIntegrationTest method testSuccessfulCreateWithoutFeeAndCustomField.
@Test
public void testSuccessfulCreateWithoutFeeAndCustomField() throws Exception {
String name = "Center";
meeting = getMeeting();
center = new CenterBO(TestUtils.makeUser(), name, null, null, null, null, null, officeBo, meeting, personnelBo, new CustomerPersistence());
new CenterPersistence().saveCenter(center);
StaticHibernateUtil.flushSession();
center = TestObjectFactory.getCenter(center.getCustomerId());
Assert.assertEquals(name, center.getDisplayName());
Assert.assertEquals(officeId, center.getOffice().getOfficeId());
}
Aggregations