Search in sources :

Example 11 with BasicJanitorRuleEngine

use of com.netflix.simianarmy.basic.janitor.BasicJanitorRuleEngine in project SimianArmy by Netflix.

the class TestBasicJanitorMonkeyContext method testAddRuleWithoutUntaggedRuleResource.

@Test
public void testAddRuleWithoutUntaggedRuleResource() {
    JanitorRuleEngine ruleEngine = new BasicJanitorRuleEngine();
    Boolean untaggedRuleEnabled = new Boolean(true);
    Rule rule = new UntaggedRule(monkeyCalendar, SIMIANARMY_JANITOR_RULE_UNTAGGEDRULE_REQUIREDTAGS, SIMIANARMY_JANITOR_RULE_UNTAGGEDRULE_RETENTIONDAYSWITHOWNER, SIMIANARMY_JANITOR_RULE_UNTAGGEDRULE_RETENTIONDAYSWITHOUTOWNER);
    if (untaggedRuleEnabled && getUntaggedRuleResourceSet().contains("ASG")) {
        ruleEngine.addRule(rule);
    }
    Assert.assertFalse(ruleEngine.getRules().contains(rule));
}
Also used : UntaggedRule(com.netflix.simianarmy.aws.janitor.rule.generic.UntaggedRule) BasicJanitorRuleEngine(com.netflix.simianarmy.basic.janitor.BasicJanitorRuleEngine) UntaggedRule(com.netflix.simianarmy.aws.janitor.rule.generic.UntaggedRule) BasicJanitorRuleEngine(com.netflix.simianarmy.basic.janitor.BasicJanitorRuleEngine) Test(org.testng.annotations.Test)

Aggregations

BasicJanitorRuleEngine (com.netflix.simianarmy.basic.janitor.BasicJanitorRuleEngine)11 Test (org.testng.annotations.Test)11 AWSResource (com.netflix.simianarmy.aws.AWSResource)9 TestMonkeyCalendar (com.netflix.simianarmy.aws.janitor.rule.TestMonkeyCalendar)9 DateTime (org.joda.time.DateTime)4 UntaggedRule (com.netflix.simianarmy.aws.janitor.rule.generic.UntaggedRule)2