@Test public void shouldGetRepositories() throws Exception { Repositories repositories = REST_CLIENT.getRepositories(); assertNotNull(repositories); Collection<Repositories.Repository> repositoryList = repositories.getRepositories(); assertEquals(1, repositoryList.size()); Repositories.Repository repository = repositories.iterator().next(); assertEquals("repo", repository.getName()); Map<String, Object> metadata = repository.getMetadata(); assertNotNull(metadata); assertFalse(metadata.isEmpty()); }
public Repositories getRepositories() { JSONRestClient.Response response = jsonRestClient.doGet(); if (!response.isOK()) { throw new RuntimeException(JdbcI18n.invalidServerResponse.text(jsonRestClient.url(), response.asString())); } return new Repositories(response.json()); }
ModeShapeRestClient { public Repositories getRepositories() { JSONRestClient.Response response = jsonRestClient.doGet(); if (!response.isOK()) { throw new RuntimeException(JdbcI18n.invalidServerResponse.text(jsonRestClient.url(), response.asString())); } return new Repositories(response.json()); } }
ModeShapeRestClient { public Repositories getRepositories() { JSONRestClient.Response response = jsonRestClient.doGet(); if (!response.isOK()) { throw new RuntimeException(JdbcI18n.invalidServerResponse.text(jsonRestClient.url(), response.asString())); } return new Repositories(response.json()); } ModeShapeRestClient( String repoUrl,
                                String username,
                                String password ); }
ModeShapeRestClient { public Repositories getRepositories() { JSONRestClient.Response response = jsonRestClient.doGet(); if (!response.isOK()) { throw new RuntimeException(JdbcI18n.invalidServerResponse.text(jsonRestClient.url(), response.asString())); } return new Repositories(response.json()); } ModeShapeRestClient( String repoUrl,
                                String username,
                                String password ); String serverUrl(); Repositories getRepositories(); Repositories.Repository getRepository( String name ); Workspaces getWorkspaces( String repositoryName ); NodeTypes getNodeTypes(); QueryResult query( String query,
                              String queryLanguage ); String queryPlan( String query,
                             String queryLanguage ); }
ModeShapeRestClient { public Repositories getRepositories() { JSONRestClient.Response response = jsonRestClient.doGet(); if (!response.isOK()) { throw new RuntimeException(JdbcI18n.invalidServerResponse.text(jsonRestClient.url(), response.asString())); } return new Repositories(response.json()); } ModeShapeRestClient( String repoUrl,
                                String username,
                                String password ); String serverUrl(); Repositories getRepositories(); Repositories.Repository getRepository( String name ); Workspaces getWorkspaces( String repositoryName ); NodeTypes getNodeTypes(); QueryResult query( String query,
                              String queryLanguage ); String queryPlan( String query,
                             String queryLanguage );  }