Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Test
- public void getNotesOrderedByTypeAndLastUpdated_shouldReturnNotesInCorrectOrder() {
- Note note1 = new Note();
- note1.setReferenceId("1");
- note1.setReferenceTableId("1");
- note1.setNoteType(Note.EXTERNAL);
- note1.setSubject("First Note");
- note1.setText("This is the first test note.");
- note1.setSysUserId("testUser123");
- noteService.insert(note1);
- Note note2 = new Note();
- note2.setReferenceId("1");
- note2.setReferenceTableId("1");
- note2.setNoteType(Note.INTERNAL);
- note2.setSubject("Second Note");
- note2.setText("This is the second test note.");
- note2.setSysUserId("testUser456");
- noteService.insert(note2);
- List<Note> notes = noteService.getAllNotesByRefIdRefTable(note1);
- assertFalse("Notes list should not be empty", notes.isEmpty());
- assertEquals("Second note should be internal", Note.INTERNAL, notes.get(0).getNoteType());
- assertEquals("First note should be external", Note.EXTERNAL, notes.get(1).getNoteType());
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement