01: /*
02: * Copyright 2005-2007 The Kuali Foundation.
03: *
04: * Licensed under the Educational Community License, Version 1.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.opensource.org/licenses/ecl1.php
09: *
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.core.inquiry;
17:
18: import org.apache.commons.lang.StringUtils;
19: import org.junit.Test;
20: import org.kuali.test.KNSTestBase;
21: import org.kuali.test.KNSWithTestSpringContext;
22:
23: import edu.sampleu.travel.bo.FiscalOfficer;
24:
25: /**
26: * This class tests the KualiInquirable methods.
27: *
28: *
29: */
30: @KNSWithTestSpringContext
31: public class KualiInquirableTest extends KNSTestBase {
32:
33: private FiscalOfficer fo;
34:
35: @Override
36: public void setUp() throws Exception {
37: super .setUp();
38: fo = new FiscalOfficer();
39: fo.setId(new Long(1));
40: }
41:
42: /**
43: * Tests the inquiry url output for a given bo and property name.
44: */
45: @Test
46: public final void testBuildInquiryUrl() {
47: String inquiryUrl = new KualiInquirableImpl().getInquiryUrl(fo,
48: "id", true);
49: assertTrue("An inquiry URL to Organization should be built",
50: StringUtils.contains(inquiryUrl, "id=1"));
51: assertTrue(
52: "An inquiry URL to Organization should be built",
53: StringUtils
54: .contains(inquiryUrl,
55: "businessObjectClassName=edu.sampleu.travel.bo.FiscalOfficer"));
56: }
57:
58: }
|