Commit 0472150e authored by Jared Tan's avatar Jared Tan Committed by Jason Song

fix conflict logical in properties namesapce. (#2066)

fix conflict logical in properties config.
parent 1668fa13
......@@ -81,7 +81,7 @@ public class PropertyResolver implements ConfigTextResolver {
keyCount++;
String[] kv = parseKeyValueFromItem(item);
if (kv != null) {
keys.add(kv[0]);
keys.add(kv[0].toLowerCase());
} else {
throw new BadRequestException("line:" + lineCounter + " key value must separate by '='");
}
......
......@@ -28,6 +28,15 @@ public class PropertyResolverTest extends AbstractUnitTest {
}
}
@Test
public void testRepeatKey() {
try {
resolver.resolve(1, "a=b\nb=c\nA=d\nB=e", Collections.emptyList());
} catch (Exception e) {
Assert.assertTrue(e instanceof BadRequestException);
}
}
@Test
public void testAddItemBeforeNoItem() {
ItemChangeSets changeSets = resolver.resolve(1, "a=b\nb=c", Collections.emptyList());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment