Open ksawerykarwacki opened 1 week ago
What version of Pact-JVM are you using?
4.6.13
I have no idea how to replicate this. This test https://github.com/pact-foundation/pact-jvm/blob/master/core/support/src/test/java/au/com/dius/pact/core/support/json/JsonParserTest.java runs on my Windows machine and also on the GitHub Windows agent (see https://github.com/pact-foundation/pact-jvm/actions/runs/11043621468/job/30678203735) without any issue.
The JSON parser uses java.lang.Character
to check the chars in the string, and according to the Java docs the escape sequences are platform independent. There must be something on your system that is modifying the string values on Windows.
I have the same problem. I have a feeling it's because of how the shells handle systemProperties in Windows differently than on MacOS.
Also there seems to be a difference when run from Intellij or from shell directly.
I tried to pass
pactbroker.consumerversionselectors.rawjson
parameter to Gradle Test task as system property for my junit tests.I tried raw string without success, I tried building in with Gson like this:
Finally, after some more debugging it seems it does not properly handle escaping acrost multiple systems. Currently the only working solution looks like this:
If I use windows one then Linux will keep complain about unrecognized
\
characterif I use linux version (single ) or any standard lib implementation (like Gson) windows will complain: