use of org.mifos.dto.domain.CustomFieldDto in project head by mifos.
the class ClientCustActionStrutsTest method testSuccessfulEditPreview.
@Test
public void testSuccessfulEditPreview() throws Exception {
createAndSetClientInSession();
setRequestPathInfo("/clientCustAction.do");
addRequestParameter("method", "editPersonalInfo");
addRequestParameter("officeId", "3");
addRequestParameter(Constants.CURRENTFLOWKEY, flowKey);
actionPerform();
List<CustomFieldDto> customFieldDefs = getCustomFieldFromSession();
setRequestPathInfo("/clientCustAction.do");
addRequestParameter("method", "previewEditPersonalInfo");
addRequestParameter("clientName.firstName", "Client2");
int i = 0;
for (CustomFieldDto customFieldDef : customFieldDefs) {
addRequestParameter("customField[" + i + "].fieldId", customFieldDef.getFieldId().toString());
addRequestParameter("customField[" + i + "].fieldValue", "11");
i++;
}
addRequestParameter(Constants.CURRENTFLOWKEY, flowKey);
actionPerform();
verifyForward(ActionForwards.previewEditPersonalInfo_success.toString());
verifyNoActionErrors();
verifyNoActionMessages();
}
use of org.mifos.dto.domain.CustomFieldDto in project head by mifos.
the class ClientCustActionStrutsTest method testCreateSuccessUnderGroupInBranch.
@Test
public void testCreateSuccessUnderGroupInBranch() throws Exception {
try {
createParentGroup();
setRequestPathInfo("/clientCustAction.do");
addRequestParameter("method", "load");
addRequestParameter("parentGroupId", group.getCustomerId().toString());
addRequestParameter("groupFlag", "1");
addRequestParameter(Constants.CURRENTFLOWKEY, flowKey);
actionPerform();
flowKey = request.getAttribute(Constants.CURRENTFLOWKEY).toString();
verifyNoActionErrors();
verifyNoActionMessages();
verifyForward(ActionForwards.load_success.toString());
List<BusinessActivityEntity> povertyStatus = (List<BusinessActivityEntity>) SessionUtils.getAttribute(ClientConstants.POVERTY_STATUS, request);
List<CustomFieldDto> customFieldDefs = getCustomFieldFromSession();
setRequestPathInfo("/clientCustAction.do");
addRequestParameter("method", "next");
addRequestParameter("officeId", "3");
addRequestParameter("clientName.salutation", "1");
addRequestParameter("clientName.firstName", "Client");
addRequestParameter("clientName.lastName", "LastName");
addRequestParameter("spouseName.firstName", "Spouse");
addRequestParameter("spouseName.lastName", "LastName");
addRequestParameter("spouseName.nameType", "1");
addRequestDateParameter("dateOfBirth", "20/3/1987");
addRequestParameter("clientDetailView.gender", "1");
addRequestParameter("input", "personalInfo");
addRequestParameter("customerDetail.povertyStatus", povertyStatus.get(0).getId().toString());
int i = 0;
for (CustomFieldDto customFieldDef : customFieldDefs) {
addRequestParameter("customField[" + i + "].fieldId", customFieldDef.getFieldId().toString());
addRequestParameter("customField[" + i + "].fieldValue", "20/3/1987");
i++;
}
addRequestParameter(Constants.CURRENTFLOWKEY, flowKey);
actionPerform();
verifyNoActionErrors();
verifyNoActionMessages();
verifyForward(ActionForwards.next_success.toString());
setRequestPathInfo("/clientCustAction.do");
addRequestParameter("method", "preview");
addRequestParameter("input", "mfiInfo");
addRequestParameter("formedByPersonnel", "1");
addRequestParameter(Constants.CURRENTFLOWKEY, flowKey);
actionPerform();
verifyNoActionErrors();
verifyNoActionMessages();
verifyForward(ActionForwards.preview_success.toString());
setRequestPathInfo("/clientCustAction.do");
addRequestParameter("method", "create");
addRequestParameter("input", "create");
addRequestParameter("status", "1");
addRequestParameter(Constants.CURRENTFLOWKEY, flowKey);
actionPerform();
verifyNoActionErrors();
verifyNoActionMessages();
verifyForward(ActionForwards.create_success.toString());
ClientCustActionForm actionForm = (ClientCustActionForm) request.getSession().getAttribute("clientCustActionForm");
client = TestObjectFactory.getClient(actionForm.getCustomerIdAsInt());
} catch (Exception e) {
e.printStackTrace();
}
}
use of org.mifos.dto.domain.CustomFieldDto in project head by mifos.
the class CenterUpdateBuilder method build.
public CenterUpdate build() {
int versionNum = 1;
int customerId = -1;
Short loanOfficerId = -1;
String externalId = null;
String updatedDisplayName = "Center " + RandomStringUtils.random(5);
String mfiJoiningDate = new SimpleDateFormat("dd/MM/yyyy").format(new Date());
AddressDto address = null;
List<CustomFieldDto> customFields = new ArrayList<CustomFieldDto>();
List<CustomerPositionDto> customerPositions = new ArrayList<CustomerPositionDto>();
return new CenterUpdate(customerId, updatedDisplayName, versionNum, loanOfficerId, externalId, mfiJoiningDate, address, customFields, customerPositions);
}
use of org.mifos.dto.domain.CustomFieldDto in project head by mifos.
the class TestObjectFactory method getCustomFields.
public static List<CustomFieldDto> getCustomFields() {
List<CustomFieldDto> customFields = new ArrayList<CustomFieldDto>();
CustomFieldDto fee = new CustomFieldDto(Short.valueOf("4"), "Custom", CustomFieldType.NUMERIC.getValue());
customFields.add(fee);
return customFields;
}
use of org.mifos.dto.domain.CustomFieldDto in project head by mifos.
the class TestObjectFactory method getCustomFieldView.
private static List<CustomFieldDto> getCustomFieldView() {
List<CustomFieldDto> customFields = new ArrayList<CustomFieldDto>();
customFields.add(new CustomFieldDto(new Short("8"), "custom field value", null));
return customFields;
}
Aggregations