Class MockUserManagement
- java.lang.Object
-
- com.yahoo.vespa.hosted.controller.api.integration.stubs.MockUserManagement
-
- All Implemented Interfaces:
UserManagement
public class MockUserManagement extends java.lang.Object implements UserManagement
- Author:
- jonmv
-
-
Constructor Summary
Constructors Constructor Description MockUserManagement()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddToRoles(UserId user, java.util.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, java.util.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.java.util.List<Role>listRoles(UserId userId)Returns all roles of which the given user is part, or throws if the user does not existjava.util.List<User>listUsers(Role role)Returns all users in the given role, or throws if the role does not exist.voidremoveFromRoles(UserId user, java.util.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, java.util.Collection<UserId> users)Ensures none of the given users are part of the given role, or throws if the role does not exist.
-
-
-
Method Detail
-
createRole
public void createRole(Role role)
Description copied from interface:UserManagementCreates the given role, or throws if the role already exists.- Specified by:
createRolein interfaceUserManagement
-
deleteRole
public void deleteRole(Role role)
Description copied from interface:UserManagementEnsures the given role does not exist.- Specified by:
deleteRolein interfaceUserManagement
-
addUsers
public void addUsers(Role role, java.util.Collection<UserId> users)
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
public void addToRoles(UserId user, java.util.Collection<Role> roles)
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
public void removeUsers(Role role, java.util.Collection<UserId> users)
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
public void removeFromRoles(UserId user, java.util.Collection<Role> roles)
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
public java.util.List<User> listUsers(Role role)
Description copied from interface:UserManagementReturns all users in the given role, or throws if the role does not exist.- Specified by:
listUsersin interfaceUserManagement
-
listRoles
public java.util.List<Role> listRoles(UserId userId)
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
-
-