@Test
public void testGetNotifications() {

    System.setProperty(ZTSConsts.ZTS_PROP_NOTIFICATION_AWS_HEALTH_DOMAIN, "testDomain");
    ZTSClientNotification clientNotification = new ZTSClientNotification(
            "zts.url",
            "role",
            "AWS",
            1592346376,
            false,
            "testDomain"
    );
    RoleMember roleMember1 = new RoleMember();
    roleMember1.setMemberName("user.test1");
    RoleMember roleMember2 = new RoleMember();
    roleMember2.setMemberName("user.test2");
    List<RoleMember> roleMembers = new ArrayList<>();
    roleMembers.add(roleMember1);
    roleMembers.add(roleMember2);
    Role adminRole = new Role();
    adminRole.setRoleMembers(roleMembers);
    adminRole.setName("testDomain:role.admin");
    List<Role> roles = new ArrayList<>();
    roles.add(adminRole);
    when(dataStore.getRolesByDomain(eq("testDomain"))).thenReturn(roles);
    AWSZTSHealthNotificationTask awsztsHealthNotificationTask = new AWSZTSHealthNotificationTask(
            clientNotification,
            dataStore,
            userDomainPrefix,
            serverName);
    List<Notification> notifications = awsztsHealthNotificationTask.getNotifications();
    assertEquals(1, notifications.size());
    assertTrue(notifications.get(0).getRecipients().contains("user.test1"));
    assertTrue(notifications.get(0).getRecipients().contains("user.test2"));
    assertEquals("zts.url;testDomain;role;1592346376;Fail to get token of type AWS. ", notifications.get(0).getDetails().get("awsZtsHealth"));
    assertEquals("testServer", notifications.get(0).getDetails().get("affectedZts"));
    System.clearProperty(ZTSConsts.ZTS_PROP_NOTIFICATION_AWS_HEALTH_DOMAIN);
}