Dhruvraj Mishra
11/01/2024, 4:03 PMDirk Bolte
11/01/2024, 4:11 PMDhruvraj Mishra
11/01/2024, 4:18 PMDhruvraj Mishra
11/01/2024, 4:24 PMDirk Bolte
11/03/2024, 2:58 PM"context": "sc nam"
Dirk Bolte
11/03/2024, 3:01 PMdetails
call:
"serveEventListeners": [
{
"name": "deleteState",
"parameters": {
"context": "sc nam"
}
}
]
Dhruvraj Mishra
11/04/2024, 1:20 PMDhruvraj Mishra
11/04/2024, 1:26 PMDirk Bolte
11/04/2024, 1:34 PMPOST /wiremock/res/res1
GET /wiremock/res/res1/details
would work with a static contextDhruvraj Mishra
11/04/2024, 1:39 PMDhruvraj Mishra
11/04/2024, 1:40 PMDirk Bolte
11/04/2024, 1:40 PMPOST /wiremock/res/res1
GET /wiremock/res/res1/details
POST /wiremock/res/res1
GET /wiremock/res/res1/details
POST /wiremock/res/res1
GET /wiremock/res/res1/details
Dhruvraj Mishra
11/04/2024, 1:41 PMDhruvraj Mishra
11/04/2024, 1:42 PMDirk Bolte
11/04/2024, 1:43 PMDhruvraj Mishra
11/04/2024, 1:43 PMDirk Bolte
11/04/2024, 1:44 PMDirk Bolte
11/04/2024, 1:44 PMDirk Bolte
11/04/2024, 1:44 PMDhruvraj Mishra
11/04/2024, 1:46 PMDhruvraj Mishra
11/04/2024, 1:46 PMDirk Bolte
11/04/2024, 1:48 PMGET
returns a specific response body, does it match the order of your requests? Like a queue?Dhruvraj Mishra
11/04/2024, 1:49 PMDhruvraj Mishra
11/04/2024, 1:50 PMDirk Bolte
11/04/2024, 1:53 PMlist
might help. You have one context and on every POST
, you do a addLast
. In the response, you just access the first element of the list ([0]
) and do a deleteLast
in the serveEventListener
.
There's an example for such a behavior in the project: https://github.com/wiremock/wiremock-state-extension/blob/develop/src/test/java/or[…]k/extensions/state/examples/StateExtensionQueueExampleTest.javaDhruvraj Mishra
11/04/2024, 1:59 PMDhruvraj Mishra
11/04/2024, 1:59 PMDhruvraj Mishra
11/04/2024, 2:00 PMDirk Bolte
11/04/2024, 2:02 PMDhruvraj Mishra
11/05/2024, 4:20 AM{{state context='hardContext' list='[0].properyt1' default='[]'}}
I'm deleting the list firstValue after GET Resp is returned using-
"serveEventListeners": [
{
"name": "deleteState",
"parameters": {
"context": "hardContext",
"list": {
"deleteFirst": true
}
}
}
]
BUT, when I hit the GET multiple times, it keeps on returning the same properyt1. Seems deletion is not taking place or correct me for syntaxDirk Bolte
11/05/2024, 6:37 AMDhruvraj Mishra
11/05/2024, 6:38 AMDhruvraj Mishra
11/05/2024, 6:39 AMDirk Bolte
11/05/2024, 6:40 AMDhruvraj Mishra
11/05/2024, 7:56 AMDhruvraj Mishra
11/05/2024, 10:04 AMDirk Bolte
11/05/2024, 11:16 AMDhruvraj Mishra
11/05/2024, 11:40 AMDhruvraj Mishra
11/05/2024, 2:30 PMDirk Bolte
11/05/2024, 4:11 PMDirk Bolte
11/05/2024, 9:59 PM<resources>
<Id>02322</Id>
<hkId>2</hkId>
</resources>
I adapted the xpath matcher to
"bodyPatterns": [
{
"matchesXPath": "//resources/Id[contains(text(),'02322')]"
}
]
and it exactly behaved as intended: the responses contained the hkId in reverse order. Once empty, I get the default value defined in the stub mapping ([]
) .
If you still encounter issues, please provide an isolated + reduced project including a failing test to help isolating the issue.Dhruvraj Mishra
11/09/2024, 4:38 PM