Notebook { public void reloadAllNotes(AuthenticationInfo subject) throws IOException { this.noteManager.reloadNotes(); if (notebookRepo instanceof NotebookRepoSync) { NotebookRepoSync mainRepo = (NotebookRepoSync) notebookRepo; if (mainRepo.getRepoCount() > 1) { mainRepo.sync(subject); } } } Notebook(
      ZeppelinConfiguration conf,
      AuthorizationService authorizationService,
      NotebookRepo notebookRepo,
      NoteManager noteManager,
      InterpreterFactory replFactory,
      InterpreterSettingManager interpreterSettingManager,
      SearchService noteSearchService,
      Credentials credentials); @Inject  Notebook(
      ZeppelinConfiguration conf,
      AuthorizationService authorizationService,
      NotebookRepo notebookRepo,
      NoteManager noteManager,
      InterpreterFactory replFactory,
      InterpreterSettingManager interpreterSettingManager,
      SearchService noteSearchService,
      Credentials credentials,
      NoteEventListener noteEventListener); void recoveryIfNecessary(); NoteManager getNoteManager(); void setParagraphJobListener(ParagraphJobListener paragraphJobListener); Note createNote(String notePath,
                         AuthenticationInfo subject); Note createNote(String notePath,
                         AuthenticationInfo subject,
                         boolean save); Note createNote(String notePath,
                         String defaultInterpreterGroup,
                         AuthenticationInfo subject); Note createNote(String notePath,
                         String defaultInterpreterGroup,
                         AuthenticationInfo subject,
                         boolean save); String exportNote(String noteId); Note importNote(String sourceJson, String notePath, AuthenticationInfo subject); Note cloneNote(String sourceNoteId, String newNotePath, AuthenticationInfo subject); void removeNote(Note note, AuthenticationInfo subject); Note getNote(String noteId); Note getNote(String noteId, boolean reload); void saveNote(Note note, AuthenticationInfo subject); boolean containsNote(String notePath); boolean containsFolder(String folderPath); void moveNote(String noteId, String newNotePath, AuthenticationInfo subject); void moveFolder(String folderPath, String newFolderPath, AuthenticationInfo subject); void removeFolder(String folderPath, AuthenticationInfo subject); void emptyTrash(AuthenticationInfo subject); void restoreAll(AuthenticationInfo subject); Revision checkpointNote(String noteId, String notePath, String checkpointMessage,
      AuthenticationInfo subject); List<Revision> listRevisionHistory(String noteId,
                                            String notePath,
                                            AuthenticationInfo subject); Note setNoteRevision(String noteId, String notePath, String revisionId, AuthenticationInfo subject); Note getNoteByRevision(String noteId, String noteName,
                                String revisionId, AuthenticationInfo subject); @SuppressWarnings("rawtypes") Note loadNoteFromRepo(String id, AuthenticationInfo subject); void reloadAllNotes(AuthenticationInfo subject); List<NoteInfo> getNotesInfo(); Stream<Note> getNoteStream(); @VisibleForTesting List<Note> getAllNotes(Function<Note, Boolean> func); @VisibleForTesting List<Note> getAllNotes(); List<NoteInfo> getNotesInfo(Function<String, Boolean> func); List<InterpreterSetting> getBindedInterpreterSettings(String noteId); InterpreterFactory getInterpreterFactory(); InterpreterSettingManager getInterpreterSettingManager(); ZeppelinConfiguration getConf(); void close(); void addNotebookEventListener(NoteEventListener listener); Boolean isRevisionSupported();  }
@Test public void testReloadAllNotes() throws IOException { Note note1 = notebook.createNote("note1", AuthenticationInfo.ANONYMOUS); Paragraph p1 = note1.insertNewParagraph(0, AuthenticationInfo.ANONYMOUS); p1.setText("%md hello world"); Note note2 = notebook.cloneNote(note1.getId(), "copied note", AuthenticationInfo.ANONYMOUS); Note copiedNote = notebookRepo.get(note2.getId(), note2.getPath(), anonymous); notebook.reloadAllNotes(anonymous); List<Note> notes = notebook.getAllNotes(); assertEquals(notes.size(), 2); assertEquals(notes.get(0).getId(), copiedNote.getId()); assertEquals(notes.get(0).getName(), copiedNote.getName()); assertEquals(notes.get(0).getParagraphs().size(), copiedNote.getParagraphs().size()); assertEquals(notes.get(0).getParagraphs().get(0).getText(), copiedNote.getParagraphs().get(0).getText()); assertEquals(notes.get(0).getParagraphs().get(0).settings, copiedNote.getParagraphs().get(0).settings); assertEquals(notes.get(0).getParagraphs().get(0).getTitle(), copiedNote.getParagraphs().get(0).getTitle()); notebook.reloadAllNotes(anonymous); notes = notebook.getAllNotes(); assertEquals(notes.size(), 2); }