Loading cadcAccessControl-Server/build.xml +3 −0 Original line number Diff line number Diff line Loading @@ -115,6 +115,9 @@ <mkdir dir="${user.home}/config" /> <copy overwrite="true" file="test/LdapConfig.test.properties" todir="${user.home}/config/"/> <copy overwrite="true" file="${env.CADC_PREFIX}/etc/LocalAuthority.properties" tofile="${build}/class/LocalAuthority.properties"/> </target> <!-- JAR files needed to run the test suite --> Loading cadcAccessControl-Server/src/ca/nrc/cadc/ac/server/ldap/LdapUserDAO.java +8 −12 Original line number Diff line number Diff line Loading @@ -86,7 +86,6 @@ import javax.security.auth.x500.X500Principal; import org.apache.log4j.Logger; import ca.nrc.cadc.ac.AC; import ca.nrc.cadc.ac.Group; import ca.nrc.cadc.ac.InternalID; import ca.nrc.cadc.ac.PersonalDetails; Loading @@ -101,6 +100,7 @@ import ca.nrc.cadc.auth.HttpPrincipal; import ca.nrc.cadc.auth.NumericPrincipal; import ca.nrc.cadc.net.TransientException; import ca.nrc.cadc.profiler.Profiler; import ca.nrc.cadc.reg.client.LocalAuthority; import ca.nrc.cadc.util.ObjectUtil; import ca.nrc.cadc.util.StringUtil; Loading Loading @@ -140,8 +140,6 @@ public class LdapUserDAO extends LdapDAO private static final Logger logger = Logger.getLogger(LdapUserDAO.class); private String internalIdUriPrefix = AC.USER_URI; // Map of identity type to LDAP attribute private final Map<Class<?>, String> userLdapAttrib = new HashMap<Class<?>, String>(); Loading Loading @@ -740,7 +738,10 @@ public class LdapUserDAO extends LdapDAO user.getIdentities().add(new DNPrincipal(searchResult.getAttributeValue(LDAP_ENTRYDN))); // cache memberOf values in the user GroupMemberships gms = new GroupMemberships(userID); LocalAuthority localAuthority = new LocalAuthority(); URI gmsServiceURI = localAuthority.getServiceURI("gms"); GroupMemberships gms = new GroupMemberships(gmsServiceURI.toString(), userID); user.appData = gms; // add even if empty String[] mems = searchResult.getAttributeValues(LDAP_MEMBEROF); if (mems != null && mems.length > 0) Loading Loading @@ -926,8 +927,6 @@ public class LdapUserDAO extends LdapDAO public User modifyUser(final User user) throws UserNotFoundException, TransientException, AccessControlException { // Will we always have a HttpPrincipal? User existingUser = getUser(user.getHttpPrincipal()); List<Modification> mods = new ArrayList<Modification>(); Loading Loading @@ -1274,15 +1273,12 @@ public class LdapUserDAO extends LdapDAO return uuid.getLeastSignificantBits(); } protected void setInternalIdUriPrefix(String internalIdUriPrefix) { this.internalIdUriPrefix = internalIdUriPrefix; } protected InternalID getInternalID(String numericID) { UUID uuid = new UUID(0L, Long.parseLong(numericID)); String uriString = internalIdUriPrefix + "?" + uuid.toString(); LocalAuthority localAuthority = new LocalAuthority(); URI umsServiceURI = localAuthority.getServiceURI("ums"); String uriString = umsServiceURI.toString() + "?" + uuid.toString(); URI uri; try { Loading cadcAccessControl-Server/src/ca/nrc/cadc/ac/server/ldap/LdapUserPersistence.java +17 −45 Original line number Diff line number Diff line Loading @@ -121,7 +121,7 @@ public class LdapUserPersistence extends LdapPersistence implements UserPersiste LdapConnections conns = new LdapConnections(this); try { userDAO = getLdapUserDao(conns); userDAO = new LdapUserDAO(conns); userDAO.addUser(user); } finally Loading @@ -146,7 +146,7 @@ public class LdapUserPersistence extends LdapPersistence implements UserPersiste LdapConnections conns = new LdapConnections(this); try { userDAO = getLdapUserDao(conns); userDAO = new LdapUserDAO(conns); userDAO.addUserRequest(userRequest); } finally Loading Loading @@ -177,7 +177,7 @@ public class LdapUserPersistence extends LdapPersistence implements UserPersiste LdapConnections conns = new LdapConnections(this); try { userDAO = getLdapUserDao(conns); userDAO = new LdapUserDAO(conns); return userDAO.getUser(userID); } finally Loading Loading @@ -205,7 +205,7 @@ public class LdapUserPersistence extends LdapPersistence implements UserPersiste LdapConnections conns = new LdapConnections(this); try { LdapUserDAO userDAO = getLdapUserDao(conns); LdapUserDAO userDAO = new LdapUserDAO(conns); return userDAO.getUserByEmailAddress(emailAddress); } finally Loading Loading @@ -234,7 +234,7 @@ public class LdapUserPersistence extends LdapPersistence implements UserPersiste LdapConnections conns = new LdapConnections(this); try { userDAO = getLdapUserDao(conns); userDAO = new LdapUserDAO(conns); return userDAO.getUserRequest(userID); } finally Loading @@ -243,8 +243,7 @@ public class LdapUserPersistence extends LdapPersistence implements UserPersiste } } /**<<<<<<< HEAD /** * Get the user specified by userID with all of the users identities. * * @param userID The userID. Loading @@ -264,7 +263,7 @@ public class LdapUserPersistence extends LdapPersistence implements UserPersiste try { Profiler profiler = new Profiler(LdapUserPersistence.class); userDAO = getLdapUserDao(conns); userDAO = new LdapUserDAO(conns); profiler.checkpoint("Create LdapUserDAO"); User user = userDAO.getAugmentedUser(userID); profiler.checkpoint("getAugmentedUser"); Loading Loading @@ -299,7 +298,7 @@ public class LdapUserPersistence extends LdapPersistence implements UserPersiste LdapConnections conns = new LdapConnections(this); try { userDAO = getLdapUserDao(conns); userDAO = new LdapUserDAO(conns); return userDAO.getUsers(); } finally Loading @@ -323,7 +322,7 @@ public class LdapUserPersistence extends LdapPersistence implements UserPersiste LdapConnections conns = new LdapConnections(this); try { userDAO = getLdapUserDao(conns); userDAO = new LdapUserDAO(conns); return userDAO.getUserRequests(); } finally Loading Loading @@ -353,7 +352,7 @@ public class LdapUserPersistence extends LdapPersistence implements UserPersiste LdapConnections conns = new LdapConnections(this); try { userDAO = getLdapUserDao(conns); userDAO = new LdapUserDAO(conns); return userDAO.approveUserRequest(userID); } finally Loading Loading @@ -385,7 +384,7 @@ public class LdapUserPersistence extends LdapPersistence implements UserPersiste LdapConnections conns = new LdapConnections(this); try { userDAO = getLdapUserDao(conns); userDAO = new LdapUserDAO(conns); return userDAO.modifyUser(user); } finally Loading Loading @@ -415,7 +414,7 @@ public class LdapUserPersistence extends LdapPersistence implements UserPersiste LdapConnections conns = new LdapConnections(this); try { userDAO = getLdapUserDao(conns); userDAO = new LdapUserDAO(conns); userDAO.deleteUser(userID, true); } finally Loading Loading @@ -444,7 +443,7 @@ public class LdapUserPersistence extends LdapPersistence implements UserPersiste LdapConnections conns = new LdapConnections(this); try { userDAO = getLdapUserDao(conns); userDAO = new LdapUserDAO(conns); userDAO.deleteUser(userID, false); } finally Loading @@ -471,7 +470,7 @@ public class LdapUserPersistence extends LdapPersistence implements UserPersiste LdapConnections conns = new LdapConnections(this); try { userDAO = getLdapUserDao(conns); userDAO = new LdapUserDAO(conns); userDAO.deleteUserRequest(userID); } finally Loading @@ -498,7 +497,7 @@ public class LdapUserPersistence extends LdapPersistence implements UserPersiste LdapConnections conns = new LdapConnections(this); try { userDAO = getLdapUserDao(conns); userDAO = new LdapUserDAO(conns); return userDAO.doLogin(userID, password); } finally Loading @@ -510,11 +509,7 @@ public class LdapUserPersistence extends LdapPersistence implements UserPersiste /** * Update a user's password. The given user and authenticating user must match. * <<<<<<< HEAD * @param userID the user. ======= * @param userID >>>>>>> efc84b5d25584bd3014fc6cbc820c5acf0d90a2a * @param oldPassword current password. * @param newPassword new password. * @throws UserNotFoundException If the given user does not exist. Loading @@ -532,7 +527,7 @@ public class LdapUserPersistence extends LdapPersistence implements UserPersiste LdapConnections conns = new LdapConnections(this); try { userDAO = getLdapUserDao(conns); userDAO = new LdapUserDAO(conns); if (userDAO.doLogin(userID.getName(), oldPassword)) { // oldPassword is correct Loading @@ -548,11 +543,7 @@ public class LdapUserPersistence extends LdapPersistence implements UserPersiste /** * Reset a user's password. The given user and authenticating user must match. * <<<<<<< HEAD * @param userID The user. ======= * @param userID >>>>>>> efc84b5d25584bd3014fc6cbc820c5acf0d90a2a * @param newPassword new password. * @throws UserNotFoundException If the given user does not exist. * @throws TransientException If an temporary, unexpected problem occurred. Loading @@ -569,7 +560,7 @@ public class LdapUserPersistence extends LdapPersistence implements UserPersiste LdapConnections conns = new LdapConnections(this); try { userDAO = getLdapUserDao(conns); userDAO = new LdapUserDAO(conns); User user = getUser(userID); if (user != null) Loading Loading @@ -613,23 +604,4 @@ public class LdapUserPersistence extends LdapPersistence implements UserPersiste return false; } private LdapUserDAO getLdapUserDao(LdapConnections conn) { LdapUserDAO dao = new LdapUserDAO(conn); if (getInternalIdUriPrefix() != null) dao.setInternalIdUriPrefix(getInternalIdUriPrefix()); return dao; } /** * Web services can override this method to change * the user prefix used in the internal ID. * * By default the LdapUserDAO will use AC.USER_URI; */ protected String getInternalIdUriPrefix() { return null; } } cadcAccessControl-Server/src/ca/nrc/cadc/ac/server/web/WhoAmIServlet.java +8 −2 Original line number Diff line number Diff line Loading @@ -81,10 +81,10 @@ import javax.servlet.http.HttpServletResponse; import org.apache.log4j.Logger; import ca.nrc.cadc.ac.AC; import ca.nrc.cadc.auth.AuthenticationUtil; import ca.nrc.cadc.auth.HttpPrincipal; import ca.nrc.cadc.log.ServletLogInfo; import ca.nrc.cadc.reg.client.LocalAuthority; import ca.nrc.cadc.reg.client.RegistryClient; /** Loading Loading @@ -164,9 +164,15 @@ public class WhoAmIServlet extends HttpServlet final String scheme) throws IOException { final RegistryClient registryClient = getRegistryClient(); LocalAuthority localAuthority = new LocalAuthority(); URI umsServiceURI = localAuthority.getServiceURI("ums"); log.debug("ums service uri: " + umsServiceURI); final URL redirectURL = registryClient.getServiceURL( URI.create(AC.UMS_SERVICE_URI + "#users"), scheme, USER_GET_PATH); URI.create(umsServiceURI.toString() + "#users"), scheme, USER_GET_PATH); // Take the first one. final String redirectUrl = Loading cadcAccessControl-Server/test/src/ca/nrc/cadc/ac/server/web/WhoAmIServletTest.java +5 −2 Original line number Diff line number Diff line Loading @@ -84,8 +84,8 @@ import javax.servlet.http.HttpServletResponse; import org.junit.Test; import ca.nrc.cadc.ac.AC; import ca.nrc.cadc.auth.HttpPrincipal; import ca.nrc.cadc.reg.client.LocalAuthority; import ca.nrc.cadc.reg.client.RegistryClient; Loading Loading @@ -132,7 +132,10 @@ public class WhoAmIServletTest mockResponse.sendRedirect("/ac/users/CADCtest?idType=HTTP"); expectLastCall().once(); expect(mockRegistry.getServiceURL(URI.create(AC.UMS_SERVICE_URI + "#users"), LocalAuthority localAuthority = new LocalAuthority(); URI umsServiceURI = localAuthority.getServiceURI("ums"); expect(mockRegistry.getServiceURL(URI.create(umsServiceURI.toString() + "#users"), "http", "/%s?idType=HTTP")). andReturn(new URL("http://mysite.com/ac/users/CADCtest?idType=HTTP")).once(); Loading Loading
cadcAccessControl-Server/build.xml +3 −0 Original line number Diff line number Diff line Loading @@ -115,6 +115,9 @@ <mkdir dir="${user.home}/config" /> <copy overwrite="true" file="test/LdapConfig.test.properties" todir="${user.home}/config/"/> <copy overwrite="true" file="${env.CADC_PREFIX}/etc/LocalAuthority.properties" tofile="${build}/class/LocalAuthority.properties"/> </target> <!-- JAR files needed to run the test suite --> Loading
cadcAccessControl-Server/src/ca/nrc/cadc/ac/server/ldap/LdapUserDAO.java +8 −12 Original line number Diff line number Diff line Loading @@ -86,7 +86,6 @@ import javax.security.auth.x500.X500Principal; import org.apache.log4j.Logger; import ca.nrc.cadc.ac.AC; import ca.nrc.cadc.ac.Group; import ca.nrc.cadc.ac.InternalID; import ca.nrc.cadc.ac.PersonalDetails; Loading @@ -101,6 +100,7 @@ import ca.nrc.cadc.auth.HttpPrincipal; import ca.nrc.cadc.auth.NumericPrincipal; import ca.nrc.cadc.net.TransientException; import ca.nrc.cadc.profiler.Profiler; import ca.nrc.cadc.reg.client.LocalAuthority; import ca.nrc.cadc.util.ObjectUtil; import ca.nrc.cadc.util.StringUtil; Loading Loading @@ -140,8 +140,6 @@ public class LdapUserDAO extends LdapDAO private static final Logger logger = Logger.getLogger(LdapUserDAO.class); private String internalIdUriPrefix = AC.USER_URI; // Map of identity type to LDAP attribute private final Map<Class<?>, String> userLdapAttrib = new HashMap<Class<?>, String>(); Loading Loading @@ -740,7 +738,10 @@ public class LdapUserDAO extends LdapDAO user.getIdentities().add(new DNPrincipal(searchResult.getAttributeValue(LDAP_ENTRYDN))); // cache memberOf values in the user GroupMemberships gms = new GroupMemberships(userID); LocalAuthority localAuthority = new LocalAuthority(); URI gmsServiceURI = localAuthority.getServiceURI("gms"); GroupMemberships gms = new GroupMemberships(gmsServiceURI.toString(), userID); user.appData = gms; // add even if empty String[] mems = searchResult.getAttributeValues(LDAP_MEMBEROF); if (mems != null && mems.length > 0) Loading Loading @@ -926,8 +927,6 @@ public class LdapUserDAO extends LdapDAO public User modifyUser(final User user) throws UserNotFoundException, TransientException, AccessControlException { // Will we always have a HttpPrincipal? User existingUser = getUser(user.getHttpPrincipal()); List<Modification> mods = new ArrayList<Modification>(); Loading Loading @@ -1274,15 +1273,12 @@ public class LdapUserDAO extends LdapDAO return uuid.getLeastSignificantBits(); } protected void setInternalIdUriPrefix(String internalIdUriPrefix) { this.internalIdUriPrefix = internalIdUriPrefix; } protected InternalID getInternalID(String numericID) { UUID uuid = new UUID(0L, Long.parseLong(numericID)); String uriString = internalIdUriPrefix + "?" + uuid.toString(); LocalAuthority localAuthority = new LocalAuthority(); URI umsServiceURI = localAuthority.getServiceURI("ums"); String uriString = umsServiceURI.toString() + "?" + uuid.toString(); URI uri; try { Loading
cadcAccessControl-Server/src/ca/nrc/cadc/ac/server/ldap/LdapUserPersistence.java +17 −45 Original line number Diff line number Diff line Loading @@ -121,7 +121,7 @@ public class LdapUserPersistence extends LdapPersistence implements UserPersiste LdapConnections conns = new LdapConnections(this); try { userDAO = getLdapUserDao(conns); userDAO = new LdapUserDAO(conns); userDAO.addUser(user); } finally Loading @@ -146,7 +146,7 @@ public class LdapUserPersistence extends LdapPersistence implements UserPersiste LdapConnections conns = new LdapConnections(this); try { userDAO = getLdapUserDao(conns); userDAO = new LdapUserDAO(conns); userDAO.addUserRequest(userRequest); } finally Loading Loading @@ -177,7 +177,7 @@ public class LdapUserPersistence extends LdapPersistence implements UserPersiste LdapConnections conns = new LdapConnections(this); try { userDAO = getLdapUserDao(conns); userDAO = new LdapUserDAO(conns); return userDAO.getUser(userID); } finally Loading Loading @@ -205,7 +205,7 @@ public class LdapUserPersistence extends LdapPersistence implements UserPersiste LdapConnections conns = new LdapConnections(this); try { LdapUserDAO userDAO = getLdapUserDao(conns); LdapUserDAO userDAO = new LdapUserDAO(conns); return userDAO.getUserByEmailAddress(emailAddress); } finally Loading Loading @@ -234,7 +234,7 @@ public class LdapUserPersistence extends LdapPersistence implements UserPersiste LdapConnections conns = new LdapConnections(this); try { userDAO = getLdapUserDao(conns); userDAO = new LdapUserDAO(conns); return userDAO.getUserRequest(userID); } finally Loading @@ -243,8 +243,7 @@ public class LdapUserPersistence extends LdapPersistence implements UserPersiste } } /**<<<<<<< HEAD /** * Get the user specified by userID with all of the users identities. * * @param userID The userID. Loading @@ -264,7 +263,7 @@ public class LdapUserPersistence extends LdapPersistence implements UserPersiste try { Profiler profiler = new Profiler(LdapUserPersistence.class); userDAO = getLdapUserDao(conns); userDAO = new LdapUserDAO(conns); profiler.checkpoint("Create LdapUserDAO"); User user = userDAO.getAugmentedUser(userID); profiler.checkpoint("getAugmentedUser"); Loading Loading @@ -299,7 +298,7 @@ public class LdapUserPersistence extends LdapPersistence implements UserPersiste LdapConnections conns = new LdapConnections(this); try { userDAO = getLdapUserDao(conns); userDAO = new LdapUserDAO(conns); return userDAO.getUsers(); } finally Loading @@ -323,7 +322,7 @@ public class LdapUserPersistence extends LdapPersistence implements UserPersiste LdapConnections conns = new LdapConnections(this); try { userDAO = getLdapUserDao(conns); userDAO = new LdapUserDAO(conns); return userDAO.getUserRequests(); } finally Loading Loading @@ -353,7 +352,7 @@ public class LdapUserPersistence extends LdapPersistence implements UserPersiste LdapConnections conns = new LdapConnections(this); try { userDAO = getLdapUserDao(conns); userDAO = new LdapUserDAO(conns); return userDAO.approveUserRequest(userID); } finally Loading Loading @@ -385,7 +384,7 @@ public class LdapUserPersistence extends LdapPersistence implements UserPersiste LdapConnections conns = new LdapConnections(this); try { userDAO = getLdapUserDao(conns); userDAO = new LdapUserDAO(conns); return userDAO.modifyUser(user); } finally Loading Loading @@ -415,7 +414,7 @@ public class LdapUserPersistence extends LdapPersistence implements UserPersiste LdapConnections conns = new LdapConnections(this); try { userDAO = getLdapUserDao(conns); userDAO = new LdapUserDAO(conns); userDAO.deleteUser(userID, true); } finally Loading Loading @@ -444,7 +443,7 @@ public class LdapUserPersistence extends LdapPersistence implements UserPersiste LdapConnections conns = new LdapConnections(this); try { userDAO = getLdapUserDao(conns); userDAO = new LdapUserDAO(conns); userDAO.deleteUser(userID, false); } finally Loading @@ -471,7 +470,7 @@ public class LdapUserPersistence extends LdapPersistence implements UserPersiste LdapConnections conns = new LdapConnections(this); try { userDAO = getLdapUserDao(conns); userDAO = new LdapUserDAO(conns); userDAO.deleteUserRequest(userID); } finally Loading @@ -498,7 +497,7 @@ public class LdapUserPersistence extends LdapPersistence implements UserPersiste LdapConnections conns = new LdapConnections(this); try { userDAO = getLdapUserDao(conns); userDAO = new LdapUserDAO(conns); return userDAO.doLogin(userID, password); } finally Loading @@ -510,11 +509,7 @@ public class LdapUserPersistence extends LdapPersistence implements UserPersiste /** * Update a user's password. The given user and authenticating user must match. * <<<<<<< HEAD * @param userID the user. ======= * @param userID >>>>>>> efc84b5d25584bd3014fc6cbc820c5acf0d90a2a * @param oldPassword current password. * @param newPassword new password. * @throws UserNotFoundException If the given user does not exist. Loading @@ -532,7 +527,7 @@ public class LdapUserPersistence extends LdapPersistence implements UserPersiste LdapConnections conns = new LdapConnections(this); try { userDAO = getLdapUserDao(conns); userDAO = new LdapUserDAO(conns); if (userDAO.doLogin(userID.getName(), oldPassword)) { // oldPassword is correct Loading @@ -548,11 +543,7 @@ public class LdapUserPersistence extends LdapPersistence implements UserPersiste /** * Reset a user's password. The given user and authenticating user must match. * <<<<<<< HEAD * @param userID The user. ======= * @param userID >>>>>>> efc84b5d25584bd3014fc6cbc820c5acf0d90a2a * @param newPassword new password. * @throws UserNotFoundException If the given user does not exist. * @throws TransientException If an temporary, unexpected problem occurred. Loading @@ -569,7 +560,7 @@ public class LdapUserPersistence extends LdapPersistence implements UserPersiste LdapConnections conns = new LdapConnections(this); try { userDAO = getLdapUserDao(conns); userDAO = new LdapUserDAO(conns); User user = getUser(userID); if (user != null) Loading Loading @@ -613,23 +604,4 @@ public class LdapUserPersistence extends LdapPersistence implements UserPersiste return false; } private LdapUserDAO getLdapUserDao(LdapConnections conn) { LdapUserDAO dao = new LdapUserDAO(conn); if (getInternalIdUriPrefix() != null) dao.setInternalIdUriPrefix(getInternalIdUriPrefix()); return dao; } /** * Web services can override this method to change * the user prefix used in the internal ID. * * By default the LdapUserDAO will use AC.USER_URI; */ protected String getInternalIdUriPrefix() { return null; } }
cadcAccessControl-Server/src/ca/nrc/cadc/ac/server/web/WhoAmIServlet.java +8 −2 Original line number Diff line number Diff line Loading @@ -81,10 +81,10 @@ import javax.servlet.http.HttpServletResponse; import org.apache.log4j.Logger; import ca.nrc.cadc.ac.AC; import ca.nrc.cadc.auth.AuthenticationUtil; import ca.nrc.cadc.auth.HttpPrincipal; import ca.nrc.cadc.log.ServletLogInfo; import ca.nrc.cadc.reg.client.LocalAuthority; import ca.nrc.cadc.reg.client.RegistryClient; /** Loading Loading @@ -164,9 +164,15 @@ public class WhoAmIServlet extends HttpServlet final String scheme) throws IOException { final RegistryClient registryClient = getRegistryClient(); LocalAuthority localAuthority = new LocalAuthority(); URI umsServiceURI = localAuthority.getServiceURI("ums"); log.debug("ums service uri: " + umsServiceURI); final URL redirectURL = registryClient.getServiceURL( URI.create(AC.UMS_SERVICE_URI + "#users"), scheme, USER_GET_PATH); URI.create(umsServiceURI.toString() + "#users"), scheme, USER_GET_PATH); // Take the first one. final String redirectUrl = Loading
cadcAccessControl-Server/test/src/ca/nrc/cadc/ac/server/web/WhoAmIServletTest.java +5 −2 Original line number Diff line number Diff line Loading @@ -84,8 +84,8 @@ import javax.servlet.http.HttpServletResponse; import org.junit.Test; import ca.nrc.cadc.ac.AC; import ca.nrc.cadc.auth.HttpPrincipal; import ca.nrc.cadc.reg.client.LocalAuthority; import ca.nrc.cadc.reg.client.RegistryClient; Loading Loading @@ -132,7 +132,10 @@ public class WhoAmIServletTest mockResponse.sendRedirect("/ac/users/CADCtest?idType=HTTP"); expectLastCall().once(); expect(mockRegistry.getServiceURL(URI.create(AC.UMS_SERVICE_URI + "#users"), LocalAuthority localAuthority = new LocalAuthority(); URI umsServiceURI = localAuthority.getServiceURI("ums"); expect(mockRegistry.getServiceURL(URI.create(umsServiceURI.toString() + "#users"), "http", "/%s?idType=HTTP")). andReturn(new URL("http://mysite.com/ac/users/CADCtest?idType=HTTP")).once(); Loading