diff --git a/RapidFTR-AndroidTests/src/main/java/com/rapidftr/activity/SearchChildrenActivity.java b/RapidFTR-AndroidTests/src/main/java/com/rapidftr/activity/SearchChildrenActivity.java index d35839a1..0ab33c78 100644 --- a/RapidFTR-AndroidTests/src/main/java/com/rapidftr/activity/SearchChildrenActivity.java +++ b/RapidFTR-AndroidTests/src/main/java/com/rapidftr/activity/SearchChildrenActivity.java @@ -1,11 +1,12 @@ package com.rapidftr.activity; -import com.rapidftr.RapidFtrApplication; import com.rapidftr.model.Child; import com.rapidftr.repository.ChildRepository; import org.json.JSONException; +import static com.rapidftr.RapidFtrApplication.getApplicationInstance; + public class SearchChildrenActivity extends BaseActivityIntegrationTest{ @Override @@ -24,7 +25,7 @@ public void tearDown() throws Exception{ } public void testSearchChildAndViewDetail() throws JSONException { - ChildRepository repository = RapidFtrApplication.getInstance().getInjector().getInstance(ChildRepository.class); + ChildRepository repository = getApplicationInstance().getInjector().getInstance(ChildRepository.class); Child child=new Child(getAlphaNumeric(5), "rapidftr","{\"name\":\"SearchTest\"}"); repository.createOrUpdate(child); searchPage.navigateToSearchPage(); @@ -43,7 +44,7 @@ public void testErrorMessageOnNoSearchResultFound(){ } public void testUserCanEditChildCreatedByOtherUserViaSearch() throws JSONException{ - ChildRepository repository = RapidFtrApplication.getInstance().getInjector().getInstance(ChildRepository.class); + ChildRepository repository = getApplicationInstance().getInjector().getInstance(ChildRepository.class); Child child =new Child(getAlphaNumeric(5), "admin","{\"name\":\"SearchEditTest\"}"); repository.createOrUpdate(child); searchPage.navigateToSearchPage();