@Test public void testUnlink_notSuccessful() { mockNotSuccessfulAuthResult(new IllegalStateException()); when(mockFirebaseUser.unlink("provider")) .thenReturn(mockAuthTaskResult); TestObserver<FirebaseUser> obs = TestObserver.create(); RxFirebaseUser.unlink(mockFirebaseUser, "provider") .subscribe(obs); callOnComplete(mockAuthTaskResult); obs.dispose(); obs.assertError(IllegalStateException.class); }
@CheckReturnValue @NonNull public static Single<FirebaseUser> unlink( @NonNull final FirebaseUser user, @NonNull final String provider) { return RxTask.single(new Callable<Task<AuthResult>>() { @Override public Task<AuthResult> call() throws Exception { return user.unlink(provider); } }).map(RxFirebaseAuth.authToUserFunction()); }
RxFirebaseUser { @CheckReturnValue @NonNull public static Single<FirebaseUser> unlink( @NonNull final FirebaseUser user, @NonNull final String provider) { return RxTask.single(new Callable<Task<AuthResult>>() { @Override public Task<AuthResult> call() throws Exception { return user.unlink(provider); } }).map(RxFirebaseAuth.authToUserFunction()); } }
RxFirebaseUser { @CheckReturnValue @NonNull public static Single<FirebaseUser> unlink( @NonNull final FirebaseUser user, @NonNull final String provider) { return RxTask.single(new Callable<Task<AuthResult>>() { @Override public Task<AuthResult> call() throws Exception { return user.unlink(provider); } }).map(RxFirebaseAuth.authToUserFunction()); } private  RxFirebaseUser(); }
RxFirebaseUser { @CheckReturnValue @NonNull public static Single<FirebaseUser> unlink( @NonNull final FirebaseUser user, @NonNull final String provider) { return RxTask.single(new Callable<Task<AuthResult>>() { @Override public Task<AuthResult> call() throws Exception { return user.unlink(provider); } }).map(RxFirebaseAuth.authToUserFunction()); } private  RxFirebaseUser(); @CheckReturnValue @NonNull static Completable delete(@NonNull final FirebaseUser user); @CheckReturnValue @NonNull static Single<String> getToken(@NonNull final FirebaseUser user,
                                          final boolean forceRefresh); @CheckReturnValue @NonNull static Single<FirebaseUser> linkWithCredential(
            @NonNull final FirebaseUser user, @NonNull final AuthCredential credential); @CheckReturnValue @NonNull static Completable reauthenticate(
            @NonNull final FirebaseUser user, @NonNull final AuthCredential credential); @CheckReturnValue @NonNull static Completable reload(@NonNull final FirebaseUser user); @CheckReturnValue @NonNull static Completable sendEmailVerification(@NonNull final FirebaseUser user); @CheckReturnValue @NonNull static Single<FirebaseUser> unlink(
            @NonNull final FirebaseUser user, @NonNull final String provider); @CheckReturnValue @NonNull static Completable updateEmail(
            @NonNull final FirebaseUser user, @NonNull final String email); @CheckReturnValue @NonNull static Completable updatePassword(
            @NonNull final FirebaseUser user, @NonNull final String password); @CheckReturnValue @NonNull static Completable updateProfile(
            @NonNull final FirebaseUser user, @NonNull final UserProfileChangeRequest request); }
RxFirebaseUser { @CheckReturnValue @NonNull public static Single<FirebaseUser> unlink( @NonNull final FirebaseUser user, @NonNull final String provider) { return RxTask.single(new Callable<Task<AuthResult>>() { @Override public Task<AuthResult> call() throws Exception { return user.unlink(provider); } }).map(RxFirebaseAuth.authToUserFunction()); } private  RxFirebaseUser(); @CheckReturnValue @NonNull static Completable delete(@NonNull final FirebaseUser user); @CheckReturnValue @NonNull static Single<String> getToken(@NonNull final FirebaseUser user,
                                          final boolean forceRefresh); @CheckReturnValue @NonNull static Single<FirebaseUser> linkWithCredential(
            @NonNull final FirebaseUser user, @NonNull final AuthCredential credential); @CheckReturnValue @NonNull static Completable reauthenticate(
            @NonNull final FirebaseUser user, @NonNull final AuthCredential credential); @CheckReturnValue @NonNull static Completable reload(@NonNull final FirebaseUser user); @CheckReturnValue @NonNull static Completable sendEmailVerification(@NonNull final FirebaseUser user); @CheckReturnValue @NonNull static Single<FirebaseUser> unlink(
            @NonNull final FirebaseUser user, @NonNull final String provider); @CheckReturnValue @NonNull static Completable updateEmail(
            @NonNull final FirebaseUser user, @NonNull final String email); @CheckReturnValue @NonNull static Completable updatePassword(
            @NonNull final FirebaseUser user, @NonNull final String password); @CheckReturnValue @NonNull static Completable updateProfile(
            @NonNull final FirebaseUser user, @NonNull final UserProfileChangeRequest request);  }