use of org.mifos.framework.components.fieldConfiguration.util.helpers.FieldConfig in project head by mifos.
the class PersonnelSettingsActionStrutsTest method setUp.
@Before
public void setUp() throws Exception {
userContext = TestUtils.makeUser();
request.getSession().setAttribute(Constants.USERCONTEXT, userContext);
addRequestParameter("recordLoanOfficerId", "1");
addRequestParameter("recordOfficeId", "1");
ActivityContext ac = new ActivityContext((short) 0, userContext.getBranchId().shortValue(), userContext.getId().shortValue());
request.getSession(false).setAttribute("ActivityContext", ac);
flowKey = createFlow(request, PersonnelSettingsAction.class);
EntityMasterData.getInstance().init();
FieldConfig fieldConfig = FieldConfig.getInstance();
fieldConfig.init();
getActionServlet().getServletContext().setAttribute(Constants.FIELD_CONFIGURATION, fieldConfig.getEntityMandatoryFieldMap());
request.setAttribute(Constants.CURRENTFLOWKEY, flowKey);
addRequestParameter(Constants.CURRENTFLOWKEY, flowKey);
addRequestParameter("input", "CreateUser");
PersonnelBusinessService personnelBusinessService = new PersonnelBusinessService();
SessionUtils.setAttribute(PersonnelConstants.OFFICE, personnelBusinessService.getOffice(TestObjectFactory.HEAD_OFFICE), request);
SessionUtils.setCollectionAttribute(PersonnelConstants.ROLES_LIST, personnelBusinessService.getRoles(), request);
SessionUtils.setCollectionAttribute(PersonnelConstants.ROLEMASTERLIST, personnelBusinessService.getRoles(), request);
personnelBusinessService = null;
}
use of org.mifos.framework.components.fieldConfiguration.util.helpers.FieldConfig in project head by mifos.
the class GroupActionStrutsTest method setUp.
@Before
public void setUp() throws Exception {
userContext = TestObjectFactory.getContext();
request.getSession().setAttribute(Constants.USERCONTEXT, userContext);
addRequestParameter("recordLoanOfficerId", "1");
addRequestParameter("recordOfficeId", "1");
request.getSession(false).setAttribute("ActivityContext", TestObjectFactory.getActivityContext());
flowKey = createFlow(request, GroupCustAction.class);
EntityMasterData.getInstance().init();
FieldConfig fieldConfig = FieldConfig.getInstance();
fieldConfig.init();
getActionServlet().getServletContext().setAttribute(Constants.FIELD_CONFIGURATION, fieldConfig.getEntityMandatoryFieldMap());
SecurityContext securityContext = new SecurityContextImpl();
MifosUser principal = new MifosUserBuilder().nonLoanOfficer().withAdminRole().build();
Authentication authentication = new TestingAuthenticationToken(principal, principal);
securityContext.setAuthentication(authentication);
SecurityContextHolder.setContext(securityContext);
}
use of org.mifos.framework.components.fieldConfiguration.util.helpers.FieldConfig in project head by mifos.
the class CenterActionStrutsTest method setUp.
@Before
public void setUp() throws Exception {
UserContext userContext = TestObjectFactory.getContext();
request.getSession().setAttribute(Constants.USERCONTEXT, userContext);
addRequestParameter("recordLoanOfficerId", "1");
addRequestParameter("recordOfficeId", "1");
request.getSession(false).setAttribute("ActivityContext", TestObjectFactory.getActivityContext());
flowKey = createFlow(request, CenterCustAction.class);
addRequestParameter(Constants.CURRENTFLOWKEY, flowKey);
request.setAttribute(Constants.CURRENTFLOWKEY, flowKey);
EntityMasterData.getInstance().init();
FieldConfig fieldConfig = FieldConfig.getInstance();
fieldConfig.init();
getActionServlet().getServletContext().setAttribute(Constants.FIELD_CONFIGURATION, fieldConfig.getEntityMandatoryFieldMap());
}
Aggregations