@Before public void setUp() throws Exception { setUpClassifieds(); setUpClassifiedComments(); notificationService = spy(new CommentUserNotificationService()); notificationService.register(ClassifiedService.COMPONENT_NAME, classifiedService); doReturn(mockCommentService()).when(notificationService).getCommentService(); doReturn(mockNotificationSender()) .when(notificationService) .getNotificationSender(CLASSIFIED_INSTANCEID); }