You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The test using DeepObject is only mimicking the testDeepObjectMapParam but using a record instead of a Map. The funny thing is it fails only a few cases but not always the same lines (in my runs, lines 1, 3, 5 or just 3 and 4 from the CsvSource).
The failure always is about the order of evaluation of the values in the expansion:
[3] template={#id*}, expected=#one=alpha,two=bravo :
Expected :#one=alpha,two=bravo
Actual :#two=bravo,one=alpha
[4] template={;id*}, expected=;one=alpha;two=bravo
Expected :;one=alpha;two=bravo
Actual :;two=bravo;one=alpha
I also noticed that if the test method testDeepObjectParam is copied as the sole test in another test class, different cases fail (!)
(Perhaps some race condition is occurring?)
Shouldn't this expansion produce predictable results? (Not that it matters for the expanded URI)
Final note: the HashMap is evaluated in the same way, but this is a happy case. If I use Map.of("one","alpha","two","bravo") the test testDeepObjectMapParam will start failing as well a few cases.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I was playing with UriTemplate and I wrote a JUnit 5 test to check if it implements all of the features shown in URI.js.
In the test
testDeepObjectParam
I am using a record defined as:The test using
DeepObject
is only mimicking thetestDeepObjectMapParam
but using arecord
instead of aMap
. The funny thing is it fails only a few cases but not always the same lines (in my runs, lines 1, 3, 5 or just 3 and 4 from theCsvSource
).The failure always is about the order of evaluation of the values in the expansion:
I also noticed that if the test method
testDeepObjectParam
is copied as the sole test in another test class, different cases fail (!)(Perhaps some race condition is occurring?)
Shouldn't this expansion produce predictable results? (Not that it matters for the expanded URI)
Final note: the HashMap is evaluated in the same way, but this is a happy case. If I use
Map.of("one","alpha","two","bravo")
the testtestDeepObjectMapParam
will start failing as well a few cases.Beta Was this translation helpful? Give feedback.
All reactions