-
Notifications
You must be signed in to change notification settings - Fork 275
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Update tests for getting and deleting provider uid via phone n…
…umber and email.
- Loading branch information
1 parent
af8eed9
commit 455c241
Showing
1 changed file
with
10 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -402,19 +402,23 @@ public void testGetUserByProviderUidWithPhone() throws Exception { | |
TestResponseInterceptor interceptor = initializeAppForUserManagement( | ||
TestUtils.loadResource("getUser.json")); | ||
UserRecord userRecord = FirebaseAuth.getInstance() | ||
.getUserByProviderUidAsync("phone", "+1234567890").get(); | ||
.getUserByProviderUidAsync(new String("phone"), "+1234567890").get(); | ||
checkUserRecord(userRecord); | ||
checkRequestHeaders(interceptor); | ||
GenericJson parsed = parseRequestContent(interceptor); | ||
assertEquals(ImmutableList.of("+1234567890"), parsed.get("phoneNumber")); | ||
} | ||
|
||
@Test | ||
public void testGetUserByProviderUidWithEmail() throws Exception { | ||
TestResponseInterceptor interceptor = initializeAppForUserManagement( | ||
TestUtils.loadResource("getUser.json")); | ||
UserRecord userRecord = FirebaseAuth.getInstance() | ||
.getUserByProviderUidAsync("email", "[email protected]").get(); | ||
.getUserByProviderUidAsync(new String("email"), "[email protected]").get(); | ||
checkUserRecord(userRecord); | ||
checkRequestHeaders(interceptor); | ||
GenericJson parsed = parseRequestContent(interceptor); | ||
assertEquals(ImmutableList.of("[email protected]"), parsed.get("email")); | ||
} | ||
|
||
@Test | ||
|
@@ -1248,20 +1252,22 @@ public void testDeleteProviderAndPhone() { | |
|
||
@Test | ||
public void testDoubleDeletePhoneProvider() throws Exception { | ||
String providerId = new String("phone"); | ||
UserRecord.UpdateRequest update = new UserRecord.UpdateRequest("uid") | ||
.setPhoneNumber(null); | ||
|
||
try { | ||
update.setProvidersToUnlink(ImmutableList.of("phone")); | ||
update.setProvidersToUnlink(ImmutableList.of(providerId)); | ||
fail("No error thrown for double delete phone provider"); | ||
} catch (IllegalArgumentException expected) { | ||
} | ||
} | ||
|
||
@Test | ||
public void testDoubleDeletePhoneProviderReverseOrder() throws Exception { | ||
String providerId = new String("phone"); | ||
UserRecord.UpdateRequest update = new UserRecord.UpdateRequest("uid") | ||
.setProvidersToUnlink(ImmutableList.of("phone")); | ||
.setProvidersToUnlink(ImmutableList.of(providerId)); | ||
|
||
try { | ||
update.setPhoneNumber(null); | ||
|