Note implements JsonSerializable { public Paragraph addNewParagraph(AuthenticationInfo authenticationInfo) { return insertNewParagraph(paragraphs.size(), authenticationInfo); } Note();  Note(String path, String defaultInterpreterGroup, InterpreterFactory factory,
      InterpreterSettingManager interpreterSettingManager, ParagraphJobListener paragraphJobListener,
      Credentials credentials, List<NoteEventListener> noteEventListener);  Note(NoteInfo noteInfo); String getPath(); String getParentPath(); boolean isLoaded(); void setLoaded(boolean loaded); void unLoad(); boolean isPersonalizedMode(); void setPersonalizedMode(Boolean value); String getId(); @VisibleForTesting void setId(String id); String getName(); void setPath(String path); void setVersion(String version); String getDefaultInterpreterGroup(); void setDefaultInterpreterGroup(String defaultInterpreterGroup); Map<String, Object> getNoteParams(); void setNoteParams(Map<String, Object> noteParams); Map<String, Input> getNoteForms(); void setNoteForms(Map<String, Input> noteForms); void setName(String name); InterpreterFactory getInterpreterFactory(); void setInterpreterFactory(InterpreterFactory interpreterFactory); boolean isCronSupported(ZeppelinConfiguration config); void setCronSupported(ZeppelinConfiguration config); Credentials getCredentials(); void setCredentials(Credentials credentials); List<AngularObject> getAngularObjects(String intpGroupId); void addOrUpdateAngularObject(String intpGroupId, AngularObject angularObject); void deleteAngularObject(String intpGroupId, String noteId, String paragraphId, String name); Paragraph addNewParagraph(AuthenticationInfo authenticationInfo); void fireParagraphCreateEvent(Paragraph p); void fireParagraphRemoveEvent(Paragraph p); void fireParagraphUpdateEvent(Paragraph p); Paragraph insertNewParagraph(int index, AuthenticationInfo authenticationInfo); void addParagraph(Paragraph paragraph); Paragraph removeParagraph(String user, String paragraphId); void clearParagraphOutputFields(Paragraph p); Paragraph clearPersonalizedParagraphOutput(String paragraphId, String user); Paragraph clearParagraphOutput(String paragraphId); void clearAllParagraphOutput(); void moveParagraph(String paragraphId, int index); void moveParagraph(String paragraphId, int index, boolean throwWhenIndexIsOutOfBound); boolean isLastParagraph(String paragraphId); int getParagraphCount(); Paragraph getParagraph(String paragraphId); Paragraph getParagraph(int index); Paragraph getLastParagraph(); void runAll(AuthenticationInfo authInfo,
                     boolean blocking,
                     boolean isolated,
                     Map<String, Object> params); boolean run(String paragraphId); boolean run(String paragraphId, boolean blocking); boolean run(String paragraphId,
                     String interpreterGroupId,
                     boolean blocking,
                     String ctxUser); boolean haveRunningOrPendingParagraphs(); boolean isTrash(); List<InterpreterCompletion> completion(String paragraphId,
                                                String buffer,
                                                int cursor,
                                                AuthenticationInfo authInfo); List<Paragraph> getParagraphs(); List<InterpreterSetting> getBindedInterpreterSettings(List<String> userAndRoles); List<InterpreterSetting> getUsedInterpreterSettings(); Note getUserNote(String user); Map<String, Object> getConfig(); void setConfig(Map<String, Object> config); Map<String, Object> getInfo(); void setInfo(Map<String, Object> info); void setRunning(boolean runStatus); void setIsolatedMode(boolean isolatedMode); boolean isIsolatedMode(); void setStartTime(String startTime); String getStartTime(); void clearStartTime(); boolean isRunning(); @Override String toString(); @Override String toJson(); static Note fromJson(String json); void postProcessParagraphs(); @Override boolean equals(Object o); @Override int hashCode(); @VisibleForTesting static Gson getGSON(); void setNoteEventListeners(List<NoteEventListener> noteEventListeners);  }
@Test public void addParagraphWithEmptyReplNameTest() { Note note = new Note("test", "", interpreterFactory, interpreterSettingManager, paragraphJobListener, credentials, noteEventListener); Paragraph p = note.addNewParagraph(AuthenticationInfo.ANONYMOUS); assertNull(p.getText()); }
@Test public void addParagraphWithLastReplNameTest() throws InterpreterNotFoundException { when(interpreterFactory.getInterpreter(eq("spark"), any())).thenReturn(interpreter); Note note = new Note("test", "", interpreterFactory, interpreterSettingManager, paragraphJobListener, credentials, noteEventListener); Paragraph p1 = note.addNewParagraph(AuthenticationInfo.ANONYMOUS); p1.setText("%spark "); Paragraph p2 = note.addNewParagraph(AuthenticationInfo.ANONYMOUS); assertEquals("%spark\n", p2.getText()); }