identityService.deleteUser(user.getId());
}
public void testUpdateUser() {
// First, create a new user
User user = identityService.newUser("johndoe");
user.setFirstName("John");
user.setLastName("Doe");
user.setEmail("johndoe@alfresco.com");
identityService.saveUser(user);
// Fetch and update the user
user = identityService.createUserQuery().userId("johndoe").singleResult();
user.setEmail("updated@alfresco.com");
user.setFirstName("Jane");
user.setLastName("Donnel");
identityService.saveUser(user);
user = identityService.createUserQuery().userId("johndoe").singleResult();
assertEquals("Jane", user.getFirstName());
assertEquals("Donnel", user.getLastName());
assertEquals("updated@alfresco.com", user.getEmail());
identityService.deleteUser(user.getId());
}