mirror of
https://github.com/apache/zeppelin
synced 2026-05-24 09:38:26 +00:00
fix restapi testcase(status code).
This commit is contained in:
parent
d0afd18096
commit
a83289e1c4
2 changed files with 6 additions and 8 deletions
|
|
@ -393,8 +393,6 @@ public abstract class AbstractTestRestApi {
|
|||
|
||||
protected Matcher<? super HttpMethodBase> isCreated() { return responsesWith(201); }
|
||||
|
||||
protected Matcher<? super HttpMethodBase> isAccepted() { return responsesWith(202); }
|
||||
|
||||
protected Matcher<? super HttpMethodBase> isBadRequest() { return responsesWith(400); }
|
||||
|
||||
protected Matcher<? super HttpMethodBase> isNotFound() { return responsesWith(404); }
|
||||
|
|
|
|||
|
|
@ -338,24 +338,24 @@ public class ZeppelinRestApiTest extends AbstractTestRestApi {
|
|||
|
||||
// Call Run Notebook Jobs REST API
|
||||
PostMethod postNoteJobs = httpPost("/notebook/job/" + noteID, "");
|
||||
assertThat("test notebook jobs run:", postNoteJobs, isAccepted());
|
||||
assertThat("test notebook jobs run:", postNoteJobs, isAllowed());
|
||||
postNoteJobs.releaseConnection();
|
||||
|
||||
// Call Stop Notebook Jobs REST API
|
||||
DeleteMethod deleteNoteJobs = httpDelete("/notebook/job/" + noteID);
|
||||
assertThat("test notebook stop:", deleteNoteJobs, isAccepted());
|
||||
assertThat("test notebook stop:", deleteNoteJobs, isAllowed());
|
||||
deleteNoteJobs.releaseConnection();
|
||||
Thread.sleep(1000);
|
||||
|
||||
// Call Run paragraph REST API
|
||||
PostMethod postParagraph = httpPost("/notebook/job/" + noteID + "/" + paragraph.getId(), "");
|
||||
assertThat("test paragraph run:", postParagraph, isAccepted());
|
||||
assertThat("test paragraph run:", postParagraph, isAllowed());
|
||||
postParagraph.releaseConnection();
|
||||
Thread.sleep(1000);
|
||||
|
||||
// Call Stop paragraph REST API
|
||||
DeleteMethod deleteParagraph = httpDelete("/notebook/job/" + noteID + "/" + paragraph.getId());
|
||||
assertThat("test paragraph stop:", deleteParagraph, isAccepted());
|
||||
assertThat("test paragraph stop:", deleteParagraph, isAllowed());
|
||||
deleteParagraph.releaseConnection();
|
||||
Thread.sleep(1000);
|
||||
|
||||
|
|
@ -395,7 +395,7 @@ public class ZeppelinRestApiTest extends AbstractTestRestApi {
|
|||
|
||||
// right cron expression.
|
||||
postCron = httpPost("/notebook/cron/" + note.getId(), jsonRequest);
|
||||
assertThat("", postCron, isAccepted());
|
||||
assertThat("", postCron, isAllowed());
|
||||
postCron.releaseConnection();
|
||||
Thread.sleep(1000);
|
||||
|
||||
|
|
@ -408,7 +408,7 @@ public class ZeppelinRestApiTest extends AbstractTestRestApi {
|
|||
|
||||
// remove cron job.
|
||||
DeleteMethod deleteCron = httpDelete("/notebook/cron/" + note.getId());
|
||||
assertThat("", deleteCron, isAccepted());
|
||||
assertThat("", deleteCron, isAllowed());
|
||||
deleteCron.releaseConnection();
|
||||
ZeppelinServer.notebook.removeNote(note.getId());
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue