LoginResponseModel { public boolean isSuccess() { return RESPONSE_OK.equals(response) && TextUtils.hasText(userId) && TextUtils.isEmpty(failureReason); }  boolean isSuccess(); String getUserId(); Exception getError();  }
@Test public void success() { model.response = LoginResponseModel.RESPONSE_OK; model.userId = "id"; assertThat(model.isSuccess(), is(true)); }
@Test public void wrongResponse() { model.response = "response"; model.userId = "id"; assertThat(model.isSuccess(), is(false)); }
@Test public void noUserId() { model.response = LoginResponseModel.RESPONSE_OK; model.userId = ""; assertThat(model.isSuccess(), is(false)); }