@Test
 public void shouldBeValidJSONOnResponse() throws JsonParseException {
   JaxRsResponse response = RestRequest.req().get(getPropertyUri("foo"));
   assertThat(response.getType().toString(), containsString(MediaType.APPLICATION_JSON));
   assertNotNull(JsonHelper.createJsonFrom(response.getEntity()));
   response.close();
 }
 @Test
 public void shouldBeJSONContentTypeOnPropertiesResponse() {
   long relId = helper.createRelationship("LIKES");
   helper.setRelationshipProperties(relId, Collections.<String, Object>singletonMap("foo", "bar"));
   JaxRsResponse response =
       RestRequest.req()
           .get(functionalTestHelper.dataUri() + "relationship/" + relId + "/properties");
   assertThat(response.getType().toString(), containsString(MediaType.APPLICATION_JSON));
   response.close();
 }
 @Test
 public void
     shouldRespondWith200AndEmptyListOfRelationshipRepresentationsWhenGettingOutgoingRelationshipsForANodeWithoutRelationships()
         throws JsonParseException {
   JaxRsResponse response = sendRetrieveRequestToServer(nodeWithoutRelationships, "/out");
   assertEquals(200, response.getStatus());
   assertEquals(MediaType.APPLICATION_JSON_TYPE, response.getType());
   verifyRelReps(0, response.getEntity(String.class));
   response.close();
 }
Ejemplo n.º 4
0
 @Test
 public void shouldHaveJsonMediaTypeOnResponse() {
   JaxRsResponse response = retrieveNodeFromService(nodeUri.toString());
   assertThat(response.getType().toString(), containsString(MediaType.APPLICATION_JSON));
   response.close();
 }
 @Test
 public void shouldHaveJsonMediaTypeWhenRetrievingDiscoveryDocument() throws Exception {
   JaxRsResponse response = getDiscoveryDocument();
   assertThat(response.getType().toString(), containsString(MediaType.APPLICATION_JSON));
   response.close();
 }