Exemplo n.º 1
0
  /** 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());
  }
Exemplo n.º 2
0
  /** 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());
  }
Exemplo n.º 3
0
  /** 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());
  }