RequestTest.testQueryParams:479 Should return the query parameter names: arrays first differed at element [0]; expected:<[items]> but was:<[sort]>
Why it fails:
Line 471 Map<String, String[]> params = new HashMap<>(); ofsrc/test/java/spark/RequestTest.java defines a HashMap, which makes no guarantee about the iteration order. The specification about HashMap says that "This class makes no guarantees as to the order of the map; in particular, it does not guarantee that the order will remain constant over time".
This PR is to fix a flaky test
spark.RequestTest#testQueryParams
, we found it when using the latest version of spark:Map<String, String[]> params = new HashMap<>();
ofsrc/test/java/spark/RequestTest.java
defines aHashMap
, which makes no guarantee about the iteration order. The specification about HashMap says that "This class makes no guarantees as to the order of the map; in particular, it does not guarantee that the order will remain constant over time".HashMap
intoLinkedHashMap
.