Search in sources :

Example 6 with EmailLinkParser

use of com.firebase.ui.auth.util.data.EmailLinkParser in project FirebaseUI-Android by firebase.

the class EmailLinkParserTest method testGetters_encodedLink.

@Test
public void testGetters_encodedLink() {
    EmailLinkParser parser = new EmailLinkParser(ENCODED_EMAIL_LINK);
    assertThat(parser.getOobCode()).isEqualTo(OOB_CODE);
    assertThat(parser.getSessionId()).isEqualTo(SESSION_ID);
    assertThat(parser.getAnonymousUserId()).isEqualTo(ANONYMOUS_USER_ID);
    assertThat(parser.getProviderId()).isEqualTo(PROVIDER_ID);
    assertThat(parser.getForceSameDeviceBit()).isEqualTo(FORCE_SAME_DEVICE);
}
Also used : EmailLinkParser(com.firebase.ui.auth.util.data.EmailLinkParser) Test(org.junit.Test)

Example 7 with EmailLinkParser

use of com.firebase.ui.auth.util.data.EmailLinkParser in project FirebaseUI-Android by firebase.

the class ContinueUrlBuilderTest method testAppendParams_decodedLink_expectSuccess.

@Test
public void testAppendParams_decodedLink_expectSuccess() {
    String continueUrlBuilder = new ContinueUrlBuilder(DECODED_EMAIL_LINK).appendSessionId(SESSION_ID).appendAnonymousUserId(ANONYMOUS_USER_ID).appendProviderId(PROVIDER_ID).appendForceSameDeviceBit(FORCE_SAME_DEVICE).build();
    EmailLinkParser parser = new EmailLinkParser(continueUrlBuilder);
    assertThat(parser.getSessionId()).isEqualTo(SESSION_ID);
    assertThat(parser.getAnonymousUserId()).isEqualTo(ANONYMOUS_USER_ID);
    assertThat(parser.getProviderId()).isEqualTo(PROVIDER_ID);
    assertThat(parser.getForceSameDeviceBit()).isEqualTo(FORCE_SAME_DEVICE);
}
Also used : ContinueUrlBuilder(com.firebase.ui.auth.util.data.ContinueUrlBuilder) EmailLinkParser(com.firebase.ui.auth.util.data.EmailLinkParser) Test(org.junit.Test)

Example 8 with EmailLinkParser

use of com.firebase.ui.auth.util.data.EmailLinkParser in project FirebaseUI-Android by firebase.

the class EmailLinkParserTest method testGetters_noContinueUrlParams.

@Test
public void testGetters_noContinueUrlParams() {
    String encodedLink = ENCODED_EMAIL_LINK.substring(0, ENCODED_EMAIL_LINK.length() - CONTINUE_URL.length());
    EmailLinkParser parser = new EmailLinkParser(encodedLink);
    assertThat(parser.getOobCode()).isEqualTo(OOB_CODE);
    assertThat(parser.getSessionId()).isNull();
    assertThat(parser.getAnonymousUserId()).isNull();
    assertThat(parser.getProviderId()).isNull();
    assertThat(parser.getForceSameDeviceBit()).isFalse();
}
Also used : EmailLinkParser(com.firebase.ui.auth.util.data.EmailLinkParser) Test(org.junit.Test)

Aggregations

EmailLinkParser (com.firebase.ui.auth.util.data.EmailLinkParser)8 Test (org.junit.Test)5 ContinueUrlBuilder (com.firebase.ui.auth.util.data.ContinueUrlBuilder)2 SuppressLint (android.annotation.SuppressLint)1 SpannableStringBuilder (android.text.SpannableStringBuilder)1 TextView (android.widget.TextView)1 FirebaseUiException (com.firebase.ui.auth.FirebaseUiException)1 EmailLinkPersistenceManager (com.firebase.ui.auth.util.data.EmailLinkPersistenceManager)1 SessionRecord (com.firebase.ui.auth.util.data.EmailLinkPersistenceManager.SessionRecord)1