### Question:
NoteService { @Transactional public void deleteNote(Long noteId, User user) { Note note = findById(noteId); noteRepository.deleteById(noteId); activityService.createActivity(user, note, Action.DELETED); logger.info("Deleted Note with id " + 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 public void deleteNote_expectedDeleteCall() { when(noteRepository.findByIdOrThrow(originalId)).thenReturn(originalNote); noteService.deleteNote(originalId, authorizedUser); verify(noteRepository).deleteById(originalId); }
@Test public void deleteNote_expectedActivityCall() { when(noteRepository.findByIdOrThrow(originalId)).thenReturn(originalNote); noteService.deleteNote(originalId, authorizedUser); verify(activityService).createActivity(authorizedUser, originalNote, Action.DELETED); }