Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);
Expand Down