001 /** 002 * Copyright 2004-2013 The Kuali Foundation 003 * 004 * Licensed under the Educational Community License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.opensource.org/licenses/ecl2.php 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016 package org.kuali.kpme.tklm.leave.override; 017 018 import org.apache.commons.lang.StringUtils; 019 import org.joda.time.LocalDate; 020 import org.junit.Assert; 021 import org.junit.Test; 022 import org.kuali.kpme.core.IntegrationTest; 023 import org.kuali.kpme.core.inquirable.KPMEInquirableImpl; 024 import org.kuali.kpme.tklm.TKLMIntegrationTestCase; 025 import org.kuali.rice.kns.lookup.HtmlData; 026 import org.kuali.rice.kns.lookup.HtmlData.AnchorHtmlData; 027 028 @IntegrationTest 029 public class EmployeeOverrideInquirableTest extends TKLMIntegrationTestCase { 030 031 private String INQUIRY_URL = "inquiry.do?businessObjectClassName=org.kuali.kpme.core.accrualcategory.AccrualCategory&methodToCall=start&effectiveDate=03%2F04%2F2012&accrualCategory=testAC&lmAccrualCategoryId="; 032 @Test 033 public void testGetInquiryUrl() throws Exception { 034 EmployeeOverride eo = new EmployeeOverride(); 035 eo.setAccrualCategory("testAC"); 036 eo.setLeavePlan("testLeavePlan"); 037 eo.setEffectiveLocalDate(new LocalDate(2012, 3, 4)); 038 039 HtmlData hd = (HtmlData) new KPMEInquirableImpl().getInquiryUrl(eo, "accrualCategory", false); 040 Assert.assertNotNull("No HtmlData found", hd); 041 String inquiryUrl = ((AnchorHtmlData) hd).getHref(); 042 Assert.assertTrue("Inquiry url is wrong", StringUtils.contains(inquiryUrl, INQUIRY_URL)); 043 044 } 045 }