mirror of
https://github.com/apache/zeppelin
synced 2026-05-24 09:38:26 +00:00
Changed http put to Http post for REST import
This commit is contained in:
parent
ecb8f1eaf5
commit
6c19668c53
2 changed files with 6 additions and 6 deletions
|
|
@ -173,7 +173,7 @@ public class NotebookRestApi {
|
|||
* @return JSON with new note ID
|
||||
* @throws IOException
|
||||
*/
|
||||
@PUT
|
||||
@POST
|
||||
@Path("import")
|
||||
public Response importNotebook(String req) {
|
||||
GsonBuilder gsonBuilder = new GsonBuilder();
|
||||
|
|
|
|||
|
|
@ -367,11 +367,11 @@ public class ZeppelinRestApiTest extends AbstractTestRestApi {
|
|||
String sourceNoteID = note.getId();
|
||||
// get note content as JSON
|
||||
String oldJson = getNoteContent(sourceNoteID);
|
||||
// call notebook put
|
||||
PutMethod importPut = httpPut("/notebook/import/", oldJson);
|
||||
assertThat(importPut, isCreated());
|
||||
// call notebook post
|
||||
PostMethod importPost = httpPost("/notebook/import/", oldJson);
|
||||
assertThat(importPost, isCreated());
|
||||
resp =
|
||||
gson.fromJson(importPut.getResponseBodyAsString(),
|
||||
gson.fromJson(importPost.getResponseBodyAsString(),
|
||||
new TypeToken<Map<String, Object>>() {}.getType());
|
||||
String importId = (String) resp.get("body");
|
||||
|
||||
|
|
@ -383,7 +383,7 @@ public class ZeppelinRestApiTest extends AbstractTestRestApi {
|
|||
// cleanup
|
||||
ZeppelinServer.notebook.removeNote(note.getId());
|
||||
ZeppelinServer.notebook.removeNote(newNote.getId());
|
||||
importPut.releaseConnection();
|
||||
importPost.releaseConnection();
|
||||
}
|
||||
|
||||
private String getNoteContent(String id) throws IOException {
|
||||
|
|
|
|||
Loading…
Reference in a new issue