View Javadoc
1   /**
2    * Copyright 2005-2014 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.KRADTestCase;
24  
25  import org.junit.Assert;
26  import org.kuali.rice.krad.test.document.bo.AccountType;
27  
28  /**
29   * KualiInquirableTest tests {@link KualiInquirableImpl} methods
30   * 
31   * @author Kuali Rice Team (rice.collab@kuali.org)
32   *
33   * @deprecated KNS test class, convert to KRAD equivalent if applicable.
34   */
35  @Deprecated
36  public class KualiInquirableTest extends KNSTestCase {
37  
38      private AccountType at;
39  
40      @Override
41      public void setUp() throws Exception {
42          super.setUp();
43          at = new AccountType();
44          at.setAccountTypeCode("ABC");
45      }
46  
47      /**
48       * Tests the inquiry url output for a given bo and property name
49       */
50      @Test public final void testBuildInquiryUrl() {
51      	String inquiryUrl = ((HtmlData.AnchorHtmlData)new KualiInquirableImpl().getInquiryUrl(at, "accountTypeCode", true)).getHref();
52          Assert.assertTrue("An inquiry URL to AccountType should be built. CI Failure - ", StringUtils.contains(inquiryUrl,
53                  "accountTypeCode=ABC"));
54          Assert.assertTrue("An inquiry URL to AccountType should be built", StringUtils.contains(inquiryUrl,
55                  "businessObjectClassName=" + AccountType.class.getName()));
56      }
57  
58  }