// We won't test here if deletion succeeded.
}
@Test
public void testCRUD() throws Exception {
RequestExecutor request;
// The needed Web resources to GET from.
executor.execute(builder.buildGetRequest(BASE_SCOPES_URI).withHeader("Accept", KRFormat.TURTLE))
.assertStatus(200);
log.info("Request: " + BASE_SCOPES_URI + " ... DONE");
String tempScopeUri = BASE_SCOPES_URI + "/" + getClass().getCanonicalName() + "-"
+ System.currentTimeMillis();
// Scope should not be there
request = executor.execute(builder.buildGetRequest(tempScopeUri)
.withHeader("Accept", KRFormat.TURTLE));
request.assertStatus(404);
log.info("Request: " + tempScopeUri + " (should return 404) ... DONE");
// Create scope
executor.execute(builder.buildOtherRequest(new HttpPut(builder.buildUrl(tempScopeUri))));
log.info("PUT Request: " + tempScopeUri + " ... DONE");
// Scope should be there now
request = executor.execute(builder.buildGetRequest(tempScopeUri)
.withHeader("Accept", KRFormat.TURTLE));
request.assertStatus(200).assertContentContains(tempScopeUri);
log.info("Request: " + tempScopeUri + " ... DONE");
// TODO the U of CRUD
// Delete scope
executor.execute(builder.buildOtherRequest(new HttpDelete(builder.buildUrl(tempScopeUri))));
log.info("DELETE Request: " + tempScopeUri + " ... DONE");
// Scope should not be there
request = executor.execute(builder.buildGetRequest(tempScopeUri)
.withHeader("Accept", KRFormat.TURTLE));
request.assertStatus(404);
log.info("Request: " + tempScopeUri + " (should return 404) ... DONE");
}