Hi, I’m currently stuck with how pact is populatin...
# pact-jvm
l
Hi, I’m currently stuck with how pact is populating a provider state parameter. Its converting an Integer to a String. In my consumer everything works and contract generated correctly: I have the following line in my request body ``accountId: fromProviderState('${accountId}', accountId)`` In the debug logs I can see it populating correctly with correct type Calling match_values for path $.accountId
Comparing '1686819389' to '1686819389' using Type -> Ok(())
Comparing 'Number(<tel:1686819389|1686819389>)' to 'Number(<tel:1686819389|1686819389>)' at path '$.accountId' -> Ok(())
body: '{……..  ,"accountId":1686819389}'
In my provider:
int accountId = 2;
providerStateParameters.put(_ACCOUNT_ID_, accountId);
In the debug logs:
****I set my account id as: 1689080143238***
body: PRESENT({………..,"accountId":"1689080143238"})
Both consumer (pact-js) and provider (pact-jvm) are on the latest version
m
hmm it looks to be a similar bug to https://github.com/pact-foundation/pact-reference/issues/298 (that’s a different reference implementation, but perhaps it copied/has the same problem as the JVM or vice versa)
l
any idea of if there would be a way to override it? my test will always fail because the API requires type number
m
Unfortunately not, sorry. Mind raising a defect on Pact JVM?