KEYCLOAK-1857 Prefill update profile form with username from user or formdata

This commit is contained in:
Stian Thorgersen 2015-09-22 08:46:02 +02:00
parent 43541d3028
commit 9d8d690100
2 changed files with 3 additions and 1 deletions

View file

@ -70,6 +70,8 @@ public class ProfileBean {
}
public String getUsername() { return formData != null ? formData.getFirst("username") : user.getUsername(); }
public String getFirstName() {
return formData != null ? formData.getFirst("firstName") : user.getFirstName();
}

View file

@ -263,7 +263,7 @@ public class RequiredActionUpdateProfileTest {
Assert.assertEquals("New first", updateProfilePage.getFirstName());
Assert.assertEquals("New last", updateProfilePage.getLastName());
Assert.assertEquals("new@email.com", updateProfilePage.getEmail());
Assert.assertEquals("", updateProfilePage.getUsername());
Assert.assertEquals("test-user@localhost", updateProfilePage.getUsername());
Assert.assertEquals("Username already exists.", updateProfilePage.getError());