UserManager { public String getSiteUrl(Account account) { return validateUrl(accountManager.getUserData(account, KEY_SITE_URL)); } UserManager(AccountManager accountManager, Resources resources, PreferencesRepository preferencesRepository, Context ctx); CacheDatabase getDatabaseForCurrent(); void refreshAccounts(); int countOfAcounts(); boolean hasAccounts(); Account getAccountForUser(String siteUrl, String username); boolean userExists(String siteUrl, String username); Account createUser(String siteUrl, String username, String password); LiveData<Account> getActiveAccount(); LiveData<List<Account>> getAccounts(); String getSiteUrl(Account account); String getUsername(Account account); String getPassword(Account account); Cookie sessionCookie(); void setSessionCookie(Cookie cookie); String sessionToken(); void setSessionToken(String token); void setChunkSize(Account account, int chunkSize); int getChunkSize(Account account); boolean isGuest(Account account); void setActiveAccount(Account activeAccount); void setActiveAccount(String activeAccount); void replaceAccount(@NonNull Account account, @NonNull String url, String username, String password); void removeAccount(Account account); String validateUrl(String url);  }
@Test public void getSiteUrl_callsAccountManager() { Account account = mock(Account.class); userManager.getSiteUrl(account); verify(accountManager).getUserData(account, UserManager.KEY_SITE_URL); }