View Javadoc

1   /**
2    * Copyright 2005-2013 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl2.php
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.rice.kns.inquiry;
17  
18  import org.apache.commons.lang.StringUtils;
19  import org.junit.Test;
20  import org.kuali.rice.kns.KNSTestCase;
21  import org.kuali.rice.kns.inquiry.KualiInquirableImpl;
22  import org.kuali.rice.kns.lookup.HtmlData;
23  import org.kuali.rice.krad.test.document.bo.AccountManager;
24  import org.kuali.rice.krad.test.KRADTestCase;
25  
26  import org.junit.Assert;
27  
28  /**
29   * KualiInquirableTest tests {@link KualiInquirableImpl} methods
30   * 
31   * @author Kuali Rice Team (rice.collab@kuali.org)
32   */
33  public class KualiInquirableTest extends KNSTestCase {
34  
35      private AccountManager am;
36  
37      @Override
38      public void setUp() throws Exception {
39          super.setUp();
40          am = new AccountManager();
41          am.setAmId(new Long(1));
42          
43      }
44  
45      /**
46       * Tests the inquiry url output for a given bo and property name
47       */
48      @Test public final void testBuildInquiryUrl() {
49      	String inquiryUrl = ((HtmlData.AnchorHtmlData)new KualiInquirableImpl().getInquiryUrl(am, "amId", true)).getHref();
50          Assert.assertTrue("An inquiry URL to AccountManager should be built. CI Failure - https://jira.kuali.org/browse/KULRICE-9286", StringUtils.contains(inquiryUrl,
51                  "amId=1"));
52          Assert.assertTrue("An inquiry URL to AccountManager should be built", StringUtils.contains(inquiryUrl,
53                  "businessObjectClassName=" + AccountManager.class.getName()));
54      }
55  
56  }