This is an automated email from the ASF dual-hosted git repository. zjffdu pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/zeppelin.git
The following commit(s) were added to refs/heads/master by this push: new 2e6422c [hotfix] Fix test failed of NotebookRestApiTest 2e6422c is described below commit 2e6422c5dfc6a8154b79c6be4531063183cd46a8 Author: Jeff Zhang <zjf...@apache.org> AuthorDate: Fri Feb 14 10:58:14 2020 +0800 [hotfix] Fix test failed of NotebookRestApiTest --- .../src/test/java/org/apache/zeppelin/rest/AbstractTestRestApi.java | 4 ++++ .../src/test/java/org/apache/zeppelin/rest/NotebookRestApiTest.java | 6 ++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/zeppelin-server/src/test/java/org/apache/zeppelin/rest/AbstractTestRestApi.java b/zeppelin-server/src/test/java/org/apache/zeppelin/rest/AbstractTestRestApi.java index d107547..3c3273c 100644 --- a/zeppelin-server/src/test/java/org/apache/zeppelin/rest/AbstractTestRestApi.java +++ b/zeppelin-server/src/test/java/org/apache/zeppelin/rest/AbstractTestRestApi.java @@ -596,4 +596,8 @@ public abstract class AbstractTestRestApi { protected Matcher<? super HttpMethodBase> isNotAllowed() { return responsesWith(405); } + + protected Matcher<? super HttpMethodBase> isExpectationFailed() { + return responsesWith(417); + } } diff --git a/zeppelin-server/src/test/java/org/apache/zeppelin/rest/NotebookRestApiTest.java b/zeppelin-server/src/test/java/org/apache/zeppelin/rest/NotebookRestApiTest.java index bc3bc04..7498822 100644 --- a/zeppelin-server/src/test/java/org/apache/zeppelin/rest/NotebookRestApiTest.java +++ b/zeppelin-server/src/test/java/org/apache/zeppelin/rest/NotebookRestApiTest.java @@ -16,6 +16,7 @@ */ package org.apache.zeppelin.rest; +import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotEquals; import static org.junit.Assert.assertNotNull; @@ -228,10 +229,11 @@ public class NotebookRestApiTest extends AbstractTestRestApi { p2.setText("%python user2='abc'\nprint(user2)"); PostMethod post = httpPost("/notebook/job/" + note1.getId(), ""); - assertThat(post, isAllowed()); + assertThat(post, isExpectationFailed()); Map<String, Object> resp = gson.fromJson(post.getResponseBodyAsString(), new TypeToken<Map<String, Object>>() {}.getType()); - assertEquals(resp.get("status"), "OK"); + assertEquals(resp.get("status"), "EXPECTATION_FAILED"); + assertTrue(resp.get("message").toString().contains("Fail to run note because paragraph")); post.releaseConnection(); assertEquals(Job.Status.ERROR, p1.getStatus());