parent
10c1e3ba6d
commit
de5aa2e74d
2 changed files with 17 additions and 0 deletions
|
@ -268,6 +268,7 @@ public class UserResource {
|
||||||
|
|
||||||
if (rep.isEnabled() != null) user.setEnabled(rep.isEnabled());
|
if (rep.isEnabled() != null) user.setEnabled(rep.isEnabled());
|
||||||
if (rep.isEmailVerified() != null) user.setEmailVerified(rep.isEmailVerified());
|
if (rep.isEmailVerified() != null) user.setEmailVerified(rep.isEmailVerified());
|
||||||
|
if (rep.getCreatedTimestamp() != null && !isUpdateExistingUser) user.setCreatedTimestamp(rep.getCreatedTimestamp());
|
||||||
|
|
||||||
if (rep.getFederationLink() != null) user.setFederationLink(rep.getFederationLink());
|
if (rep.getFederationLink() != null) user.setFederationLink(rep.getFederationLink());
|
||||||
|
|
||||||
|
|
|
@ -645,6 +645,22 @@ public class UserTest extends AbstractAdminTest {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void createUserWithCreateTimestamp() {
|
||||||
|
UserRepresentation user = new UserRepresentation();
|
||||||
|
user.setUsername("user1");
|
||||||
|
user.setEmail("user1@localhost");
|
||||||
|
Long createdTimestamp = 1695238476L;
|
||||||
|
user.setCreatedTimestamp(createdTimestamp);
|
||||||
|
|
||||||
|
String userId = createUser(user);
|
||||||
|
|
||||||
|
// fetch user again and see created timestamp filled in
|
||||||
|
UserRepresentation createdUser = realm.users().get(userId).toRepresentation();
|
||||||
|
assertNotNull(createdUser);
|
||||||
|
assertEquals(user.getCreatedTimestamp(), createdUser.getCreatedTimestamp());
|
||||||
|
}
|
||||||
|
|
||||||
private List<String> createUsers() {
|
private List<String> createUsers() {
|
||||||
List<String> ids = new ArrayList<>();
|
List<String> ids = new ArrayList<>();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue