mirror of
https://github.com/apache/zeppelin
synced 2026-05-24 09:38:26 +00:00
Handled NPE when the json is empty for interpreter setting POST request
and corrected the json in the REST API doc.
This commit is contained in:
parent
7f733ffb2e
commit
3397fb0b47
3 changed files with 24 additions and 4 deletions
|
|
@ -219,7 +219,9 @@ The role of registered interpreters, settings and interpreters group are describ
|
|||
"dependencies": [
|
||||
{
|
||||
"groupArtifactVersion": "groupId:artifactId:version",
|
||||
"exclusions": "groupId:artifactId"
|
||||
"exclusions": [
|
||||
"groupId:artifactId"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -249,7 +251,9 @@ The role of registered interpreters, settings and interpreters group are describ
|
|||
"dependencies": [
|
||||
{
|
||||
"groupArtifactVersion": "groupId:artifactId:version",
|
||||
"exclusions": "groupId:artifactId"
|
||||
"exclusions": [
|
||||
"groupId:artifactId"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -298,7 +302,9 @@ The role of registered interpreters, settings and interpreters group are describ
|
|||
"dependencies": [
|
||||
{
|
||||
"groupArtifactVersion": "groupId:artifactId:version",
|
||||
"exclusions": "groupId:artifactId"
|
||||
"exclusions": [
|
||||
"groupId:artifactId"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -328,7 +334,9 @@ The role of registered interpreters, settings and interpreters group are describ
|
|||
"dependencies": [
|
||||
{
|
||||
"groupArtifactVersion": "groupId:artifactId:version",
|
||||
"exclusions": "groupId:artifactId"
|
||||
"exclusions": [
|
||||
"groupId:artifactId"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -90,6 +90,9 @@ public class InterpreterRestApi {
|
|||
try {
|
||||
NewInterpreterSettingRequest request =
|
||||
gson.fromJson(message, NewInterpreterSettingRequest.class);
|
||||
if (request == null) {
|
||||
return new JsonResponse<>(Status.BAD_REQUEST).build();
|
||||
}
|
||||
Properties p = new Properties();
|
||||
p.putAll(request.getProperties());
|
||||
InterpreterSetting interpreterSetting = interpreterFactory
|
||||
|
|
|
|||
|
|
@ -119,6 +119,15 @@ public class InterpreterRestApiTest extends AbstractTestRestApi {
|
|||
delete.releaseConnection();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSettingsCreateWithEmptyJson() throws IOException {
|
||||
// Call Create Setting REST API
|
||||
PostMethod post = httpPost("/interpreter/setting/", "");
|
||||
LOG.info("testSettingCRUD create response\n" + post.getResponseBodyAsString());
|
||||
assertThat("test create method:", post, isBadRequest());
|
||||
post.releaseConnection();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testInterpreterAutoBinding() throws IOException {
|
||||
// create note
|
||||
|
|
|
|||
Loading…
Reference in a new issue