EricGao888 commented on a change in pull request #4134:
URL: https://github.com/apache/zeppelin/pull/4134#discussion_r667659954



##########
File path: 
zeppelin-server/src/test/java/org/apache/zeppelin/service/NotebookServiceTest.java
##########
@@ -263,6 +264,22 @@ public void testNoteOperations() throws IOException {
     assertEquals(2, notesInfo.size());
     verify(callback).onSuccess(notesInfo, context);
 
+    // test moving corrupted note to trash
+    Note corruptedNote = notebookService.createNote("/folder_1/corruptedNote", 
"test", true, context, callback);
+    String corruptedNotePath = notebookDir.getAbsolutePath() + 
corruptedNote.getPath() + "_" + corruptedNote.getId() + ".zpln";
+    // corrupt note
+    try (FileWriter myWriter = new FileWriter(corruptedNotePath)) {
+      myWriter.write("{{{I'm corrupted;;;");
+    } catch (IOException e) {
+      e.printStackTrace();
+    }
+    notebookService.moveNoteToTrash(corruptedNote.getId(), context, callback);
+    reset(callback);
+    notesInfo = notebookService.listNotesInfo(false, context, callback);
+    assertEquals(3, notesInfo.size());
+    verify(callback).onSuccess(notesInfo, context);
+    notebookService.removeNote(corruptedNote.getId(), context, callback);

Review comment:
       Test of removing note from trash has been added into 
zeppelin-zengine/src/test/java/org/apache/zeppelin/notebook/NotebookTest.java, 
thx




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@zeppelin.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to