Search in sources :

Example 6 with AlertPolicy

use of com.ctrip.xpipe.redis.console.alert.policy.AlertPolicy in project x-pipe by ctripcorp.

the class AlertPolicyManagerTest method queryRecepients.

@Test
public void queryRecepients() throws Exception {
    AlertPolicy policy = policyManager.alertPolicyMap.get(SendToDBAAlertPolicy.ID);
    List<String> expected = policy.queryRecipients(new AlertEntity(null, null, null, null, null, ALERT_TYPE.MARK_INSTANCE_UP));
    logger.info("[testQueryRecepients] emails: {}", expected);
    Assert.assertEquals(expected, policyManager.queryRecepients(alert));
}
Also used : AlertPolicy(com.ctrip.xpipe.redis.console.alert.policy.AlertPolicy) SendToDBAAlertPolicy(com.ctrip.xpipe.redis.console.alert.policy.SendToDBAAlertPolicy) AlertEntity(com.ctrip.xpipe.redis.console.alert.AlertEntity) AbstractConsoleIntegrationTest(com.ctrip.xpipe.redis.console.AbstractConsoleIntegrationTest) Test(org.junit.Test)

Aggregations

AlertPolicy (com.ctrip.xpipe.redis.console.alert.policy.AlertPolicy)6 SendToDBAAlertPolicy (com.ctrip.xpipe.redis.console.alert.policy.SendToDBAAlertPolicy)6 SendToRedisClusterAdminAlertPolicy (com.ctrip.xpipe.redis.console.alert.policy.SendToRedisClusterAdminAlertPolicy)4 SendToXPipeAdminAlertPolicy (com.ctrip.xpipe.redis.console.alert.policy.SendToXPipeAdminAlertPolicy)4 AbstractConsoleIntegrationTest (com.ctrip.xpipe.redis.console.AbstractConsoleIntegrationTest)2 Test (org.junit.Test)2 AlertEntity (com.ctrip.xpipe.redis.console.alert.AlertEntity)1