use of org.neo4j.server.rest.RestRequest in project neo4j by neo4j.
the class PluginFunctionalTestHelper method makePostList.
protected static List<Map<String, Object>> makePostList(String url) throws JsonParseException {
JaxRsResponse response = new RestRequest().post(url, null);
String body = getResponseText(response);
response.close();
return deserializeList(body);
}
use of org.neo4j.server.rest.RestRequest in project neo4j by neo4j.
the class BoltIT method boltAddressShouldComeFromConfigWhenTheListenConfigIsNotLocalhost.
@Test
public void boltAddressShouldComeFromConfigWhenTheListenConfigIsNotLocalhost() throws Throwable {
// Given
String host = "neo4j.com";
startServerWithBoltEnabled(host, 9999, "localhost", 7687);
RestRequest request = new RestRequest(server.baseUri()).host(host);
// When
JaxRsResponse response = request.get();
// Then
Map<String, Object> map = JsonHelper.jsonToMap(response.getEntity());
assertThat(String.valueOf(map.get("bolt")), containsString("bolt://" + host + ":" + 9999));
}
use of org.neo4j.server.rest.RestRequest in project neo4j by neo4j.
the class BoltIT method boltAddressShouldAppearToComeFromTheSameOriginAsTheHttpAddressEvenThoughThisIsMorallyHazardous.
@Test
public void boltAddressShouldAppearToComeFromTheSameOriginAsTheHttpAddressEvenThoughThisIsMorallyHazardous() throws Throwable {
// Given
String host = "neo4j.com";
startServerWithBoltEnabled();
RestRequest request = new RestRequest(server.baseUri()).host(host);
// When
JaxRsResponse response = request.get();
// Then
Map<String, Object> map = JsonHelper.jsonToMap(response.getEntity());
assertThat(String.valueOf(map.get("bolt")), containsString("bolt://" + host));
assertFalse(String.valueOf(map.get("bolt")).contains("bolt://bolt://"));
}
use of org.neo4j.server.rest.RestRequest in project neo4j by neo4j.
the class ServerConfigIT method shouldNotGenerateWADLWhenExplicitlyDisabledInConfig.
@Test
public void shouldNotGenerateWADLWhenExplicitlyDisabledInConfig() throws IOException {
server = server().withProperty(ServerSettings.wadl_enabled.name(), "false").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());
}
use of org.neo4j.server.rest.RestRequest in project neo4j by neo4j.
the class ServerConfigIT 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());
}
Aggregations