}
@Test
public void testEntityLookup() throws IOException, JSONException {
String uri = "http://dbpedia.org/resource/Paris";
//first check that lookup without create returns 404
RequestExecutor re = executor.execute(builder.buildGetRequest(
"/entityhub/lookup", "id",uri));
re.assertStatus(404);
//Now check that lookup with create does work
re = executor.execute(builder.buildGetRequest(
"/entityhub/lookup", "id",uri,"create","true"));
re.assertStatus(200);
JSONObject entity = assertEntity(re.getContent(), null, "entityhub");
String ehUri = entity.optString("id", null);
//try to retrieve the entity with the generated id
re = executor.execute(builder.buildGetRequest(
"/entityhub/entity", "id",ehUri));
re.assertStatus(200);
assertEntity(re.getContent(), ehUri, "entityhub");
//no try again to lookup the entity without create
re = executor.execute(builder.buildGetRequest(
"/entityhub/lookup", "id",uri));
re.assertStatus(200);
assertEntity(re.getContent(), ehUri, "entityhub");
//finally delete the entity
re = executor.execute(builder.buildOtherRequest(new HttpDelete(
builder.buildUrl("/entityhub/entity", "id", ehUri))));
re.assertStatus(200);
}