@Test
  public void shouldGet200WhenRetrievingValidRelationship() throws DatabaseBlockedException {
    long relationshipId = helper.createRelationship("LIKES");

    JaxRsResponse response =
        RestRequest.req().get(functionalTestHelper.relationshipUri(relationshipId));

    assertEquals(200, response.getStatus());
    response.close();
  }
  @Test
  public void shouldGetARelationshipRepresentationInJsonWhenRetrievingValidRelationship()
      throws Exception {
    long relationshipId = helper.createRelationship("LIKES");

    JaxRsResponse response =
        RestRequest.req().get(functionalTestHelper.relationshipUri(relationshipId));

    String entity = response.getEntity(String.class);
    assertNotNull(entity);
    isLegalJson(entity);
    response.close();
  }
Ejemplo n.º 3
0
 @Test
 public void shouldGetThomasAndersonLovesTrinityRelationship() {
   JaxRsResponse response =
       RestRequest.req()
           .get(
               functionalTestHelper.relationshipUri(thomasAndersonLovesTrinity),
               MediaType.TEXT_HTML_TYPE);
   assertEquals(Status.OK.getStatusCode(), response.getStatus());
   String entity = response.getEntity();
   assertTrue(entity.contains("strength"));
   assertTrue(entity.contains("100"));
   assertTrue(entity.contains("LOVES"));
   assertValidHtml(entity);
   response.close();
 }