DEV Community

Discussion on: Json conversion errors with Spring MockMvc

 
piczmar_0 profile image
Marcin Piczkowski • Edited
  1. I'm talking about unit tests as such that do not require whole spring context to start.

  2. That won't work because of the library limitation. I see your point but that's how the asserts works. If you try to compare "to-string" expected value with the decimal value from controller they will fail. The library would need to convert the decimals somewhow to string before the assert and this would also be a smelly hack :) In current state you'll get:

java.lang.AssertionError: JSON path "$.value"
Expected: is "0.071854545056424"
     but: was <0.071854545056424>
Expected :is "0.071854545056424"

Actual   :<0.071854545056424>