JcrSessionFactory implements InitializingBean, DisposableBean, SessionFactory { @Override public Session getSession() throws RepositoryException { Session session = repository.login(credentials, workspaceName); return addListeners(session); } JcrSessionFactory(Repository repository, String workspaceName, Credentials credentials);  JcrSessionFactory(Repository repository, String workspaceName, Credentials credentials, SessionHolderProviderManager sessionHolderProviderManager);  JcrSessionFactory(); @Override void afterPropertiesSet(); @Override void destroy(); @Override Session getSession(); @Override SessionHolder getSessionHolder(Session session); Repository getRepository(); void setRepository(Repository repository); void setWorkspaceName(String workspaceName); void setCredentials(Credentials credentials); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString(); EventListenerDefinition[] getEventListeners(); void setEventListeners(EventListenerDefinition[] eventListenerDefinitions); Properties getNamespaces(); void setNamespaces(Properties namespaces); SessionHolderProviderManager getSessionHolderProviderManager(); void setSessionHolderProviderManager(SessionHolderProviderManager sessionHolderProviderManager); void setKeepNewNamespaces(boolean keepNamespaces); void setForceNamespacesRegistration(boolean forceNamespacesRegistration); void setSkipExistingNamespaces(boolean skipRegisteredNamespace); boolean isForceNamespacesRegistration(); boolean isKeepNewNamespaces(); boolean isSkipExistingNamespaces(); Credentials getCredentials(); String getWorkspaceName();  }
@Test public void testGetSession() { try { expect(repository.login(null, null)).andReturn(null); factory.getSession(); } catch (RepositoryException e) { e.printStackTrace(); } }