UserService { public void logout() { logoutSession(); allSettings.registerANM("", ""); allSettings.savePreviousFetchIndex("0"); repository.deleteRepository(); } UserService(Repository repository, AllSettings allSettings, AllSharedPreferences allSharedPreferences, HTTPAgent httpAgent, Session session,
                       DristhiConfiguration configuration, SaveANMLocationTask saveANMLocationTask); boolean isValidLocalLogin(String userName, String password); LoginResponse isValidRemoteLogin(String userName, String password); void localLogin(String userName, String password); void remoteLogin(String userName, String password, String anmLocation); boolean hasARegisteredUser(); void logout(); void logoutSession(); boolean hasSessionExpired(); String switchLanguagePreference();  }
@Test public void shouldDeleteDataAndSettingsWhenLogoutHappens() throws Exception { userService.logout(); verify(repository).deleteRepository(); verify(allSettings).savePreviousFetchIndex("0"); verify(allSettings).registerANM("", ""); }