Changed http put to Http post for REST import

This commit is contained in:
Ramaswamy Devarajan 2016-01-10 19:10:13 -08:00
parent ecb8f1eaf5
commit 6c19668c53
2 changed files with 6 additions and 6 deletions

View file

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

View file

@ -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 {