@Test
public void testSendPendingGroupMembershipApprovalReminders() {

    DBService dbsvc = Mockito.mock(DBService.class);
    NotificationService mockNotificationService =  Mockito.mock(NotificationService.class);
    NotificationServiceFactory testfact = () -> mockNotificationService;
    // we're going to return null for our first thread which will
    // run during init call and then the real data for the second
    // call
    Mockito.when(dbsvc.getPendingGroupMembershipApproverRoles(1))
            .thenReturn(null)
            .thenReturn(Collections.singleton("user.joe"));
    NotificationManager notificationManager = getNotificationManager(dbsvc, testfact);
    ZMSTestUtils.sleep(1000);
    PendingGroupMembershipApprovalNotificationTask reminder =
            new PendingGroupMembershipApprovalNotificationTask(dbsvc, 0, "", USER_DOMAIN_PREFIX);
    List<Notification> notifications = reminder.getNotifications();
    // Verify contents of notification is as expected
    assertEquals(notifications.size(), 1);
    Notification expectedNotification = new Notification();
    expectedNotification.setNotificationToEmailConverter(new PendingGroupMembershipApprovalNotificationTask.PendingGroupMembershipApprovalNotificationToEmailConverter());
    expectedNotification.addRecipient("user.joe");
    expectedNotification.setType("pending_group_membership_approval");
    assertEquals(notifications.get(0), expectedNotification);
    notificationManager.shutdown();
}