@Test
public void testSendRoleMemberExpiryRemindersNoValidDomain() {

    DBService dbsvc = Mockito.mock(DBService.class);
    List<MemberRole> memberRoles = new ArrayList<>();
    memberRoles.add(new MemberRole().setRoleName("role1")
            .setDomainName("athenz1")
            .setMemberName("user.joe")
            .setExpiration(Timestamp.fromMillis(100)));
    DomainRoleMember domainRoleMember = new DomainRoleMember()
            .setMemberRoles(memberRoles);
    Map<String, DomainRoleMember> expiryMembers = new HashMap<>();
    expiryMembers.put("user.joe", domainRoleMember);
    // 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.getRoleExpiryMembers(1))
            .thenReturn(null)
            .thenReturn(expiryMembers);
    ZMSTestUtils.sleep(1000);
    // we're going to return not found domain always
    Mockito.when(dbsvc.getAthenzDomain("athenz1", false)).thenReturn(null);
    List<Notification> notifications = new RoleMemberExpiryNotificationTask(dbsvc, USER_DOMAIN_PREFIX).getNotifications();
    // we should get 0 notifications
    assertEquals(notifications, new ArrayList<>());
}