UserRepositoryContext implements Serializable { public boolean hasCredentials() { return !credentials.isEmpty(); }  static UserRepositoryContext getContext(final HttpServletRequest request, final RepositoryName repositoryName); boolean getIsWaitingForExport(); boolean getIsLoggedIn(); void setIsWaitingForExport(final boolean isWaitingForExport); DirEntryComparator.SortType getSortType(); void setSortType(final DirEntryComparator.SortType sortType); DirEntrySorter.SortMode getSortMode(); void setSortMode(final DirEntrySorter.SortMode sortMode); void setLatestRevisionsDisplayCount(final int latestRevisionsDisplayCount); int getLatestRevisionsDisplayCount(); String getCharset(); void setCharset(final String charset); String getSearchMode(); void setSearchMode(final String searchMode); DirEntryTray getDirEntryTray(); void setCredentials(final Credentials credentials); Credentials getCredentials(); boolean hasCredentials(); void clearCredentials(); UUID getExportUuid(); void setExportUuid(UUID uuid); @Override String toString();  }
@Test public void testHasCredentials() throws Exception { final UserRepositoryContext context = new UserRepositoryContext(); assertFalse(context.hasCredentials()); context.setCredentials(new Credentials("uid", "pwd")); assertTrue(context.hasCredentials()); }