### Question:
NoteService { public Note findById(Long noteId) { return noteRepository.findByIdOrThrow(noteId); } @Autowired  NoteService(NoteRepository noteRepository, ActivityService activityService); Note findById(Long noteId); @Transactional Note updateNote(Note updatedNote, User user); @Transactional void deleteNote(Long noteId, User user);  }### Answer:
@Test(expected = EntityNotFoundException.class) public void findById_expectedNotFoundException() { when(noteRepository.findByIdOrThrow(originalId)).thenThrow(new EntityNotFoundException()); noteService.findById(originalId); }