chore: Fix non-string state variable serialization - #1318
Conversation
|
Thanks for this! This is a hold over from when state variables were only strings. However, I think it would be better to serialise all things to json, not just non strings. This matches the behaviour of the other cross-language communication. Also, because this fix is directly in the internals layer, I believe this fix will break javascript clients. It's possible we don't have a test that covers it. Either way, I'll sort this out and get it released. |
The other reason for this is that otherwise you can't tell the difference between a string that is |
|
Thanks for this. I'm releasing a new version now. It won't pass your test of: because
|
Problem I encountered
When using the Java DSL, I was experimenting with state variables.
I used InStateWithVariables like so:
In my
IndividualSuccessTestConfigBuilder.withTestResponse, I found found the following problem:Cause
In the gRPC layer, you assign set the value of a
StringValueto the mapper state variable value. The value inside Contract Case is an integer.StringValuecan't take integers, and sets its value to""if you try.Fix
Map the values to strings.
Note
The
mockvalue right next to this also remains unmapped. This didn't affect me and I don't know anything about themockfield, so I didn't touch it, but it's possible that is a similar bug. If so, you might wanna fix that too.