UserService { public void remoteLogin(String userName, String password, String anmLocation) { loginWith(userName, password); saveANMLocationTask.save(anmLocation); } 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 shouldSaveANMLocationWhenRemoteLoginIsSuccessful() { userService.remoteLogin("userX", "password Y", "anm location"); verify(saveANMLocationTask).save("anm location"); }
@Test public void shouldRegisterANewUser() { userService.remoteLogin("user X", "password Y", ""); verify(allSettings).registerANM("user X", "password Y"); verify(session).setPassword("password Y"); }