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.krad.uif.util;
17  
18  import java.util.List;
19  import java.util.Map;
20  
21  import org.kuali.rice.kim.api.identity.Person;
22  import org.kuali.rice.kim.api.identity.PersonService;
23  
24  /**
25   * Mock person service implementation.
26   */
27  class MockPersonService implements PersonService {
28  
29      /**
30       * Get a mock person object for use in a JUnit test case.
31       * 
32       * @param id The ID to use for principal name, principal ID, and entity ID.
33       * @return A mock person with the supplied ID.
34       */
35      public static Person getMockPerson(String id) {
36          return new MockPerson(id);
37      }
38  
39      @Override
40      public Person getPerson(String principalId) {
41          return getMockPerson(principalId);
42      }
43  
44      @Override
45      public List<Person> getPersonByExternalIdentifier(String externalIdentifierTypeCode,
46              String externalId) {
47          return null;
48      }
49  
50      @Override
51      public Person getPersonByPrincipalName(String principalName) {
52          return getMockPerson(principalName);
53      }
54  
55      @Override
56      public Person getPersonByEmployeeId(String employeeId) {
57          return null;
58      }
59  
60      @Override
61      public List<Person> findPeople(Map<String, String> criteria) {
62          return null;
63      }
64  
65      @Override
66      public List<Person> findPeople(Map<String, String> criteria, boolean unbounded) {
67          return null;
68      }
69  
70      @Override
71      public Class<? extends Person> getPersonImplementationClass() {
72          return MockPerson.class;
73      }
74  
75      @SuppressWarnings("deprecation")
76      @Override
77      public Map<String, String> resolvePrincipalNamesToPrincipalIds(
78              org.kuali.rice.krad.bo.BusinessObject businessObject,
79              Map<String, String> fieldValues) {
80          return null;
81      }
82  
83      @Override
84      public Person updatePersonIfNecessary(String sourcePrincipalId, Person currentPerson) {
85          return null;
86      }
87  }
88