use of org.neo4j.doc.server.rest.RestRequest in project neo4j-documentation by neo4j.
the class NeoServerStartupLoggingDocIT method shouldLogStartup.
@Test
public void shouldLogStartup() throws Exception {
// Check the logs
assertThat(out.toString().length(), is(greaterThan(0)));
// Check the server is alive
Client nonRedirectingClient = Client.create();
nonRedirectingClient.setFollowRedirects(false);
final JaxRsResponse response = new RestRequest(server.baseUri(), nonRedirectingClient).get();
assertThat(response.getStatus(), is(greaterThan(199)));
}
use of org.neo4j.doc.server.rest.RestRequest in project neo4j-documentation by neo4j.
the class ServerConfigDocIT method shouldEnablConsoleServiceByDefault.
@Test
public void shouldEnablConsoleServiceByDefault() throws IOException {
// Given
server = server().usingDataDir(folder.directory(name.getMethodName()).getAbsolutePath()).build();
server.start();
// When & then
assertEquals(200, new RestRequest().get("http://localhost:7474/db/manage/server/console").getStatus());
}
use of org.neo4j.doc.server.rest.RestRequest in project neo4j-documentation by neo4j.
the class ServerConfigDocIT method shouldDisableConsoleServiceWhenAskedTo.
@Test
public void shouldDisableConsoleServiceWhenAskedTo() throws IOException {
// Given
server = server().withProperty(ServerSettings.console_module_enabled.name(), "false").usingDataDir(folder.directory(name.getMethodName()).getAbsolutePath()).build();
server.start();
// When & then
assertEquals(404, new RestRequest().get("http://localhost:7474/db/manage/server/console").getStatus());
}
use of org.neo4j.doc.server.rest.RestRequest in project neo4j-documentation by neo4j.
the class ServerConfigDocIT method shouldPickupRelativeUrisForMangementApiAndRestApi.
@Test
public void shouldPickupRelativeUrisForMangementApiAndRestApi() throws IOException {
String dataUri = "/a/different/data/uri/";
String managementUri = "/a/different/management/uri/";
server = server().withRelativeRestApiUriPath(dataUri).usingDataDir(folder.directory(name.getMethodName()).getAbsolutePath()).withRelativeManagementApiUriPath(managementUri).build();
server.start();
JaxRsResponse response = new RestRequest().get("http://localhost:7474" + dataUri, MediaType.TEXT_HTML_TYPE);
assertEquals(200, response.getStatus());
response = new RestRequest().get("http://localhost:7474" + managementUri);
assertEquals(200, response.getStatus());
response.close();
}
use of org.neo4j.doc.server.rest.RestRequest in project neo4j-documentation by neo4j.
the class ServerConfigDocIT method shouldNotGenerateWADLWhenNotExplicitlyEnabledInConfig.
@Test
public void shouldNotGenerateWADLWhenNotExplicitlyEnabledInConfig() throws IOException {
server = server().usingDataDir(folder.directory(name.getMethodName()).getAbsolutePath()).build();
server.start();
JaxRsResponse response = new RestRequest().get("http://localhost:7474/application.wadl", MediaType.WILDCARD_TYPE);
assertEquals(404, response.getStatus());
}
Aggregations