@Test
public void loginWithUsernameReturnsUserFromService() {

    TestSubscriber<User> ts = new TestSubscriber<>();
    network.loginWithUsername(USERNAME, PASSWORD).subscribe(ts);
    assertThat(ts.getOnNextEvents(), hasItems(user));
}