From d259d21c6f1257be807cb4eedac25b9c172a74cd Mon Sep 17 00:00:00 2001 From: Ethan Hsu Date: Fri, 26 Oct 2018 11:54:27 -0700 Subject: [PATCH] Fix #897: Username is shown as null on login --- app/src/main/java/org/mifos/mobilebanking/models/User.kt | 2 +- .../java/org/mifos/mobilebanking/presenters/LoginPresenter.java | 2 +- .../test/java/org/mifos/mobilebanking/LoginPresenterTest.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/org/mifos/mobilebanking/models/User.kt b/app/src/main/java/org/mifos/mobilebanking/models/User.kt index bb0e2826d..33aa6685b 100644 --- a/app/src/main/java/org/mifos/mobilebanking/models/User.kt +++ b/app/src/main/java/org/mifos/mobilebanking/models/User.kt @@ -11,7 +11,7 @@ data class User ( var userId: Long = 0, var isAuthenticated: Boolean = false, - var userName: String? = null, + var username: String? = null, var base64EncodedAuthenticationKey: String? = null, var permissions: List = ArrayList() ) diff --git a/app/src/main/java/org/mifos/mobilebanking/presenters/LoginPresenter.java b/app/src/main/java/org/mifos/mobilebanking/presenters/LoginPresenter.java index 1716ab929..fff6bd1e4 100644 --- a/app/src/main/java/org/mifos/mobilebanking/presenters/LoginPresenter.java +++ b/app/src/main/java/org/mifos/mobilebanking/presenters/LoginPresenter.java @@ -112,7 +112,7 @@ public void onError(Throwable e) { @Override public void onNext(User user) { if (user != null) { - final String userName = user.getUserName(); + final String userName = user.getUsername(); final long userID = user.getUserId(); final String authToken = Constants.BASIC + user.getBase64EncodedAuthenticationKey(); diff --git a/app/src/test/java/org/mifos/mobilebanking/LoginPresenterTest.java b/app/src/test/java/org/mifos/mobilebanking/LoginPresenterTest.java index 0931afe12..cf2d15c24 100644 --- a/app/src/test/java/org/mifos/mobilebanking/LoginPresenterTest.java +++ b/app/src/test/java/org/mifos/mobilebanking/LoginPresenterTest.java @@ -72,7 +72,7 @@ public void testLogin() throws Exception { presenter.login("selfservice", "password"); verify(view).showProgress(); - verify(view).onLoginSuccess(user.getUserName()); + verify(view).onLoginSuccess(user.getUsername()); } @Test