Francislainy Campos
02/10/2022, 8:37 PM{
"consumer": {
"name": "Ed UI"
},
"provider": {
"name": "Viaduct"
},
"interactions": [
{
"description": "A POST request to encode a JSON body of claims from the user",
"providerState": "viaductService encodes a JSON body of claims and returns a JWT string in response",
"request": {
"method": "POST",
"path": "/edcore/viaduct-service/jwt",
"body": {
"resourceId": "l_fc3ae9ed-62ac-4b94-8094-8dd29bc208a7_c57760a9-447b-42aa-81df-830134425157",
"teacherAssessmentId": "93a91981-c6f7-435f-ab1e-80588ecff2ee",
"expiryUnixEpochSeconds": 26757854170066,
"sub": "UniqueUserId"
}
},
"response": {
"status": 200,
"body": "eyJhbGciOiJIUzI1NiJ9.eyJU2VydmljZ.blabla",
"matchingRules": {
"$.body": {
"match": "type"
}
}
}
},
],
"metadata": {
"pactSpecification": {
"version": "2.0.0"
}
}
}
However, our provider tests (Java) fail with Expected body 'eyJhbGciOiJIUzI1NiJ9.eyJU2VydmljZ.blabla' to match 'eyJhbGciOiJIUzI1NiJ9.eyJzd.bla' using equality but did not match
. Not sure where the issue could be coming from. Initially I thought it might be related to the headers blocking the matchers as per https://stackoverflow.com/a/61924547/6654475, but even manually deleting the headers from the contract still give us the same issue, so maybe version related perhaps? <pact.version>4.3.2</pact.version>
Thank you. CC @uglyoguglyog
uglyog
uglyog
Francislainy Campos
02/11/2022, 5:04 AM"request": {
"method": "POST",
"path": "/edcore/viaduct-service/jwt",
"headers": {
"Content-Type": "application/json",
"accept": "application/json"
},
"body": {
"resourceId": "l_fc3ae9ed-62ac-4b94-8094-8dd29bc208a7_c57760a9-447b-42aa-81df-830134425157",
"teacherAssessmentId": "93a91981-c6f7-435f-ab1e-80588ecff2ee",
"expiryUnixEpochSeconds": 26757854170066,
"sub": "UniqueUserId"
}
},
"response": {
"status": 200,
"headers": {
"Content-Type": "application/json"
},
"body": "eyJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJWaWFkdWN0U2Vydm.blabla",
"matchingRules": {
"$.body": {
"match": "type"
}
}
}
uglyog
uglyog
16:33:29.216 [DEBUG] [au.com.dius.pact.core.matchers.JsonBodyMatcher] compareValues: Matcher defined for path [$]
16:33:29.216 [DEBUG] [au.com.dius.pact.core.matchers.MatcherExecutor] comparing type of "eyJhbGciOiJIUzI1NiJ9.eyJzd.bla" to "eyJhbGciOiJIUzI1NiJ9.eyJU2VydmljZ.blabla" at [$]
uglyog
uglyog
"body": "\"eyJhbGciOiJIUzI1NiJ9.eyJU2VydmljZ.blabla\"",
uglyog
Francislainy Campos
02/11/2022, 6:20 AM<pact.version>4.3.2</pact.version>
Francislainy Campos
02/11/2022, 6:48 AMFrancislainy Campos
02/11/2022, 11:01 AMFrancislainy Campos
02/11/2022, 11:03 AM