Uploaded image for project: 'Jackrabbit Oak'
  1. Jackrabbit Oak
  2. OAK-4219

ExternalLoginModuleTestBase doesn't remove synced User/Group accounts

    XMLWordPrintableJSON

Details

    Description

      Looking at the ExternalLoginModuleTestBase I got the impression that the cleanup of user/group accounts is effectively broken.

      The current code looks as follows:

      • in the before method the list of existing authorizables is collected
      • in the after method the following code is executed:
        UserManager userManager = getUserManager(root);
                    Iterator<Authorizable> iter = userManager.findAuthorizables("jcr:primaryType", null);
                    while (iter.hasNext()) {
                        ids.remove(iter.next().getID());
                    }
                    for (String id : ids) {
                        Authorizable a = userManager.getAuthorizable(id);
                        if (a != null) {
                            a.remove();
                        }
                    }
        

      I might be totally mistaken but IMHO looks troublesome. Introducing an assertion after this verifying that the user with the external-test-id has been removed will actually fail... and I assume that this would have been the expected outcome.

      So, I would have expected the after-method to remove all users/groups except those gather in the before-call, which would be considered built-in to the repository.

      Attachments

        Activity

          People

            angela Angela Schreiber
            angela Angela Schreiber
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: