Class MockUserManagement
java.lang.Object
com.yahoo.component.AbstractComponent
com.yahoo.vespa.hosted.controller.api.integration.stubs.MockUserManagement
- All Implemented Interfaces:
com.yahoo.component.Component,com.yahoo.component.Deconstructable,UserManagement,Comparable<com.yahoo.component.Component>
public class MockUserManagement
extends com.yahoo.component.AbstractComponent
implements UserManagement
- Author:
- jonmv
-
Field Summary
Fields inherited from class com.yahoo.component.AbstractComponent
isDeconstructable -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddToRoles(UserId user, Collection<Role> roles) Ensures the given user exist, and are part of the given roles, or throws if the roles does not exist.voidaddUsers(Role role, Collection<UserId> users) Ensures the given users exist, and are part of the given role, or throws if the role does not exist.voidcreateRole(Role role) Creates the given role, or throws if the role already exists.voiddeleteRole(Role role) Ensures the given role does not exist.Optional<com.yahoo.jdisc.http.filter.security.misc.User>Find a user with all attributesList<com.yahoo.jdisc.http.filter.security.misc.User>Find all users from the database given queryReturns all rolesReturns all roles of which the given user is part, or throws if the user does not existList<com.yahoo.jdisc.http.filter.security.misc.User>Returns all users in the given role, or throws if the role does not exist.voidremoveFromRoles(UserId user, Collection<Role> roles) Ensures the given users are not part of the given role, or throws if the roles does not exist.voidremoveUsers(Role role, Collection<UserId> users) Ensures none of the given users are part of the given role, or throws if the role does not exist.Methods inherited from class com.yahoo.component.AbstractComponent
clone, compareTo, deconstruct, getClassName, getId, getIdString, hasInitializedId, initId, isDeconstructable, setIsDeconstructable, toString
-
Constructor Details
-
MockUserManagement
public MockUserManagement()
-
-
Method Details
-
createRole
Description copied from interface:UserManagementCreates the given role, or throws if the role already exists.- Specified by:
createRolein interfaceUserManagement
-
deleteRole
Description copied from interface:UserManagementEnsures the given role does not exist.- Specified by:
deleteRolein interfaceUserManagement
-
addUsers
Description copied from interface:UserManagementEnsures the given users exist, and are part of the given role, or throws if the role does not exist.- Specified by:
addUsersin interfaceUserManagement
-
addToRoles
Description copied from interface:UserManagementEnsures the given user exist, and are part of the given roles, or throws if the roles does not exist.- Specified by:
addToRolesin interfaceUserManagement
-
removeUsers
Description copied from interface:UserManagementEnsures none of the given users are part of the given role, or throws if the role does not exist.- Specified by:
removeUsersin interfaceUserManagement
-
removeFromRoles
Description copied from interface:UserManagementEnsures the given users are not part of the given role, or throws if the roles does not exist.- Specified by:
removeFromRolesin interfaceUserManagement
-
listUsers
Description copied from interface:UserManagementReturns all users in the given role, or throws if the role does not exist.- Specified by:
listUsersin interfaceUserManagement
-
listRoles
Description copied from interface:UserManagementReturns all roles of which the given user is part, or throws if the user does not exist- Specified by:
listRolesin interfaceUserManagement
-
listRoles
Description copied from interface:UserManagementReturns all roles- Specified by:
listRolesin interfaceUserManagement
-
findUser
Description copied from interface:UserManagementFind a user with all attributes- Specified by:
findUserin interfaceUserManagement
-
findUsers
Description copied from interface:UserManagementFind all users from the database given query- Specified by:
findUsersin interfaceUserManagement
-