@Test public void testSignInWithEmailAndPassword_NotSuccessful() { mockNotSuccessfulResult(new IllegalStateException()); when(mockFirebaseAuth.signInWithEmailAndPassword("email", "password")) .thenReturn(mockAuthResultTask); TestObserver<FirebaseUser> obs = TestObserver.create(); RxFirebaseAuth .signInWithEmailAndPassword(mockFirebaseAuth, "email", "password") .subscribe(obs); callOnComplete(mockAuthResultTask); obs.dispose(); callOnComplete(mockAuthResultTask); obs.assertError(IllegalStateException.class); obs.assertNoValues(); }
@CheckReturnValue @NonNull public static Single<FirebaseUser> signInWithEmailAndPassword( @NonNull final FirebaseAuth instance, @NonNull final String email, @NonNull final String password) { return RxTask.single(new Callable<Task<AuthResult>>() { @Override public Task<AuthResult> call() throws Exception { return instance.signInWithEmailAndPassword(email, password); } }).map(authToUserFunction()); }
RxFirebaseAuth { @CheckReturnValue @NonNull public static Single<FirebaseUser> signInWithEmailAndPassword( @NonNull final FirebaseAuth instance, @NonNull final String email, @NonNull final String password) { return RxTask.single(new Callable<Task<AuthResult>>() { @Override public Task<AuthResult> call() throws Exception { return instance.signInWithEmailAndPassword(email, password); } }).map(authToUserFunction()); } }
RxFirebaseAuth { @CheckReturnValue @NonNull public static Single<FirebaseUser> signInWithEmailAndPassword( @NonNull final FirebaseAuth instance, @NonNull final String email, @NonNull final String password) { return RxTask.single(new Callable<Task<AuthResult>>() { @Override public Task<AuthResult> call() throws Exception { return instance.signInWithEmailAndPassword(email, password); } }).map(authToUserFunction()); } private  RxFirebaseAuth(); }
RxFirebaseAuth { @CheckReturnValue @NonNull public static Single<FirebaseUser> signInWithEmailAndPassword( @NonNull final FirebaseAuth instance, @NonNull final String email, @NonNull final String password) { return RxTask.single(new Callable<Task<AuthResult>>() { @Override public Task<AuthResult> call() throws Exception { return instance.signInWithEmailAndPassword(email, password); } }).map(authToUserFunction()); } private  RxFirebaseAuth(); @CheckReturnValue @NonNull static Observable<FirebaseAuth> changes(@NonNull FirebaseAuth instance); @CheckReturnValue @NonNull static Single<FirebaseUser> createUserWithEmailAndPassword(
            @NonNull final FirebaseAuth instance,
            @NonNull final String email, @NonNull final String password); @CheckReturnValue @NonNull static Single<List<String>> fetchProvidersForEmail(
            @NonNull final FirebaseAuth instance, @NonNull final String email); @CheckReturnValue @NonNull static Maybe<FirebaseUser> getCurrentUser(
            @NonNull final FirebaseAuth instance); @CheckReturnValue @NonNull static Completable sendPasswordResetEmail(
            @NonNull final FirebaseAuth instance, @NonNull final String email); @CheckReturnValue @NonNull static Single<FirebaseUser> signInAnonymous(
            @NonNull final FirebaseAuth instance); @CheckReturnValue @NonNull static Function<AuthResult, FirebaseUser> authToUserFunction(); @CheckReturnValue @NonNull static Single<FirebaseUser> signInWithCredential(
            @NonNull final FirebaseAuth instance, @NonNull final AuthCredential credential); @CheckReturnValue @NonNull static Single<FirebaseUser> signInWithCustomToken(
            @NonNull final FirebaseAuth instance, @NonNull final String token); @CheckReturnValue @NonNull static Single<FirebaseUser> signInWithEmailAndPassword(
            @NonNull final FirebaseAuth instance,
            @NonNull final String email, @NonNull final String password); @CheckReturnValue @NonNull static Completable signOut(@NonNull final FirebaseAuth instance); }
RxFirebaseAuth { @CheckReturnValue @NonNull public static Single<FirebaseUser> signInWithEmailAndPassword( @NonNull final FirebaseAuth instance, @NonNull final String email, @NonNull final String password) { return RxTask.single(new Callable<Task<AuthResult>>() { @Override public Task<AuthResult> call() throws Exception { return instance.signInWithEmailAndPassword(email, password); } }).map(authToUserFunction()); } private  RxFirebaseAuth(); @CheckReturnValue @NonNull static Observable<FirebaseAuth> changes(@NonNull FirebaseAuth instance); @CheckReturnValue @NonNull static Single<FirebaseUser> createUserWithEmailAndPassword(
            @NonNull final FirebaseAuth instance,
            @NonNull final String email, @NonNull final String password); @CheckReturnValue @NonNull static Single<List<String>> fetchProvidersForEmail(
            @NonNull final FirebaseAuth instance, @NonNull final String email); @CheckReturnValue @NonNull static Maybe<FirebaseUser> getCurrentUser(
            @NonNull final FirebaseAuth instance); @CheckReturnValue @NonNull static Completable sendPasswordResetEmail(
            @NonNull final FirebaseAuth instance, @NonNull final String email); @CheckReturnValue @NonNull static Single<FirebaseUser> signInAnonymous(
            @NonNull final FirebaseAuth instance); @CheckReturnValue @NonNull static Function<AuthResult, FirebaseUser> authToUserFunction(); @CheckReturnValue @NonNull static Single<FirebaseUser> signInWithCredential(
            @NonNull final FirebaseAuth instance, @NonNull final AuthCredential credential); @CheckReturnValue @NonNull static Single<FirebaseUser> signInWithCustomToken(
            @NonNull final FirebaseAuth instance, @NonNull final String token); @CheckReturnValue @NonNull static Single<FirebaseUser> signInWithEmailAndPassword(
            @NonNull final FirebaseAuth instance,
            @NonNull final String email, @NonNull final String password); @CheckReturnValue @NonNull static Completable signOut(@NonNull final FirebaseAuth instance);  }