use of org.apache.commons.httpclient.methods.DeleteMethod in project zeppelin by apache.
the class ZeppelinRestApiTest method testDeleteNote.
private void testDeleteNote(String noteId) throws IOException {
DeleteMethod delete = httpDelete(("/notebook/" + noteId));
LOG.info("testDeleteNote delete response\n" + delete.getResponseBodyAsString());
assertThat("Test delete method:", delete, isAllowed());
delete.releaseConnection();
// make sure note is deleted
if (!noteId.isEmpty()) {
Note deletedNote = ZeppelinServer.notebook.getNote(noteId);
assertNull("Deleted note should be null", deletedNote);
}
}
use of org.apache.commons.httpclient.methods.DeleteMethod in project zeppelin by apache.
the class NotebookSecurityRestApiTest method userTryRemoveNote.
private void userTryRemoveNote(String noteId, String user, String pwd, Matcher<? super HttpMethodBase> m) throws IOException {
DeleteMethod delete = httpDelete(("/notebook/" + noteId), user, pwd);
assertThat(delete, m);
delete.releaseConnection();
}
use of org.apache.commons.httpclient.methods.DeleteMethod in project zeppelin by apache.
the class CredentialsRestApiTest method testRemoveUserCredentials.
public void testRemoveUserCredentials() throws IOException {
DeleteMethod deleteMethod = httpDelete("/credential/");
assertThat("Test delete method:", deleteMethod, isAllowed());
deleteMethod.releaseConnection();
}
use of org.apache.commons.httpclient.methods.DeleteMethod in project zeppelin by apache.
the class CredentialsRestApiTest method testRemoveCredentialEntity.
public void testRemoveCredentialEntity(String entity) throws IOException {
DeleteMethod deleteMethod = httpDelete("/credential/" + entity);
assertThat("Test delete method:", deleteMethod, isAllowed());
deleteMethod.releaseConnection();
}
use of org.apache.commons.httpclient.methods.DeleteMethod in project zeppelin by apache.
the class InterpreterRestApiTest method testAddDeleteRepository.
@Test
public void testAddDeleteRepository() throws IOException {
// Call create repository API
String repoId = "securecentral";
String jsonRequest = "{\"id\":\"" + repoId + "\",\"url\":\"https://repo1.maven.org/maven2\",\"snapshot\":\"false\"}";
PostMethod post = httpPost("/interpreter/repository/", jsonRequest);
assertThat("Test create method:", post, isAllowed());
post.releaseConnection();
// Call delete repository API
DeleteMethod delete = httpDelete("/interpreter/repository/" + repoId);
assertThat("Test delete method:", delete, isAllowed());
delete.releaseConnection();
}
Aggregations