use of org.neo4j.server.rest.JaxRsResponse in project neo4j by neo4j.
the class NeoServerDefaultPortAndHostnameIT method shouldDefaultToSensiblePortIfNoneSpecifiedInConfig.
@Test
public void shouldDefaultToSensiblePortIfNoneSpecifiedInConfig() throws Exception {
FunctionalTestHelper functionalTestHelper = new FunctionalTestHelper(server());
JaxRsResponse response = functionalTestHelper.get(functionalTestHelper.managementUri());
assertThat(response.getStatus(), is(200));
}
use of org.neo4j.server.rest.JaxRsResponse in project neo4j by neo4j.
the class NeoServerJAXRSIT method shouldMakeJAXRSClassesAvailableViaHTTP.
@Test
public void shouldMakeJAXRSClassesAvailableViaHTTP() throws Exception {
CommunityServerBuilder builder = CommunityServerBuilder.server();
server = ServerHelper.createNonPersistentServer(builder);
FunctionalTestHelper functionalTestHelper = new FunctionalTestHelper(server);
JaxRsResponse response = new RestRequest().get(functionalTestHelper.managementUri());
assertEquals(200, response.getStatus());
response.close();
}
use of org.neo4j.server.rest.JaxRsResponse in project neo4j by neo4j.
the class NeoServerStartupLoggingIT 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.server.rest.JaxRsResponse in project neo4j by neo4j.
the class RedirectToBrowserTest method shouldRedirectToBrowserUsingXForwardedHeaders.
@Test
public void shouldRedirectToBrowserUsingXForwardedHeaders() throws Exception {
Client nonRedirectingClient = Client.create();
nonRedirectingClient.setFollowRedirects(false);
final JaxRsResponse response = new RestRequest(server.baseUri(), nonRedirectingClient).accept(MediaType.TEXT_HTML_TYPE).header("X-Forwarded-Host", "foo.bar:8734").header("X-Forwarded-Proto", "https").get(server.baseUri().toString());
assertEquals(303, response.getStatus());
assertEquals(new URI("https://foo.bar:8734/browser/"), response.getLocation());
response.close();
}
use of org.neo4j.server.rest.JaxRsResponse in project neo4j by neo4j.
the class RedirectToBrowserTest method shouldRedirectToBrowser.
@Test
public void shouldRedirectToBrowser() throws Exception {
Client nonRedirectingClient = Client.create();
nonRedirectingClient.setFollowRedirects(false);
final JaxRsResponse response = new RestRequest(server.baseUri(), nonRedirectingClient).accept(MediaType.TEXT_HTML_TYPE).get(server.baseUri().toString());
assertEquals(303, response.getStatus());
assertEquals(new URI("http://localhost:7474/browser/"), response.getLocation());
response.close();
}
Aggregations