Different Output for Test Between IntelliJ and Maven?

36 Views Asked by At

I have a simple check with ObjectMapper.writeValueAsString for a test to verify that no input have been changed without a developer having noticed it. It works fine but the issue is that the length diffs between JUnit and Maven.

I have tried the following things to correct it:

  • Cleaned the cache of IntelliJ
  • Verified that both of them run the same version of ObjectMapper (2.14.2)
  • Removed all .m2 artifacts in case something was causing issue in there
1

There are 1 best solutions below

0
David S On

Finally found it! It was locale that was playing tricks on me, in normal JUnit it defaulted to 'EN' but in maven it was 'EN_US' so appended extra characters in multiple places.