1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.krad.inquiry;
17
18 import org.apache.commons.lang.StringUtils;
19 import org.junit.Test;
20 import org.kuali.rice.kns.inquiry.KualiInquirableImpl;
21 import org.kuali.rice.kns.lookup.HtmlData;
22 import org.kuali.rice.krad.test.document.bo.AccountManager;
23 import org.kuali.test.KRADTestCase;
24
25 import static org.junit.Assert.assertTrue;
26
27
28
29
30
31
32 public class KualiInquirableTest extends KRADTestCase {
33
34 private AccountManager am;
35
36 @Override
37 public void setUp() throws Exception {
38 super.setUp();
39 am = new AccountManager();
40 am.setAmId(new Long(1));
41
42 }
43
44
45
46
47 @Test public final void testBuildInquiryUrl() {
48 String inquiryUrl = ((HtmlData.AnchorHtmlData)new KualiInquirableImpl().getInquiryUrl(am, "amId", true)).getHref();
49 assertTrue("An inquiry URL to AccountManager should be built", StringUtils.contains(inquiryUrl, "amId=1"));
50 assertTrue("An inquiry URL to AccountManager should be built", StringUtils.contains(inquiryUrl, "businessObjectClassName=" + AccountManager.class.getName()));
51 }
52
53 }