3

So I have this mockito test that basicaly tests that attendees are recivint their notifications

@Mock Event event;

  @Mock
    Attendee attende;

    @InjectMocks
    EventNotificationServiceImpl eventNotificationService;

    @Test
    public void checkIfAtendesAreNotified(){
        Event event = new Event();
         Attendee attende = new Attendee(1L,"sara","sara@example.com");

        event.addAttendee(attende);
        eventNotificationService.announce(event);

        List <Notification> notifications = attende.getNotifications();

        for (Notification notification : notifications) {
            assertEquals("The next big event is coming!",notification.getMessage());

    }
        verify( attende, times(1)).getNotifications();
    }
}

Id like to add some verify method but i get the org.mockito.exceptions.misusing.NotAMockException: Argument passed to verify() is of type Attendee and is not a mock!

Anyone have some idea why??? i tried different combinations but always get same error.

thank you very much!!!!!!!!!!!

Sara
  • 31
  • 1
  • 3

0 Answers0