From d6f7a4595629dad4c838917d180d3781c7c08af2 Mon Sep 17 00:00:00 2001 From: Denis Rwelamila Date: Tue, 2 Jul 2019 09:42:29 +0300 Subject: [PATCH] code cleanup --- .../chw/malaria/presenter/BaseMalariaProfilePresenter.java | 2 +- .../presenter/BaseMalariaProfilePresenterTest.java | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/opensrp-chw-malaria/src/main/java/org/smartregister/chw/malaria/presenter/BaseMalariaProfilePresenter.java b/opensrp-chw-malaria/src/main/java/org/smartregister/chw/malaria/presenter/BaseMalariaProfilePresenter.java index 19d2419..31c0578 100644 --- a/opensrp-chw-malaria/src/main/java/org/smartregister/chw/malaria/presenter/BaseMalariaProfilePresenter.java +++ b/opensrp-chw-malaria/src/main/java/org/smartregister/chw/malaria/presenter/BaseMalariaProfilePresenter.java @@ -27,7 +27,7 @@ public void detachView() { } public void fillProfileData(MemberObject memberObject) { - if (memberObject != null) { + if (memberObject != null || this.memberObject != null) { view.setProfileViewWithData(); } } diff --git a/opensrp-chw-malaria/src/test/java/org/smartregister/presenter/BaseMalariaProfilePresenterTest.java b/opensrp-chw-malaria/src/test/java/org/smartregister/presenter/BaseMalariaProfilePresenterTest.java index 9520354..564c545 100644 --- a/opensrp-chw-malaria/src/test/java/org/smartregister/presenter/BaseMalariaProfilePresenterTest.java +++ b/opensrp-chw-malaria/src/test/java/org/smartregister/presenter/BaseMalariaProfilePresenterTest.java @@ -12,7 +12,8 @@ public class BaseMalariaProfilePresenterTest { @Mock - private MalariaProfileContract.View view = Mockito.mock(MalariaProfileContract.View.class); + MalariaProfileContract.View view = Mockito.mock(MalariaProfileContract.View.class); + @Mock BaseMalariaProfilePresenter profilePresenter = Mockito.mock(BaseMalariaProfilePresenter.class); @@ -20,7 +21,7 @@ public class BaseMalariaProfilePresenterTest { MemberObject memberObject = Mockito.mock(MemberObject.class); @Test - public void fillProfileData_doesntCallsSetProfileViewWithDataIfMemberObjectEmpty() { + public void fillProfileDataDoesntCallsSetProfileViewWithDataIfMemberObjectEmpty() { profilePresenter.fillProfileData(memberObject); verify(view, never()).setProfileViewWithData(); }