Java 类com.google.firebase.auth.ActionCodeResult 实例源码

项目:Rx2Firebase    文件:RxFirebaseAuthTest.java   
@Test
public void checkActionCode() throws InterruptedException {

   TestObserver<ActionCodeResult> authTestObserver = RxFirebaseAuth
      .checkActionCode(firebaseAuth, ANY_CODE)
      .test();

   testOnSuccessListener.getValue().onSuccess(actionCodeResult);
   testOnCompleteListener.getValue().onComplete(actionCodeResultTask);

   verify(firebaseAuth).checkActionCode(eq(ANY_CODE));

   authTestObserver.assertNoErrors()
      .assertValueCount(1)
      .assertValueSet(Collections.singletonList(actionCodeResult))
      .assertComplete()
      .dispose();
}
项目:showcase-android    文件:RxFirebaseAuth.java   
/**
 * Checks that the code given is valid. This code will have been generated
 * by {@link FirebaseAuth#sendPasswordResetEmail(String)} or {@link com.google.firebase.auth.FirebaseUser#sendEmailVerification()} valid for a single use.
 *
 * @param firebaseAuth firebaseAuth instance.
 * @param code         generated code by firebase.
 * @return a {@link Maybe} which emits when the action is completed.
 */
@NonNull
public static Maybe<ActionCodeResult> checkActionCode(@NonNull final FirebaseAuth firebaseAuth,
                                                      @NonNull final String code) {
   return Maybe.create(new MaybeOnSubscribe<ActionCodeResult>() {
      @Override
      public void subscribe(MaybeEmitter<ActionCodeResult> emitter) throws Exception {
         RxHandler.assignOnTask(emitter, firebaseAuth.checkActionCode(code));
      }
   });
}
项目:Rx2Firebase    文件:RxFirebaseAuth.java   
/**
 * Checks that the code given is valid. This code will have been generated
 * by {@link FirebaseAuth#sendPasswordResetEmail(String)} or {@link com.google.firebase.auth.FirebaseUser#sendEmailVerification()} valid for a single use.
 *
 * @param firebaseAuth firebaseAuth instance.
 * @param code         generated code by firebase.
 * @return a {@link Maybe} which emits when the action is completed.
 */
@NonNull
public static Maybe<ActionCodeResult> checkActionCode(@NonNull final FirebaseAuth firebaseAuth,
                                                      @NonNull final String code) {
   return Maybe.create(new MaybeOnSubscribe<ActionCodeResult>() {
      @Override
      public void subscribe(MaybeEmitter<ActionCodeResult> emitter) throws Exception {
         RxHandler.assignOnTask(emitter, firebaseAuth.checkActionCode(code));
      }
   });
}
项目:RxFirebase2    文件:CheckActionCodeOnSubscribe.java   
@Override public void subscribe(SingleEmitter<ActionCodeResult> emitter) {
  if (!emitter.isDisposed()) {
    instance.checkActionCode(code).addOnCompleteListener(GmsTaskListeners.listener(emitter));
  }
}
项目:RxFirebase2    文件:RxFirebaseAuth.java   
/**
 * @see FirebaseAuth#checkActionCode(String)
 */
@CheckResult @NonNull public static Single<ActionCodeResult> checkActionCode(
    @NonNull FirebaseAuth instance, @NonNull String code) {
  return Single.create(new CheckActionCodeOnSubscribe(instance, code));
}
项目:RxFirebase2    文件:RxFirebaseAuthTest.java   
@Test public void testCheckActionCode_NotSuccessful() {
  mockNotSuccessfulResultForTask(mockActionCodeResultTask, new IllegalStateException());

  when(mockFirebaseAuth.checkActionCode("code")).thenReturn(mockActionCodeResultTask);

  TestObserver<ActionCodeResult> obs = TestObserver.create();

  RxFirebaseAuth.checkActionCode(mockFirebaseAuth, "code").subscribe(obs);

  callOnComplete(mockActionCodeResultTask);
  obs.dispose();

  // Ensure no more values are emitted after unsubscribe
  callOnComplete(mockActionCodeResultTask);

  obs.assertError(IllegalStateException.class);
  obs.assertNoValues();
}
项目:sprockets-android    文件:FirebaseAuthProxy.java   
@Override
public Task<ActionCodeResult> checkActionCode(String code) {
    return mAuth.checkActionCode(code);
}
项目:sprockets-android    文件:Auth.java   
Task<ActionCodeResult> checkActionCode(String code);