@Test public void testGetCredentialsUserWithoutPassword() throws Exception { User u = getUserManager(root).createUser("u"+ UUIDUtils.generateUUID(), null); Credentials creds = u.getCredentials(); assertTrue(creds instanceof UserIdCredentials); assertEquals(u.getID(), ((UserIdCredentials) creds).getUserId()); }
@NotNull @Override public Credentials getCredentials() { String pwHash = getPasswordHash(); if (pwHash == null) { return new UserIdCredentials(getID()); } else { return new CredentialsImpl(getID(), pwHash); } }
UserImpl extends AuthorizableImpl implements User { @NotNull @Override public Credentials getCredentials() { String pwHash = getPasswordHash(); if (pwHash == null) { return new UserIdCredentials(getID()); } else { return new CredentialsImpl(getID(), pwHash); } } }
UserImpl extends AuthorizableImpl implements User { @NotNull @Override public Credentials getCredentials() { String pwHash = getPasswordHash(); if (pwHash == null) { return new UserIdCredentials(getID()); } else { return new CredentialsImpl(getID(), pwHash); } } UserImpl(String id, Tree tree, UserManagerImpl userManager); }
UserImpl extends AuthorizableImpl implements User { @NotNull @Override public Credentials getCredentials() { String pwHash = getPasswordHash(); if (pwHash == null) { return new UserIdCredentials(getID()); } else { return new CredentialsImpl(getID(), pwHash); } } UserImpl(String id, Tree tree, UserManagerImpl userManager); @Override boolean isGroup(); @NotNull @Override Principal getPrincipal(); @Override boolean isAdmin(); @Override boolean isSystemUser(); @NotNull @Override Credentials getCredentials(); @NotNull @Override Impersonation getImpersonation(); @Override void changePassword(String password); @Override void changePassword(@Nullable String password, @NotNull String oldPassword); @Override void disable(@Nullable String reason); @Override boolean isDisabled(); @Nullable @Override String getDisabledReason(); }
UserImpl extends AuthorizableImpl implements User { @NotNull @Override public Credentials getCredentials() { String pwHash = getPasswordHash(); if (pwHash == null) { return new UserIdCredentials(getID()); } else { return new CredentialsImpl(getID(), pwHash); } } UserImpl(String id, Tree tree, UserManagerImpl userManager); @Override boolean isGroup(); @NotNull @Override Principal getPrincipal(); @Override boolean isAdmin(); @Override boolean isSystemUser(); @NotNull @Override Credentials getCredentials(); @NotNull @Override Impersonation getImpersonation(); @Override void changePassword(String password); @Override void changePassword(@Nullable String password, @NotNull String oldPassword); @Override void disable(@Nullable String reason); @Override boolean isDisabled(); @Nullable @Override String getDisabledReason();  }