You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zeppelin.apache.org by GitBox <gi...@apache.org> on 2021/06/15 14:25:20 UTC

[GitHub] [zeppelin] Reamer commented on a change in pull request #4134: [ZEPPELIN-5398] fix ZEPPELIN-5398, make corrupted notes deletable

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



##########
File path: zeppelin-server/src/test/java/org/apache/zeppelin/service/NotebookServiceTest.java
##########
@@ -263,6 +264,26 @@ 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;;;");
+      myWriter.close();
+      System.out.println("Successfully wrote to the file.");

Review comment:
       Please remove `System.out.println` and work with asserts
   You should use [try-with-ressource](https://docs.oracle.com/javase/tutorial/essential/exceptions/tryResourceClose.html) for the FileWriter object.




-- 
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.

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