Uploaded image for project: 'MyCoRe'
  1. MCR-1885

MCRUserManager.getUsers(attributeName,attributeValue) returns incomplete user data

    Details

    • Type: Bug
    • Status: Closed
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: 2017.06.0, 2018.05
    • Fix Version/s: 2018.06.0
    • Component/s: mycore-user2
    • Labels:
      None

      Description

      The last test will fail, MCRUser user3 has only one attribute, not two:

          @Test
          public final void testGetUserPropertiesAfterGetUsers() {
              MCRUser user = new MCRUser("john");
              user.setRealName("John Doe");
              user.getAttributes().put("id_orcid", "1234-5678-1234-0000");
              user.getAttributes().put("id_scopus", "87654321");
              assertEquals(2, user.getAttributes().size());
      
              MCRUserManager.createUser(user);
              assertEquals(2, user.getAttributes().size());
              
              startNewTransaction();
              MCRUser user2 = MCRUserManager.getUsers("id_orcid","1234-5678-1234-0000").findFirst().get();
              assertEquals("john", user2.getUserName() );
              
              MCRUser user3 = MCRUserManager.getUser( user2.getUserName(), user2.getRealmID() );
              assertEquals(2, user3.getAttributes().size());
          }
      

        Attachments

          Issue links

            Activity

              People

              • Assignee:
                yagee Thomas Scheffler
                Reporter:
                mcrfluet Frank L├╝tzenkirchen
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: