/** Tests saveNote() without pad. */ @Test public void testSaveNoteWithoutPad() { Note note = service.buildNote(null); note.setName("name"); note.setText("text"); service.saveNote(note, null); assertEquals(note, service.getNote(note.getId()).get()); }
/** Tests deleteNote(). */ @Test public void testDeleteNote() { Note note = service.buildNote(null); note.setName("name"); note.setText("text"); service.saveNote(note, null); service.deleteNote(note); assertFalse(service.getNote(note.getId()).isPresent()); }
/** Tests saveNote() with pad. */ @Test public void testSaveNoteWithPad() { Pad pad = padService.buildPad(); pad.setName("test"); padService.savePad(pad); Note note = service.buildNote(pad.getId()); note.setName("name"); note.setText("text"); service.saveNote(note, pad); assertEquals(note, service.getNote(note.getId()).get()); }