public class MockCrowdService extends Object implements com.atlassian.crowd.embedded.api.CrowdService
Modifier and Type | Field and Description |
---|---|
protected Map<String,com.atlassian.crowd.embedded.api.PasswordCredential> |
credentials |
protected Map<String,com.google.common.collect.SetMultimap<String,String>> |
groupAttributes |
protected com.google.common.collect.Multimap<String,com.atlassian.crowd.embedded.api.User> |
groupMembers |
protected Map<String,com.atlassian.crowd.embedded.api.Group> |
groups |
protected com.google.common.collect.Multimap<String,com.atlassian.crowd.embedded.api.Group> |
nestedGroups |
protected Map<String,Map<String,Set<String>>> |
userAttributes |
protected Map<String,com.atlassian.crowd.embedded.api.User> |
users |
Constructor and Description |
---|
MockCrowdService() |
Modifier and Type | Method and Description |
---|---|
com.atlassian.crowd.embedded.api.Group |
addGroup(com.atlassian.crowd.embedded.api.Group group) |
boolean |
addGroupToGroup(com.atlassian.crowd.embedded.api.Group childGroup,
com.atlassian.crowd.embedded.api.Group parentGroup) |
com.atlassian.crowd.embedded.api.User |
addUser(ApplicationUser user) |
com.atlassian.crowd.embedded.api.User |
addUser(com.atlassian.crowd.embedded.api.User user,
String credential) |
com.atlassian.crowd.embedded.api.UserWithAttributes |
addUser(com.atlassian.crowd.embedded.api.UserWithAttributes user,
String credential) |
boolean |
addUserToGroup(ApplicationUser user,
com.atlassian.crowd.embedded.api.Group group) |
boolean |
addUserToGroup(com.atlassian.crowd.embedded.api.User user,
com.atlassian.crowd.embedded.api.Group group) |
com.atlassian.crowd.embedded.api.User |
authenticate(String name,
String credential) |
Collection<com.atlassian.crowd.embedded.api.User> |
getAllUsers() |
com.atlassian.crowd.embedded.api.UserCapabilities |
getCapabilitiesForNewUsers() |
com.atlassian.crowd.embedded.api.Group |
getGroup(String name) |
com.atlassian.crowd.embedded.api.GroupWithAttributes |
getGroupWithAttributes(String name) |
com.atlassian.crowd.embedded.api.User |
getRemoteUser(String name) |
com.atlassian.crowd.embedded.api.User |
getUser(String name) |
protected UserKeyStore |
getUserKeyStore() |
com.atlassian.crowd.embedded.api.UserWithAttributes |
getUserWithAttributes(String name) |
boolean |
isGroupDirectGroupMember(com.atlassian.crowd.embedded.api.Group childGroup,
com.atlassian.crowd.embedded.api.Group parentGroup) |
boolean |
isGroupMemberOfGroup(com.atlassian.crowd.embedded.api.Group childGroup,
com.atlassian.crowd.embedded.api.Group parentGroup) |
boolean |
isGroupMemberOfGroup(String childGroupName,
String parentGroup) |
boolean |
isUserDirectGroupMember(com.atlassian.crowd.embedded.api.User user,
com.atlassian.crowd.embedded.api.Group group) |
boolean |
isUserMemberOfGroup(String userName,
String groupName) |
boolean |
isUserMemberOfGroup(com.atlassian.crowd.embedded.api.User user,
com.atlassian.crowd.embedded.api.Group group) |
boolean |
mockUsersInGroup(int numberOfUsers,
com.atlassian.crowd.embedded.api.Group group) |
void |
removeAllGroupAttributes(com.atlassian.crowd.embedded.api.Group group) |
void |
removeAllUserAttributes(com.atlassian.crowd.embedded.api.User user) |
boolean |
removeGroup(com.atlassian.crowd.embedded.api.Group group) |
void |
removeGroupAttribute(com.atlassian.crowd.embedded.api.Group group,
String attributeName) |
boolean |
removeGroupFromGroup(com.atlassian.crowd.embedded.api.Group childGroup,
com.atlassian.crowd.embedded.api.Group parentGroup) |
boolean |
removeUser(com.atlassian.crowd.embedded.api.User user) |
void |
removeUserAttribute(com.atlassian.crowd.embedded.api.User user,
String key) |
boolean |
removeUserFromGroup(com.atlassian.crowd.embedded.api.User user,
com.atlassian.crowd.embedded.api.Group group) |
com.atlassian.crowd.embedded.api.User |
renameUser(com.atlassian.crowd.embedded.api.User user,
String newUsername) |
<T> Iterable<T> |
search(com.atlassian.crowd.embedded.api.Query<T> query) |
Iterable<com.atlassian.crowd.embedded.api.User> |
searchUsersAllowingDuplicateNames(com.atlassian.crowd.embedded.api.Query<com.atlassian.crowd.embedded.api.User> userQuery) |
void |
setGroupAttribute(com.atlassian.crowd.embedded.api.Group group,
String attributeName,
Set<String> attributeValues) |
void |
setGroupAttribute(com.atlassian.crowd.embedded.api.Group group,
String attributeName,
String attributeValue) |
void |
setUserAttribute(com.atlassian.crowd.embedded.api.User user,
String key,
Set<String> value) |
void |
setUserAttribute(com.atlassian.crowd.embedded.api.User user,
String key,
String value) |
com.atlassian.crowd.embedded.api.Group |
updateGroup(com.atlassian.crowd.embedded.api.Group group) |
com.atlassian.crowd.embedded.api.User |
updateUser(com.atlassian.crowd.embedded.api.User user) |
void |
updateUserCredential(com.atlassian.crowd.embedded.api.User user,
String credential) |
com.atlassian.crowd.embedded.api.User |
userAuthenticated(String s) |
protected Map<String,com.google.common.collect.SetMultimap<String,String>> groupAttributes
protected com.google.common.collect.Multimap<String,com.atlassian.crowd.embedded.api.User> groupMembers
protected com.google.common.collect.Multimap<String,com.atlassian.crowd.embedded.api.Group> nestedGroups
public com.atlassian.crowd.embedded.api.User addUser(com.atlassian.crowd.embedded.api.User user, String credential)
addUser
in interface com.atlassian.crowd.embedded.api.CrowdService
public com.atlassian.crowd.embedded.api.UserWithAttributes addUser(com.atlassian.crowd.embedded.api.UserWithAttributes user, String credential)
addUser
in interface com.atlassian.crowd.embedded.api.CrowdService
public com.atlassian.crowd.embedded.api.User addUser(ApplicationUser user) throws com.atlassian.crowd.exception.InvalidUserException, com.atlassian.crowd.exception.InvalidCredentialException
com.atlassian.crowd.exception.InvalidUserException
com.atlassian.crowd.exception.InvalidCredentialException
protected UserKeyStore getUserKeyStore()
public com.atlassian.crowd.embedded.api.User updateUser(com.atlassian.crowd.embedded.api.User user) throws com.atlassian.crowd.exception.InvalidUserException
updateUser
in interface com.atlassian.crowd.embedded.api.CrowdService
com.atlassian.crowd.exception.InvalidUserException
public com.atlassian.crowd.embedded.api.User renameUser(com.atlassian.crowd.embedded.api.User user, String newUsername)
renameUser
in interface com.atlassian.crowd.embedded.api.CrowdService
public void updateUserCredential(com.atlassian.crowd.embedded.api.User user, String credential) throws com.atlassian.crowd.exception.InvalidCredentialException
updateUserCredential
in interface com.atlassian.crowd.embedded.api.CrowdService
com.atlassian.crowd.exception.InvalidCredentialException
public void setUserAttribute(com.atlassian.crowd.embedded.api.User user, String key, String value)
setUserAttribute
in interface com.atlassian.crowd.embedded.api.CrowdService
public void setUserAttribute(com.atlassian.crowd.embedded.api.User user, String key, Set<String> value)
setUserAttribute
in interface com.atlassian.crowd.embedded.api.CrowdService
public void removeUserAttribute(com.atlassian.crowd.embedded.api.User user, String key)
removeUserAttribute
in interface com.atlassian.crowd.embedded.api.CrowdService
public void removeAllUserAttributes(com.atlassian.crowd.embedded.api.User user)
removeAllUserAttributes
in interface com.atlassian.crowd.embedded.api.CrowdService
public boolean removeUser(com.atlassian.crowd.embedded.api.User user)
removeUser
in interface com.atlassian.crowd.embedded.api.CrowdService
public com.atlassian.crowd.embedded.api.Group addGroup(com.atlassian.crowd.embedded.api.Group group)
addGroup
in interface com.atlassian.crowd.embedded.api.CrowdService
public boolean mockUsersInGroup(int numberOfUsers, com.atlassian.crowd.embedded.api.Group group)
public com.atlassian.crowd.embedded.api.Group updateGroup(com.atlassian.crowd.embedded.api.Group group)
updateGroup
in interface com.atlassian.crowd.embedded.api.CrowdService
public void setGroupAttribute(com.atlassian.crowd.embedded.api.Group group, String attributeName, String attributeValue)
setGroupAttribute
in interface com.atlassian.crowd.embedded.api.CrowdService
public void setGroupAttribute(com.atlassian.crowd.embedded.api.Group group, String attributeName, Set<String> attributeValues)
setGroupAttribute
in interface com.atlassian.crowd.embedded.api.CrowdService
public void removeGroupAttribute(com.atlassian.crowd.embedded.api.Group group, String attributeName)
removeGroupAttribute
in interface com.atlassian.crowd.embedded.api.CrowdService
public void removeAllGroupAttributes(com.atlassian.crowd.embedded.api.Group group)
removeAllGroupAttributes
in interface com.atlassian.crowd.embedded.api.CrowdService
public boolean removeGroup(com.atlassian.crowd.embedded.api.Group group)
removeGroup
in interface com.atlassian.crowd.embedded.api.CrowdService
public boolean addUserToGroup(com.atlassian.crowd.embedded.api.User user, com.atlassian.crowd.embedded.api.Group group)
addUserToGroup
in interface com.atlassian.crowd.embedded.api.CrowdService
public boolean addUserToGroup(ApplicationUser user, com.atlassian.crowd.embedded.api.Group group)
public boolean addGroupToGroup(com.atlassian.crowd.embedded.api.Group childGroup, com.atlassian.crowd.embedded.api.Group parentGroup) throws com.atlassian.crowd.exception.runtime.GroupNotFoundException
addGroupToGroup
in interface com.atlassian.crowd.embedded.api.CrowdService
com.atlassian.crowd.exception.runtime.GroupNotFoundException
public boolean removeUserFromGroup(com.atlassian.crowd.embedded.api.User user, com.atlassian.crowd.embedded.api.Group group)
removeUserFromGroup
in interface com.atlassian.crowd.embedded.api.CrowdService
public boolean removeGroupFromGroup(com.atlassian.crowd.embedded.api.Group childGroup, com.atlassian.crowd.embedded.api.Group parentGroup)
removeGroupFromGroup
in interface com.atlassian.crowd.embedded.api.CrowdService
public boolean isUserDirectGroupMember(com.atlassian.crowd.embedded.api.User user, com.atlassian.crowd.embedded.api.Group group)
isUserDirectGroupMember
in interface com.atlassian.crowd.embedded.api.CrowdService
public boolean isGroupDirectGroupMember(com.atlassian.crowd.embedded.api.Group childGroup, com.atlassian.crowd.embedded.api.Group parentGroup)
isGroupDirectGroupMember
in interface com.atlassian.crowd.embedded.api.CrowdService
public com.atlassian.crowd.embedded.api.User authenticate(String name, String credential) throws com.atlassian.crowd.exception.runtime.OperationFailedException, com.atlassian.crowd.exception.FailedAuthenticationException
authenticate
in interface com.atlassian.crowd.embedded.api.CrowdService
com.atlassian.crowd.exception.runtime.OperationFailedException
com.atlassian.crowd.exception.FailedAuthenticationException
public com.atlassian.crowd.embedded.api.User getUser(String name)
getUser
in interface com.atlassian.crowd.embedded.api.CrowdService
public com.atlassian.crowd.embedded.api.User getRemoteUser(String name)
getRemoteUser
in interface com.atlassian.crowd.embedded.api.CrowdService
public com.atlassian.crowd.embedded.api.User userAuthenticated(String s) throws com.atlassian.crowd.exception.runtime.UserNotFoundException, com.atlassian.crowd.exception.runtime.OperationFailedException, com.atlassian.crowd.exception.InactiveAccountException
userAuthenticated
in interface com.atlassian.crowd.embedded.api.CrowdService
com.atlassian.crowd.exception.runtime.UserNotFoundException
com.atlassian.crowd.exception.runtime.OperationFailedException
com.atlassian.crowd.exception.InactiveAccountException
public com.atlassian.crowd.embedded.api.UserWithAttributes getUserWithAttributes(String name)
getUserWithAttributes
in interface com.atlassian.crowd.embedded.api.CrowdService
public com.atlassian.crowd.embedded.api.Group getGroup(String name)
getGroup
in interface com.atlassian.crowd.embedded.api.CrowdService
public com.atlassian.crowd.embedded.api.GroupWithAttributes getGroupWithAttributes(String name)
getGroupWithAttributes
in interface com.atlassian.crowd.embedded.api.CrowdService
public <T> Iterable<T> search(com.atlassian.crowd.embedded.api.Query<T> query)
search
in interface com.atlassian.crowd.embedded.api.CrowdService
public boolean isUserMemberOfGroup(com.atlassian.crowd.embedded.api.User user, com.atlassian.crowd.embedded.api.Group group)
isUserMemberOfGroup
in interface com.atlassian.crowd.embedded.api.CrowdService
public boolean isUserMemberOfGroup(String userName, String groupName)
isUserMemberOfGroup
in interface com.atlassian.crowd.embedded.api.CrowdService
public boolean isGroupMemberOfGroup(String childGroupName, String parentGroup)
isGroupMemberOfGroup
in interface com.atlassian.crowd.embedded.api.CrowdService
public boolean isGroupMemberOfGroup(com.atlassian.crowd.embedded.api.Group childGroup, com.atlassian.crowd.embedded.api.Group parentGroup)
isGroupMemberOfGroup
in interface com.atlassian.crowd.embedded.api.CrowdService
public Iterable<com.atlassian.crowd.embedded.api.User> searchUsersAllowingDuplicateNames(com.atlassian.crowd.embedded.api.Query<com.atlassian.crowd.embedded.api.User> userQuery)
public com.atlassian.crowd.embedded.api.UserCapabilities getCapabilitiesForNewUsers()
getCapabilitiesForNewUsers
in interface com.atlassian.crowd.embedded.api.CrowdService
public Collection<com.atlassian.crowd.embedded.api.User> getAllUsers()
Copyright © 2002-2018 Atlassian. All Rights Reserved.