1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.kpme.tklm.leave.override;
17
18 import org.apache.commons.lang.StringUtils;
19 import org.joda.time.LocalDate;
20 import org.junit.Assert;
21 import org.junit.Test;
22 import org.kuali.kpme.core.IntegrationTest;
23 import org.kuali.kpme.core.inquirable.KPMEInquirableImpl;
24 import org.kuali.kpme.tklm.TKLMIntegrationTestCase;
25 import org.kuali.rice.kns.lookup.HtmlData;
26 import org.kuali.rice.kns.lookup.HtmlData.AnchorHtmlData;
27
28 @IntegrationTest
29 public class EmployeeOverrideInquirableTest extends TKLMIntegrationTestCase {
30
31 private String INQUIRY_URL = "inquiry.do?businessObjectClassName=org.kuali.kpme.core.accrualcategory.AccrualCategory&methodToCall=start&effectiveDate=03%2F04%2F2012&accrualCategory=testAC&lmAccrualCategoryId=";
32 @Test
33 public void testGetInquiryUrl() throws Exception {
34 EmployeeOverride eo = new EmployeeOverride();
35 eo.setAccrualCategory("testAC");
36 eo.setLeavePlan("testLeavePlan");
37 eo.setEffectiveLocalDate(new LocalDate(2012, 3, 4));
38
39 HtmlData hd = (HtmlData) new KPMEInquirableImpl().getInquiryUrl(eo, "accrualCategory", false);
40 Assert.assertNotNull("No HtmlData found", hd);
41 String inquiryUrl = ((AnchorHtmlData) hd).getHref();
42 Assert.assertTrue("Inquiry url is wrong", StringUtils.contains(inquiryUrl, INQUIRY_URL));
43
44 }
45 }