Why does my RxJava Observable not complete?
<p>I'm trying to test this observable for a login request, but the subscribers onNext and onCompleted methods are never called.</p>

<pre><code>return mDeviceRepository.getDeviceId()

            .flatMap(new Func1&lt;String, Observable&lt;LoginResponse&gt;&gt;() {
                @Override
                public Observable&lt;LoginResponse&gt; call(String deviceId) {
                    return mAuthRepository.login(deviceId, mUsername, mHashedPassword);
                }
            })

            .flatMap(new Func1&lt;LoginResponse, Observable&lt;LoginResponse&gt;&gt;() {
                @Override
                public Observable&lt;LoginResponse&gt; call(LoginResponse loginResponse) {
                    mSessionRepository.storeSession(UserSession.fromLoginReponse(loginResponse));
                    mUserRepository.storeUser(loginResponse.getUser());
                    return Observable.just(loginResponse);
                }
            });
</code></pre>

<p>My test looks like this:</p>

<pre><code>loginUseCase.setCredentials("testuser", "testpassword");
when(mockDeviceRepository.getDeviceId()).thenReturn(Observable.just("testdeviceid"));
when(mockAuthRepository.login("testdeviceid", "testuser", "testpassword")).thenReturn(Observable.just(new LoginResponse()));

testSubscriber = new TestSubscriber();
loginUseCase.buildUseCaseObservable().toBlocking().subscribe(testSubscriber);

testSubscriber.assertCompleted();
testSubscriber.assertValueCount(1);
</code></pre>