@Test
public void testSubstituteConfigKeyPrefix() {

	String deprecatedPrefix1 ="deprecated-prefix";
	String deprecatedPrefix2 ="-prefix-2";
	String deprecatedPrefix3 ="prefix-3";
	String designatedPrefix1 ="p1";
	String designatedPrefix2 ="ppp";
	String designatedPrefix3 ="zzz";
	String depr1 = deprecatedPrefix1 + "var";
	String depr2 = deprecatedPrefix2 + "env";
	String depr3 = deprecatedPrefix2 + "x";
	String desig1 = designatedPrefix1 + "var";
	String desig2 = designatedPrefix2 + "env";
	String desig3 = designatedPrefix2 + "x";
	String val1 = "1";
	String val2 = "2";
	String val3_depr = "3-";
	String val3_desig = "3+";
	// config contains only deprecated key 1, and for key 2 both deprecated and designated
	Configuration cfg = new Configuration();
	cfg.setString(depr1, val1);
	cfg.setString(depr2, val2);
	cfg.setString(depr3, val3_depr);
	cfg.setString(desig3, val3_desig);
	BootstrapTools.substituteDeprecatedConfigPrefix(cfg, deprecatedPrefix1, designatedPrefix1);
	BootstrapTools.substituteDeprecatedConfigPrefix(cfg, deprecatedPrefix2, designatedPrefix2);
	BootstrapTools.substituteDeprecatedConfigPrefix(cfg, deprecatedPrefix3, designatedPrefix3);
	assertEquals(val1, cfg.getString(desig1, null));
	assertEquals(val2, cfg.getString(desig2, null));
	assertEquals(val3_desig, cfg.getString(desig3, null));
	// check that nothing with prefix 3 is contained
	for (String key : cfg.keySet()) {
		assertFalse(key.startsWith(designatedPrefix3));
		assertFalse(key.startsWith(deprecatedPrefix3));
	}
}