@Test
public void testDereferenceAllConfig() throws IOException {

  AgentProviderService aps = createAgentProviderService(new Configuration());
  Map<String, Map<String, String>> allConfigs = new HashMap<String, Map<String, String>>();
  Map<String, String> cfg1 = new HashMap<String, String>();
  cfg1.put("a1", "0${@//site/cfg-2/A1}");
  cfg1.put("b1", "22");
  cfg1.put("c1", "33");
  cfg1.put("d1", "${@//site/cfg1/c1}AA");
  Map<String, String> cfg2 = new HashMap<String, String>();
  cfg2.put("A1", "11${@//site/cfg1/b1}");
  cfg2.put("B1", "${@//site/cfg-2/A1},${@//site/cfg-2/A1},AA,${@//site/cfg1/c1}");
  cfg2.put("C1", "DD${@//site/cfg1/c1}");
  cfg2.put("D1", "${14}");
  allConfigs.put("cfg1", cfg1);
  allConfigs.put("cfg-2", cfg2);
  aps.dereferenceAllConfigs(allConfigs);
  Assert.assertEquals("01122", cfg1.get("a1"));
  Assert.assertEquals("22", cfg1.get("b1"));
  Assert.assertEquals("33", cfg1.get("c1"));
  Assert.assertEquals("33AA", cfg1.get("d1"));
  Assert.assertEquals("1122", cfg2.get("A1"));
  Assert.assertEquals("1122,1122,AA,33", cfg2.get("B1"));
  Assert.assertEquals("DD33", cfg2.get("C1"));
  Assert.assertEquals("${14}", cfg2.get("D1"));
}