@Test
public void testAddRelationship() {

	//Record
	setUpExpectations();
	JsonApiIdentifiable minimalEntity = createMinimalEntity();
	JsonApiIdentifiable relatedEntity = createCustomMinimalEntity("related");
	//Replay
	Response result = JsonApiResponse
		.createGetResponse(uriInfo)
		.data(minimalEntity)
		.addRelationship("related", relatedEntity, uriInfo.getAbsolutePath())
		.build();
	assertIsValidJsonApiDataResponse(result);
	JsonNode resultJson = extractJsonEntity(result).get("data");
	Assert.assertTrue(resultJson.has("relationships"));
	Assert.assertEquals(1, resultJson.get("relationships").size());
	Assert.assertTrue(resultJson.get("relationships").has("related"));
	JsonNode relationshipNode = resultJson.get("relationships").get("related");
	assertHasValidRelationshipData(relationshipNode);
	Assert.assertEquals("related", relationshipNode.get("data").get("id").textValue());
}