use of org.neo4j.server.rest.JaxRsResponse 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.JaxRsResponse 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.JaxRsResponse 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.JaxRsResponse in project neo4j by neo4j.
the class ServerConfigIT 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.server.rest.JaxRsResponse in project neo4j by neo4j.
the class PagedTraverserIT method shouldRespondWith400OnNegativePageSize.
@Test
public void shouldRespondWith400OnNegativePageSize() {
theStartNode = createLinkedList(SHORT_LIST_LENGTH, server.getDatabase());
int negativePageSize = -99;
JaxRsResponse response = RestRequest.req().post(functionalTestHelper.nodeUri(theStartNode.getId()) + "/paged/traverse/node?pageSize=" + String.valueOf(negativePageSize), traverserDescription());
assertEquals(400, response.getStatus());
}
Aggregations