01: /*
02: * Copyright 2006-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.test.fixtures;
17:
18: import org.kuali.core.bo.user.AuthenticationUserId;
19: import org.kuali.core.bo.user.UniversalUser;
20: import org.kuali.core.exceptions.UserNotFoundException;
21: import org.kuali.core.service.UniversalUserService;
22: import org.kuali.kfs.context.SpringContext;
23:
24: public enum UserNameFixture {
25:
26: NO_SESSION, // This is not a user name. It is a Sentinal value telling KualiTestBase not to create a session. (It's needed
27: // because null is not a valid default for the ConfigureContext annotation's session element.)
28: KULUSER, // This is the KualiUser.SYSTEM_USER, which certain automated document type authorizers require.
29: KHUNTLEY, // KualiTestBaseWithSession used this one by default. (testUsername in configuration.properties, no longer used but
30: // cannot be removed because that file cannot be committed).
31: DFOGLE, RJWEISS, RORENFRO, HSCHREIN, LRAAB, JHAVENS, KCOPLEY, MHKOZLOW, INEFF, VPUTMAN, CSWINSON, MYLARGE, RRUFFNER, SEASON, DQPERRON, AATWOOD, PARKE, APPLETON, TWATSON, ;
32:
33: static {
34: // Assert.assertEquals(KualiUser.SYSTEM_USER, KULUSER.toString());
35: }
36:
37: public AuthenticationUserId getAuthenticationUserId() {
38: return new AuthenticationUserId(toString());
39: }
40:
41: public UniversalUser getUniversalUser()
42: throws UserNotFoundException {
43: return SpringContext.getBean(UniversalUserService.class)
44: .getUniversalUser(getAuthenticationUserId());
45: }
46: }
|