package com.yahoo.vespa.hosted.controller.api.integration.stubs;

public class MockUserManagement {

}

@@ -63,41 +63,1227 @@
 s;%0A%0A
-public class MockUserManagement %7B
+import com.yahoo.vespa.hosted.controller.api.integration.user.UserId;%0Aimport com.yahoo.vespa.hosted.controller.api.integration.user.UserManagement;%0Aimport com.yahoo.vespa.hosted.controller.api.role.Role;%0A%0Aimport java.util.Collection;%0Aimport java.util.HashMap;%0Aimport java.util.HashSet;%0Aimport java.util.List;%0Aimport java.util.Map;%0Aimport java.util.Set;%0A%0A/**%0A * @author jonmv%0A */%0Apublic class MockUserManagement implements UserManagement %7B%0A%0A    private final Map%3CRole, Set%3CUserId%3E%3E memberships = new HashMap%3C%3E();%0A%0A    @Override%0A    public void createRole(Role role) %7B%0A        if (memberships.containsKey(role))%0A            throw new IllegalArgumentException(role + %22 already exists.%22);%0A%0A        memberships.put(role, new HashSet%3C%3E());%0A    %7D%0A%0A    @Override%0A    public void deleteRole(Role role) %7B%0A        memberships.remove(role);%0A    %7D%0A%0A    @Override%0A    public void addUsers(Role role, Collection%3CUserId%3E users) %7B%0A        memberships.get(role).addAll(users);%0A    %7D%0A%0A    @Override%0A    public void removeUsers(Role role, Collection%3CUserId%3E users) %7B%0A        memberships.get(role).removeAll(users);%0A    %7D%0A%0A    @Override%0A    public List%3CUserId%3E listUsers(Role role) %7B%0A        return List.copyOf(memberships.get(role));%0A    %7D
 %0A%0A%7D%0A

Add mock implementation of UserManagement