I'm running into a strange situation which I reproduced in https://github.com/lgueye/uri-parameters-behavior
Since we migrated to spring-boot 2 (spring framework 5) when requesting one of our backends in GET method we ran into the following situation: all fields with a + char were altered to (whitespace) char when they reached the backend
The following values are altered:
- +412386789 (phone number) into ** 412386789**
- 2019-03-22T17:18:39.621+02:00 (java8 ZonedDateTime) into 2019-03-22T17:18:39.621 02:00 (resulting in a org.springframework.validation.BindException
I've spent quite some time on stackoverflow (https://github.com/spring-projects/spring-framework/issues/14464#issuecomment-453397378) and github (https://github.com/spring-projects/spring-framework/issues/21577)
I've implemented both a mockMvc unit test and an integration test
The unit test behaves properly The integration test fails (like our production)
Can anyone point help me fix this issue ? My goal is obviously to make the integration test pass.
Thank you for your help.
Louis
After some fight with this issue I finally got it to work the way we expect it in our company.
The offending component is not spring-boot but rather UriComponentsBuilder
My initial failing test looks like this:
The working version looks like this:
Note 4 required differences:
I'm a bit sad because all this is quite error prone and crumbersome (specially the Map/MultiValueMap part). I would gladly have them generated from a java bean.
This has a big impact on our solution but I'm afraid we won't have a choice. We'll settle for this solution for now.
Hope this helps others facing this issue.
Best,
Louis