RDF4JProtocolSession extends SPARQLProtocolSession { public TupleQueryResult getRepositoryList() throws IOException, RepositoryException, UnauthorizedException, QueryInterruptedException { try { TupleQueryResultBuilder builder = new TupleQueryResultBuilder(); getRepositoryList(builder); return builder.getQueryResult(); } catch (TupleQueryResultHandlerException e) { throw new RuntimeException(e); } } RDF4JProtocolSession(HttpClient client, ScheduledExecutorService executor); void setServerURL(String serverURL); String getServerURL(); String getRepositoryURL(); void setRepository(String repositoryURL); @Override String getUpdateURL(); @Override void close(); TupleQueryResult getRepositoryList(); void getRepositoryList(TupleQueryResultHandler handler); String getServerProtocol(); long size(Resource... contexts); void createRepository(RepositoryConfig config); void updateRepository(RepositoryConfig config); void deleteRepository(String repositoryID); void getRepositoryConfig(StatementCollector statementCollector); TupleQueryResult getNamespaces(); void getNamespaces(TupleQueryResultHandler handler); String getNamespace(String prefix); void setNamespacePrefix(String prefix, String name); void removeNamespacePrefix(String prefix); void clearNamespaces(); TupleQueryResult getContextIDs(); void getContextIDs(TupleQueryResultHandler handler); void getStatements(Resource subj, IRI pred, Value obj, boolean includeInferred, RDFHandler handler,
			Resource... contexts); synchronized void beginTransaction(IsolationLevel isolationLevel); synchronized void beginTransaction(TransactionSetting... transactionSettings); synchronized void commitTransaction(); synchronized void rollbackTransaction(); @Deprecated void sendTransaction(final Iterable<? extends TransactionOperation> txn); void addData(InputStream contents, String baseURI, RDFFormat dataFormat, Resource... contexts); void removeData(InputStream contents, String baseURI, RDFFormat dataFormat, Resource... contexts); void upload(InputStream contents, String baseURI, RDFFormat dataFormat, boolean overwrite,
			boolean preserveNodeIds, Resource... contexts); void upload(final Reader contents, String baseURI, final RDFFormat dataFormat, boolean overwrite,
			boolean preserveNodeIds, Resource... contexts); @Override void setUsernameAndPassword(String username, String password);  }
@Test public void testRepositoryList() throws Exception { stubFor(get(urlEqualTo("/rdf4j-server/repositories")) .willReturn(aResponse().withStatus(200) .withHeader("Content-Type", TupleQueryResultFormat.SPARQL.getDefaultMIMEType()) .withBodyFile("repository-list.xml"))); assertThat(subject.getRepositoryList().getBindingNames()).contains("id"); verifyHeader("/rdf4j-server/repositories"); }