/**
  * Tests the {@code appliesToEntry} method.
  *
  * @param rule The rule for which to perform the test.
  * @param appliesToEntry Indicates whether the provided rule applies to a minimal "o=test" entry.
  * @throws Exception If an unexpected problem occurs.
  */
 @Test(dataProvider = "testRules")
 public void testAppliesToEntry(VirtualAttributeRule rule, boolean appliesToEntry)
     throws Exception {
   TestCaseUtils.initializeTestBackend(true);
   addGroups();
   assertEquals(
       rule.appliesToEntry(DirectoryConfig.getEntry(DN.decode("o=test"))), appliesToEntry);
   removeGroups();
 }
 /**
  * Tests the various getter methods in the virtual attribute rule class.
  *
  * @param rule The rule for which to perform the test.
  * @param appliesToEntry Indicates whether the provided rule applies to a minimal "o=test" entry.
  */
 @Test(dataProvider = "testRules")
 public void testGetters(VirtualAttributeRule rule, boolean appliesToEntry) {
   assertEquals(rule.getAttributeType(), entryDNType);
   assertEquals(
       rule.getProvider().getClass().getName(), EntryDNVirtualAttributeProvider.class.getName());
   assertNotNull(rule.getBaseDNs());
   assertNotNull(rule.getGroupDNs());
   assertNotNull(rule.getFilters());
   assertNotNull(rule.getConflictBehavior());
 }
 /**
  * Tests the {@code toString} method.
  *
  * @param rule The rule for which to perform the test.
  * @param appliesToEntry Indicates whether the provided rule applies to a minimal "o=test" entry.
  */
 @Test(dataProvider = "testRules")
 public void testToString(VirtualAttributeRule rule, boolean appliesToEntry) {
   String ruleString = rule.toString();
   assertNotNull(ruleString);
   assertTrue(ruleString.length() > 0);
 }