org.kuali.rice.krad.uif.util
Class UifUnitTestUtils

java.lang.Object
  extended by org.kuali.rice.krad.uif.util.UifUnitTestUtils

public class UifUnitTestUtils
extends Object

Utilities class for establishing a minimal environment for testing operations involving Uif components.

Author:
Kuali Rice Team (rice.collab@kuali.org)

Constructor Summary
UifUnitTestUtils()
           
 
Method Summary
static void establishMockConfig(String applicationId)
          Establish a Rice configuration providing enough mock services via GlobalResourceLoader to support the use of KRAD UIF components in unit tests.
static void establishMockUserSession(String principalName)
          Establish a user session with the given principal name.
static ViewAuthorizer getAllowMostViewAuthorizer()
          Get a view authorizer allowing most operations.
static Person getMockPerson(String id)
          Get a mock person object for use in a JUnit test case.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UifUnitTestUtils

public UifUnitTestUtils()
Method Detail

getMockPerson

public static Person getMockPerson(String id)
Get a mock person object for use in a JUnit test case.

Parameters:
id - The ID to use for principal name, principal ID, and entity ID.
Returns:
A mock person with the supplied ID.

establishMockConfig

public static void establishMockConfig(String applicationId)
Establish a Rice configuration providing enough mock services via GlobalResourceLoader to support the use of KRAD UIF components in unit tests.

Parameters:
applicationId - The application ID for the fake environment.

establishMockUserSession

public static void establishMockUserSession(String principalName)
Establish a user session with the given principal name.

This method will use KIM API calls to look up a person with the provided principal name. Use establishMockConfig(String) to set up a mock KIM environment if needed.

Parameters:
principalName - The principal name of the user to establish a session with.

getAllowMostViewAuthorizer

public static ViewAuthorizer getAllowMostViewAuthorizer()
Get a view authorizer allowing most operations.

Returns:
A view authorizer allowing most operations.


Copyright © 2005-2014 The Kuali Foundation. All Rights Reserved.