use of org.apache.stanbol.commons.testing.http.RequestExecutor in project stanbol by apache.
the class SitesManagerTest method testRetrievel.
/**
* Tests retrieval of Entities
* @throws IOException
* @throws JSONException
*/
@Test
public void testRetrievel() throws IOException, JSONException {
String id = "http://dbpedia.org/resource/Paris";
RequestExecutor re = executor.execute(builder.buildGetRequest(SITES_MANAGER_PATH + "/entity", "id", id).withHeader("Accept", "application/json"));
re.assertStatus(200);
//do not check for the site of the entity, because this might change
JSONObject jEntity = assertEntity(re.getContent(), id, null);
assertRepresentation(jEntity.getJSONObject("representation"), DBPEDIA_DEFAULTDATA_REQUIRED_FIELDS, DBPEDIA_DEFAULTDATA_OPTIONAL_FIELDS);
}
Aggregations