|
58 | 58 | import java.util.Collections; |
59 | 59 | import java.util.HashMap; |
60 | 60 | import java.util.HashSet; |
| 61 | +import java.util.LinkedHashMap; |
61 | 62 | import java.util.List; |
62 | 63 | import java.util.Map; |
63 | 64 | import java.util.Set; |
@@ -451,7 +452,12 @@ void brokerWritePrefixesShareOnlyTheSameRuntimeConfiguration() throws Exception |
451 | 452 | try { |
452 | 453 | for (int index = 0; index < 3; index++) { |
453 | 454 | String path = "/data/prefix" + index + "_"; |
454 | | - Map<String, String> properties = hdfs("viewfs://prefixes"); |
| 455 | + Map<String, String> properties = new LinkedHashMap<>(); |
| 456 | + // SQL preserves spelling and order; the first case-insensitive key survives normalization. |
| 457 | + properties.put("FILE_PATH", path); |
| 458 | + properties.put("FiLe_PaTh\0suffix", path); |
| 459 | + properties.put("FiLe_PaTh \0suffix", path); |
| 460 | + properties.putAll(hdfs("viewfs://prefixes")); |
455 | 461 | properties.put("fs.broker.support", "true"); |
456 | 462 | properties.put("broker.name", "runtime-prefix-test"); |
457 | 463 | properties.put("fs.viewfs.mounttable.prefixes.link./data", "hdfs://nn/base"); |
@@ -484,8 +490,10 @@ void brokerWritePrefixesShareOnlyTheSameRuntimeConfiguration() throws Exception |
484 | 490 | () -> Assertions.assertEquals(profiles.get(0), profiles.get(1)), |
485 | 491 | () -> Assertions.assertNotEquals(profiles.get(0), profiles.get(2)), |
486 | 492 | () -> Assertions.assertEquals(java.util.Arrays.asList(1, 1, 2), childCounts), |
487 | | - () -> Assertions.assertTrue(sentProperties.stream() |
488 | | - .noneMatch(properties -> properties.containsKey("file_path")))); |
| 493 | + () -> Assertions.assertTrue(sentProperties.stream().allMatch(properties -> |
| 494 | + !properties.containsKey("file_path") && !properties.containsKey("FILE_PATH") |
| 495 | + && !properties.containsKey("FiLe_PaTh\0suffix") |
| 496 | + && !properties.containsKey("FiLe_PaTh \0suffix")))); |
489 | 497 | } finally { |
490 | 498 | for (FileSystem outer : outers) { |
491 | 499 | outer.close(); |
|
0 commit comments