Gergely Attila Sarosi
03/25/2024, 1:03 PM"id" : "afba10b0-uuid-4f9e-a84e-0947f629e7a6",
"request" : {
"urlPattern" : "/mock/something/urlPattern.*&startdate=.*&enddate=.*",
"method" : "GET"
},
"response" : {
"status" : 200,
"bodyFileName" : "files/response_first.xml",
"headers" : {
"Content-Type" : "application/xml"
}
},
"uuid" : "afba10b0-uuid-4f9e-a84e-0947f629e7a6"
}
Gergely Attila Sarosi
03/25/2024, 1:04 PMGergely Attila Sarosi
03/25/2024, 1:07 PMheaders = {
'Content-Type': 'application/json'
}
mock_json = {
"response": {
"body": 'some new body as response'
}
}
res = requests.patch(url, json=mock_json, headers=headers)
mauricio sanchez
03/25/2024, 8:40 PMholomekc/wiremock-gui
image
https://github.com/wiremock/helm-charts/tree/master/charts/wiremockAleksandr N
03/28/2024, 4:00 AMTom
03/30/2024, 10:31 PMApurb Rajdhan
04/01/2024, 12:28 PMTom
04/02/2024, 10:53 AMMonica McDermott
04/02/2024, 8:27 PMTom
04/04/2024, 3:51 PMLee Turner
04/05/2024, 7:55 AMNuno Frias
04/05/2024, 9:56 AMCelina Kincaid
04/05/2024, 4:13 PMTheUsharik
04/08/2024, 12:31 PMservice EventsService {
rpc GetEvents(GetEventsRequest) returns (stream GeEventsResponse)
}
I want several instances of GetEventResponse to be sent back by WireMockDarko Filipovski
04/09/2024, 9:47 AMjava -Xms4g -Xmx8g -jar .\wiremock-standalone-3.5.2.jar --port 9911
Note: I also experimented with adjusting --container-threads
, --jetty-acceptor-threads
, --async-response-enabled true
, etc. but without success.
I assume that I am making a mistake with the WireMock server setup, but I am not sure where. If the setup seems reasonable, please let me know and I can provide additional information.
Logs when a response results in a 404, even though the mapping exists:
024-04-09 11:43:16.940 Request received:
127.0.0.1 - POST /api
Connection: [Upgrade, HTTP2-Settings]
Content-Length: [312]
Host: [localhost:9911]
HTTP2-Settings: [AAEAAEAAAAIAAAABAAMAAABkAAQBAAAAAAUAAEAA]
Upgrade: [h2c]
Accept: [*/*]
Content-Type: [application/soap+xml; charset=UTF-8]
User-Agent: [Apache-CXF/4.0.3]
<soap:Envelope xmlns:soap="<http://www.w3.org/2003/05/soap-envelope>"><soap:Body><ns2:getDocumentSearchResults xmlns:ns2="<http://ws.soap.transfer.services.sedna.ser.com/>"><sessionUUID>{{randomValue type='UUID'}}</sessionUUID><start>71</start><end>80</end></ns2:getDocumentSearchResults></soap:Body></soap:Envelope>
Matched response definition:
(no response definition configured)
Response:
HTTP/1.1 404
(no headers)
2024-04-09 11:43:17.001
Request was not matched
=======================
-----------------------------------------------------------------------------------------------------------------------
| Closest stub | Request |
-----------------------------------------------------------------------------------------------------------------------
|
POST | POST
/api | /api
|
[Scenario 'Get documents result' state: | [Scenario 'Get documents result' state: <<<<< Scenario does not match
getDocumentSearchResults-55] | getDocumentSearchResults-5]
|
-----------------------------------------------------------------------------------------------------------------------
Sample mapping. The remaining states match this pattern:
{
"scenarioName": "Get documents result",
"requiredScenarioState": "getDocumentSearchResults-5",
"newScenarioState": "getDocumentSearchResults-6",
"request": {
"method": "POST",
"url": "/api",
"bodyPatterns": [
{
"matchesXPath": "/soap:Envelope/soap:Body/ws:getDocumentSearchResults",
"xPathNamespaces": {
"soap": "<http://www.w3.org/2003/05/soap-envelope>",
"ws": "<http://ws.soap.transfer.services.sedna.ser.com/>"
}
}
]
},
"response": {
"status": 200,
"headers": {
"Content-Type": "text/xml",
"Cache-Control": "no-cache"
},
"bodyFileName": "paged_search/get-document-search-results-51-60.xml",
"fixedDelayMilliseconds": 300
}
}
Any insight would be beneficial. Thank you!Bhavin Modi
04/11/2024, 5:06 PMOutgoing bytes omitted. Could not decode with charset: UTF-8
I am using the command:
wiremockConfiguration.networkTrafficListener(ConsoleNotifyingWiremockNetworkTrafficListener())
.notifier(ConsoleNotifier(true))
Response printed is below:
Response:
HTTP/2.0 200
Content-Type: [application/json]
X-REQUESTED-METHOD: [GET]
X-RESPONSE-SPEC: [7QTfz4Xe+93JGw6k]
X-RESPONSE-TOKEN: [asds]
X-RESPONSE-BACKEND-TIME: [1712119337372]
X-REQUEST-BACKEND-TIME: [1712119336557]
X-Frame-Options: [DENY]
X-Content-Type-Options: [nosniff]
X-XSS-Protection: [1; mode=block]
strict-transport-security: [max-age=31536000; preload, max-age=31536000]
Content-Encoding: [gzip]
Content-Length: [790]
Expires: [Wed, 03 Apr 2024 04:42:17 GMT]
Cache-Control: [max-age=0, no-cache, no-store]
Pragma: [no-cache]
Date: [Wed, 03 Apr 2024 04:42:17 GMT]
Vary: [Accept-Encoding]
Set-Cookie: [f5avraaaaaaaaaaaaaaaa_session_=IPGLKJGJBJNFJBEEPPHFKLKBDCEINBMODJEMGAPCGADDJHANGDOCLHKGBMJKOJPBBJIDAOPFONLNCHCMAGMAEJMCLNDFCFGOKJJKDMOHIPAKHKLMBLIPIOPAIEJNIBFC; HttpOnly; secure;]
cf-ray: [0.77092e17.1712119336.d696045]
2024-04-02 21:42:17.257 Outgoing bytes omitted. Could not decode with charset: UTF-8
Slack ConversationTom
04/15/2024, 12:48 PMSadineni Vivek
04/16/2024, 9:37 AMMonica McDermott
04/16/2024, 5:07 PMManojkumar Kasiviswanathan
04/17/2024, 1:50 PMManojkumar Kasiviswanathan
04/17/2024, 1:51 PMManojkumar Kasiviswanathan
04/17/2024, 1:51 PM{
"request": {
"method": "GET",
"urlPath": "/example"
},
"response": {
"status": 200,
"transformers": [
"response-template"
],
"bodyFileName": "test.json",
"headers": {
"Content-Type": "application/json",
"correctionID": "1"
}
}
}
Manojkumar Kasiviswanathan
04/17/2024, 1:51 PMManojkumar Kasiviswanathan
04/17/2024, 1:52 PM{
"field1": "if correctionID is 1 {{now offset='1 years' format='yyyy/MM/dd'}} else {{now offset='3 years' format='yyyy/MM/dd'}}",
}Monica McDermott
04/18/2024, 1:10 AMOleg Nenashev
04/18/2024, 3:28 PMLee Turner
04/23/2024, 10:51 AMLee Turner
04/24/2024, 5:57 AMDeepak Kumar
04/24/2024, 6:25 AMTom
04/24/2024, 8:39 AM