Search in sources :

Example 1 with LookupForm

use of org.kuali.kfs.kns.web.struts.form.LookupForm in project cu-kfs by CU-CommunityApps.

the class CuOrganizationRoutingModelNameLookupableHelperServiceImplTest method testGetReturnUrl.

public void testGetReturnUrl() {
    BusinessObjectRestrictionsBase businessObjectRestrictions = new BusinessObjectRestrictionsBase();
    Map<String, String> fieldConversions = new HashMap<String, String>();
    fieldConversions.put("organizationCode", "modelOrganizationCode");
    fieldConversions.put("chartOfAccountsCode", "modelChartOfAccountsCode");
    fieldConversions.put("accountDelegateModelName", "modelName");
    lookupableHelperServiceImpl.setFieldConversions(fieldConversions);
    lookupableHelperServiceImpl.setBusinessObjectClass(AccountDelegateModel.class);
    LookupForm lookupForm = new LookupForm();
    lookupForm.setFieldConversions(fieldConversions);
    lookupForm.setLookupableImplServiceName("organizationRoutingModelLookupable");
    AccountDelegateModel accountDelegateModel = new AccountDelegateModel();
    accountDelegateModel.setAccountDelegateModelName("Stuff");
    accountDelegateModel.setChartOfAccountsCode("IT");
    accountDelegateModel.setOrganizationCode("1000");
    List<String> returnKeys = new ArrayList<String>();
    returnKeys.add("chartOfAccountsCode");
    returnKeys.add("organizationCode");
    returnKeys.add("accountDelegateModelName");
    String befoerBackLocation = lookupForm.getBackLocation();
    HtmlData results = lookupableHelperServiceImpl.getReturnUrl(accountDelegateModel, lookupForm, returnKeys, businessObjectRestrictions);
    assertEquals("return value", results.getDisplayText());
    assertEquals(befoerBackLocation, lookupForm.getBackLocation());
}
Also used : HashMap(java.util.HashMap) LookupForm(org.kuali.kfs.kns.web.struts.form.LookupForm) AccountDelegateModel(org.kuali.kfs.coa.businessobject.AccountDelegateModel) ArrayList(java.util.ArrayList) BusinessObjectRestrictionsBase(org.kuali.kfs.kns.document.authorization.BusinessObjectRestrictionsBase) HtmlData(org.kuali.kfs.kns.lookup.HtmlData)

Aggregations

ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 AccountDelegateModel (org.kuali.kfs.coa.businessobject.AccountDelegateModel)1 BusinessObjectRestrictionsBase (org.kuali.kfs.kns.document.authorization.BusinessObjectRestrictionsBase)1 HtmlData (org.kuali.kfs.kns.lookup.HtmlData)1 LookupForm (org.kuali.kfs.kns.web.struts.form.LookupForm)1