Advertisement
Guest User

Untitled

a guest
Dec 26th, 2024
27
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. @Test
  2. public void getNotesOrderedByTypeAndLastUpdated_shouldReturnNotesInCorrectOrder() {
  3. Note note1 = new Note();
  4. note1.setReferenceId("1");
  5. note1.setReferenceTableId("1");
  6. note1.setNoteType(Note.EXTERNAL);
  7. note1.setSubject("First Note");
  8. note1.setText("This is the first test note.");
  9. note1.setSysUserId("testUser123");
  10. noteService.insert(note1);
  11.  
  12. Note note2 = new Note();
  13. note2.setReferenceId("1");
  14. note2.setReferenceTableId("1");
  15. note2.setNoteType(Note.INTERNAL);
  16. note2.setSubject("Second Note");
  17. note2.setText("This is the second test note.");
  18. note2.setSysUserId("testUser456");
  19. noteService.insert(note2);
  20.  
  21. List<Note> notes = noteService.getAllNotesByRefIdRefTable(note1);
  22.  
  23. assertFalse("Notes list should not be empty", notes.isEmpty());
  24.  
  25. assertEquals("Second note should be internal", Note.INTERNAL, notes.get(0).getNoteType());
  26. assertEquals("First note should be external", Note.EXTERNAL, notes.get(1).getNoteType());
  27. }
  28.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement