fix restapi testcase(status code).

This commit is contained in:
astroshim 2015-12-09 00:46:51 +09:00
parent d0afd18096
commit a83289e1c4
2 changed files with 6 additions and 8 deletions

View file

@ -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); }

View file

@ -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());
}