@Test
public void testSendRoleMemberRemindersException() {

    DBService dbsvc = Mockito.mock(DBService.class);
    NotificationService mockNotificationService =  Mockito.mock(NotificationService.class);
    NotificationServiceFactory testfact = () -> mockNotificationService;
    // we're going to throw an exception when called
    Mockito.when(dbsvc.getRoleReviewMembers(1)).thenThrow(new IllegalArgumentException());
    NotificationManager notificationManager = getNotificationManager(dbsvc, testfact);
    RoleMemberReviewNotificationTask roleMemberReviewNotificationTask = new RoleMemberReviewNotificationTask(dbsvc, USER_DOMAIN_PREFIX);
    // to make sure we're not creating any notifications, we're going
    // to configure our mock to throw an exception
    Mockito.when(mockNotificationService.notify(any())).thenThrow(new IllegalArgumentException());
    try {
        roleMemberReviewNotificationTask.getNotifications();
        fail();
    } catch (Exception ex) {
        assertTrue(ex instanceof IllegalArgumentException);
    }
    notificationManager.shutdown();
}