### Question:
AuthorityRuleManager { public static boolean isValidRule(AuthorityRule rule) { return rule != null && !StringUtil.isBlank(rule.getResource()) && rule.getStrategy() >= 0 && StringUtil.isNotBlank(rule.getLimitApp()); }  static void register2Property(SentinelProperty<List<AuthorityRule>> property); static void loadRules(List<AuthorityRule> rules); static boolean hasConfig(String resource); static List<AuthorityRule> getRules(); static boolean isValidRule(AuthorityRule rule);  }### Answer:
@Test public void testIsValidRule() { AuthorityRule ruleA = new AuthorityRule(); AuthorityRule ruleB = null; AuthorityRule ruleC = new AuthorityRule(); ruleC.setResource("abc"); AuthorityRule ruleD = new AuthorityRule(); ruleD.setResource("bcd").setLimitApp("abc"); assertFalse(AuthorityRuleManager.isValidRule(ruleA)); assertFalse(AuthorityRuleManager.isValidRule(ruleB)); assertFalse(AuthorityRuleManager.isValidRule(ruleC)); assertTrue(AuthorityRuleManager.isValidRule(ruleD)); }