-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Backkward compatiblity for update name old apps
- Loading branch information
Showing
9 changed files
with
43 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,8 +13,7 @@ | |
import java.util.Map; | ||
|
||
import static io.restassured.RestAssured.given; | ||
import static org.junit.Assert.assertEquals; | ||
import static org.junit.Assert.assertNotNull; | ||
import static org.junit.Assert.*; | ||
|
||
public class UserMobileControllerTest extends AbstractIntegrationTest { | ||
|
||
|
@@ -46,7 +45,26 @@ public void updateUserProfile() throws IOException { | |
.then() | ||
.statusCode(201); | ||
User user = userRepository.findUserByEmail("[email protected]").get(); | ||
//There are linked-accounts, so only the chosen name is updated | ||
assertEquals(userNameRequest.getChosenName(), user.getChosenName()); | ||
assertNotEquals(userNameRequest.getGivenName(), user.getGivenName()); | ||
assertNotEquals(userNameRequest.getFamilyName(), user.getFamilyName()); | ||
} | ||
|
||
@Test | ||
public void updateUserProfileNonValidatedAccount() throws IOException { | ||
UpdateUserNameRequest userNameRequest = new UpdateUserNameRequest("Annie", "Anna", "Winters"); | ||
given() | ||
.when() | ||
.accept(ContentType.JSON) | ||
.contentType(ContentType.JSON) | ||
.auth().oauth2(doOpaqueAccessToken(true, new String[]{"eduid.nl/mobile"}, "introspect_no_linked_accounts")) | ||
.body(userNameRequest) | ||
.put("/mobile/api/sp/update") | ||
.then() | ||
.statusCode(201); | ||
User user = userRepository.findUserByEmail("[email protected]").get(); | ||
//There are no linked-accounts, everything is updated | ||
assertEquals(userNameRequest.getChosenName(), user.getChosenName()); | ||
assertEquals(userNameRequest.getGivenName(), user.getGivenName()); | ||
assertEquals(userNameRequest.getFamilyName(), user.getFamilyName()); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters