com.silverpeas.profile.web
Class UserProfileTestResources

java.lang.Object
  extended by com.silverpeas.web.TestResources
      extended by com.silverpeas.profile.web.UserProfileTestResources
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware

@Named(value="testRESTResources")
public class UserProfileTestResources
extends TestResources

The resources to use in the test on the UserProfileResource REST service. Theses objects manage in a single place all the resources required to perform correctly unit tests on the UserProfileResource published operations.


Field Summary
static String GROUP_PROFILE_PATH
           
static String JAVA_PACKAGE
           
static String SPRING_CONTEXT
           
static String USER_PROFILE_PATH
           
 
Fields inherited from class com.silverpeas.web.TestResources
DEFAULT_DOMAIN, DEFAULT_LANGUAGE, TEST_RESOURCES_NAME, USER_ID_IN_TEST
 
Constructor Summary
UserProfileTestResources()
           
 
Method Summary
 void allocate()
          Allocates the resources required by the unit tests.
 Group anExistingGroup()
          Gets randomly an existing group among the available resources for tests.
 Group anExistingRootGroup()
           
 UserDetail anExistingUser()
          Gets randomly an existing user detail among the available resources for tests.
 UserDetail anExistingUserNotInSilverpeasDomain()
           
 Group getAGroupNotInAnInternalDomain()
          Gets a group that isn't in an internal domain.
 List<String> getAllDomainIds()
           
 List<String> getAllDomainIdsExceptedSilverpeasOne()
           
 Group[] getAllExistingRootGroups()
           
 Group[] getAllExistingRootGroupsInDomain(String domainId)
           
 UserDetail[] getAllExistingUsers()
           
 UserDetail[] getAllExistingUsersInDomain(String domainId)
           
 Group[] getAllRootGroupsAccessibleFromDomain(String domainId)
           
 Group getGroupById(String groupId)
           
 String[] getGroupIds(Group... groups)
           
 UserDetail[] getRelationShipsOfUser(String userId)
           
 String[] getUserIds(UserDetail... users)
           
 UserDetail registerUser(UserDetail user)
           
 void whenSearchGroupsByCriteriaThenReturn(Group[] groups)
           
 void whenSearchUsersByCriteriaThenReturn(UserDetailsSearchCriteria criteria, UserDetail[] users)
           
 
Methods inherited from class com.silverpeas.web.TestResources
aUser, aUserNamed, getAccessControllerMock, getApplicationContext, getOrganizationControllerMock, getPersonalizationServiceMock, getSessionManagerMock, getSpaceAccessControllerMock, getTestResources, getTokenServiceMock, setApplicationContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

JAVA_PACKAGE

public static final String JAVA_PACKAGE
See Also:
Constant Field Values

SPRING_CONTEXT

public static final String SPRING_CONTEXT
See Also:
Constant Field Values

USER_PROFILE_PATH

public static final String USER_PROFILE_PATH
See Also:
Constant Field Values

GROUP_PROFILE_PATH

public static final String GROUP_PROFILE_PATH
See Also:
Constant Field Values
Constructor Detail

UserProfileTestResources

public UserProfileTestResources()
Method Detail

allocate

@PostConstruct
public void allocate()
Allocates the resources required by the unit tests.


getAllExistingUsers

public UserDetail[] getAllExistingUsers()

whenSearchGroupsByCriteriaThenReturn

public void whenSearchGroupsByCriteriaThenReturn(Group[] groups)

whenSearchUsersByCriteriaThenReturn

public void whenSearchUsersByCriteriaThenReturn(UserDetailsSearchCriteria criteria,
                                                UserDetail[] users)

getAllExistingUsersInDomain

public UserDetail[] getAllExistingUsersInDomain(String domainId)

getAllExistingRootGroups

public Group[] getAllExistingRootGroups()

getAllExistingRootGroupsInDomain

public Group[] getAllExistingRootGroupsInDomain(String domainId)

getAllRootGroupsAccessibleFromDomain

public Group[] getAllRootGroupsAccessibleFromDomain(String domainId)

getGroupById

public Group getGroupById(String groupId)

getAllDomainIds

public List<String> getAllDomainIds()

getAllDomainIdsExceptedSilverpeasOne

public List<String> getAllDomainIdsExceptedSilverpeasOne()

anExistingUser

public UserDetail anExistingUser()
Gets randomly an existing user detail among the available resources for tests.

Returns:
a user detail.

anExistingUserNotInSilverpeasDomain

public UserDetail anExistingUserNotInSilverpeasDomain()

anExistingGroup

public Group anExistingGroup()
Gets randomly an existing group among the available resources for tests.

Returns:
a group.

anExistingRootGroup

public Group anExistingRootGroup()

getAGroupNotInAnInternalDomain

public Group getAGroupNotInAnInternalDomain()
Gets a group that isn't in an internal domain.

Returns:
a group in a domain other than internal one.

getRelationShipsOfUser

public UserDetail[] getRelationShipsOfUser(String userId)

registerUser

public UserDetail registerUser(UserDetail user)
Overrides:
registerUser in class TestResources

getUserIds

public String[] getUserIds(UserDetail... users)

getGroupIds

public String[] getGroupIds(Group... groups)


Copyright © 2016 Silverpeas. All Rights Reserved.