Bryson Edwards
04/23/2025, 6:20 PMAlex Jircan
04/24/2025, 9:05 AMAbhishek R Prasad
04/25/2025, 8:14 AMEdiba Zugor
04/25/2025, 9:35 AM"serveEventListeners": [
{
"name": "webhook",
"parameters": {
"method": "POST",
"url": "https://......",
"headers": {
"Accept": "application/json; charset=utf-8; version=1",
"Content-Type": "application/json"
},
"body": "{\"test\": \"{{regexExtract originalRequest.query.token '^[^.]+\\.([^.]+)\\..*$' 'parts.1'}}\"}"
}
}
]
Mitch Smith
04/25/2025, 6:47 PM.jar
in the /var/wiremock/extensions
folder, but it doesn't seem to load the extension (rebuilt image, recreated container, and startup log displays all my other exceptions but not this one)
edit - answered my own question 🙂Ed
04/29/2025, 7:53 AMEd
04/29/2025, 7:57 AMjava -jar .\wiremock-standalone-3.13.0.jar --print-all-network-traffic
I have a json file in the mappings directory that configure the proxy and should remove Authorization header:
{
"request": {
"method": "POST",
"url": "/notification"
},
"response": {
"proxyBaseUrl": "<http://localhost:8081>",
"removeProxyRequestHeaders": [
"Authorization"
]
}
}
but at the end, the Authorization header is still sent to the final server
did I miss anything?Abhishek R Prasad
04/30/2025, 6:10 AMcurl --request POST \ --url <http://localhost:8080/__admin/mappings> \ --header 'content-type: application/json' \ --data '{ "priority": 15, "request": { "method": "GET", "urlPath": "/reports/awb/tracking", "queryParameters": { "clientId": { "equalTo": "323245" }, "language": { "equalTo": "en" }, "awb[]": { "matches": ".+" } } }, "response": { "status": 200, "headers": { "Content-Type": "application/json" }, "jsonBody": { "status": "success", "data": [ { "awbNumber": "{{request.query.awb[0]}}", "content": "test", "confirmation": { "name": "test", "date": "2023-03-06 13:58" }, "returnAwbNumber": null, "events": [ { "id": "H4", "name": " Shipment sorted on the belt", "location": "Bucharest", "date": "2023-03-01 04:46:46" }, { "id": "H10", "name": " Shipment in transit towards the destination warehouse ", "location": "Bucharest", "date": "2023-03-01 05:19:10" } ] } ] }, "transformers": [ "response-template" ] }, "persistent": true }'
I have deployed Wiremock using Flux (kubernetes) and I am using the below arguments :
args:
- "--no-request-journal"
- "--disable-request-logging"
- "--max-template-cache-entries=50"
- "--local-response-templating"
- "--root-dir"
- "/mnt/azure"
not sure why "--local-response-templating" does not work in this case.
Could you please let me know how I can fix this 🙂 .Claudio Waldvogel
04/30/2025, 9:58 PMpublic class WebhookSigningExtension implements WebhookTransformer {
@Override
public WebhookDefinition transform(ServeEvent serveEvent, WebhookDefinition webhookDefinition) {
System.out.println("WebhookSigningExtension: transform called");
return webhookDefinition;
}
@Override
public String getName() {
return "webhook-signer";
}
}
Code to test the transformer:
public class Main {
public static void main(String[] args) {
WireMockServer wireMockServer = new WireMockServer(
WireMockConfiguration.options().port(8080).extensions(new WebhookSigningExtension())
);
wireMockServer.start();
wireMockServer.stubFor(<http://WireMock.post|WireMock.post>(WireMock.urlPathEqualTo("/webhook"))
.willReturn(WireMock.ok())
.withServeEventListener("webhook", Webhooks.webhook()
.withMethod(<http://RequestMethod.POST|RequestMethod.POST>)
.withUrl("<http://localhost:9898/webhook/test>")
.withHeader("Content-Type", "application/json")
.withBody("{ \"result\": \"SUCCESS\" }"))
);
}
}
Do I have to implement the logic to enabled/disable the transformer by passing custom parameter?
Thanks in advance,
ClaudioPatrick Davy
05/01/2025, 4:27 PMhome/wiremock
directory anymore, it's exactly the same image as the one I pulled and tested locally.
Any ideas what's going on here or potential avenues of investigation?Barns Anderson
05/05/2025, 4:46 AMBackingStore
. I've read that it is specified in the options when we initialise a WireMockServer like this:
WireMockConfiguration config = WireMockConfiguration.options()
.port(8080)
.backingStore(new FileBasedBackingStore("wiremock_data"));
WireMockServer wireMockServer = new WireMockServer(config);
wireMockServer.start();
Where the FileBasedBackingStore
is imported from here: com.github.tomakehurst.wiremock.store.file.FileBasedBackingStore
. However the package structure has changed since then.
Is the BackingStore no longer a thing?
Best wishes and many thanks in advance.Andreas Winter
05/06/2025, 11:28 AMwireMockConfig()
.[...]
.keystorePath(<somePath>)
.keystoreType(KEYSTORE_TYPE)
.keystorePassword(KEYSTORE_PASSWORD)
Ravi Shankar Reddy Kanakaveedu
05/08/2025, 10:26 AMmappings
and __files
folders. When Recording
is enabled we could see actual API call is being made and recordings/stubMappings
are saved in mappings
and __files
, but we want to update existing mappings
instead of creating new files in mappings and __files
folder.
Can someone let us know if it is possible?rishi
05/09/2025, 4:11 AMManish Arora
05/12/2025, 10:43 AM"urlPathPattern": "/v3/item*",
"queryParameters": {
"item": {
"doesNotMatch": "^00000000[1-2]$"
}
}
but it's also matching with another type of request
"urlPathPattern": "/v3/item*",
"queryParameters": {
"product": {
"equalTo": "12312321421"
}
}
My understanding is that because in second json request item is null but it's satisfying condition for
"doesNotMatch": "^00000000[1-2]$"
which is why wiremock is responding with stub mapped to first reques while ideally it should respond with stub for second mapping.
I know with priority this can fixed but in my application already priorities are set and getting messed up.
Does wiremock provide anything for such scenario ?Anil Mullamuri
05/13/2025, 8:31 AMjunwei chen
05/14/2025, 1:44 AMEkaterina Blech
05/15/2025, 12:29 PMty
05/17/2025, 3:53 PMStubRequestFilterV2
be suitable for doing something like this? one that re-writes the body the of the requests using information passed to the transformers via the specific test?
(oops posted in the wrong spot, also details in thread)Jonathan Pink
05/19/2025, 11:51 AMabsent
feature with matchesJsonPath
when attempting to filter request logs.
I'll explain below 👍
if I check equality of the $.entitlementId
alone returns 1 request.
Request:
POST /requests/count
{
"method": "POST",
"urlPathPattern": "/merchant-entitlement/ns/804c2d9f-3689-4095-8403-fd0525fb834b/entitlements",
"bodyPatterns": [
{
"matchesJsonPath": {
"expression": "$.entitlementId",
"equalTo": "e331678d-160a-4530-a966-57341666b0b2"
}
}
]
}
Response: 200 OK
{
"count": 1,
"requestJournalDisabled": false
}
So this is evidence that the property appears in the log and is equal.
if I switch it to use absent
My expectation is that this will check if the field itself exists - so I perform the following request:
POST /requests/count
{
"method": "POST",
"urlPathPattern": "/merchant-entitlement/ns/804c2d9f-3689-4095-8403-fd0525fb834b/entitlements",
"bodyPatterns": [
{
"matchesJsonPath": {
"expression": "$.entitlementId",
"absent": false
}
}
]
}
Response: 200 OK
{
"count": 0,
"requestJournalDisabled": false
}
My thinking here that I am checking to ensure the property exists - which it does since the request first request for field equality returns a count of 1.
If I change the above request to "absent":"true"
I would expect it to return the above response like it does e.g "count":0
.
I've tried looking for more information about how absent
works but haven't been able to locate it so I'm hoping someone here can support 🙏 thank you
Further note: before I went down a bit of a rabbit hole here - my core requirement was to use this endpoint to ensure fields in requests do not exist
e.g.
entitlementId == xyz && otherFields does not exist
I'm unsure if this is possible, and if not - is there another way?
wiremock server - docker - wiremock:3.4.1-2Ricardo Moura
05/22/2025, 2:14 AMVadim Chekulaev
05/23/2025, 12:18 PMBenoit LEFEVRE -CAMPUS-
05/23/2025, 1:17 PMWireMockExtension
I’ve noticing that whenever the json to return is designated with a bodyFileName
that points to a missing file, this error have WM server still returning an answer, but in text/html content type, with the call stack in the HTML body
It’s somehow a bit puzzeling because whenever no stubs match the requested ressource, an error is produced in the log console ... if we use a ConsoleNotifier
to get extra WM informations while tuning our test’s mocks
Is there any way to configure the WM extension in order to also have the missing files exceptions being reported on the console ?Deepak Jayakumar
05/27/2025, 5:59 PMVishnu
05/28/2025, 10:43 AMPieter Hagedoorn
05/28/2025, 1:39 PM{
"name": "aanroep splunk geeft 200 OK",
"priority": 5,
"request": {
"urlPath": "/nl.bkwi.audit.log.grpc.v0100.AuditLog_v0100Service/AuditLogRequest",
"method": "POST"
},
"response": {
"status": 200,
"headers": {
"content-type": "application/grpc",
"grpc-status-name": "OK"
},
"body": "{\"message\": \"hi\"}",
"transformers": [
"response-template"
]
}
}
Pieter Hagedoorn
05/28/2025, 1:40 PMgrpcurl -plaintext \
-d '{"key":"message1", "arguments":["argument1","argument2"]}' \
-proto AuditServiceV1.proto \
-import-path target/protoc-dependencies/ec4b3d39b9b3c3f5186cf878d88e0a4e/nl/bkwi/specification/proto \
-H "X-correlation-id: 1" -v\
localhost:8088 nl.bkwi.audit.log.grpc.v0100.AuditLog_v0100Service/AuditLogRequest
Resolved method descriptor:
rpc AuditLogRequest ( .nl.bkwi.audit.log.grpc.v0100.AuditLogRecord ) returns ( .nl.bkwi.audit.log.grpc.v0100.AuditLogResponse ) {
option (.google.api.http) = { post: "/AuditLog_v0200/AuditLogRequestV2" };
}
Request metadata to send:
x-correlation-id: 1
Response headers received:
content-type: application/grpc
grpc-status-name: OK
matched-stub-id: 5e78e4f5-d7b9-4dd6-8e90-3bd1b7e84b29
matched-stub-name: aanroep splunk geeft 200 OK
Response trailers received:
(empty)
Sent 1 request and received 0 responses
ERROR:
Code: ResourceExhausted
Message: grpc: received message larger than max (577594739 vs. 4194304)
Pieter Hagedoorn
05/28/2025, 1:41 PMJesus Perez
05/29/2025, 2:07 PMwiremock-standalone.jar
), configured to act as an HTTPS proxy using:
--https-port 8443 --enable-browser-proxying
I noticed that WireMock generates a dynamic self-signed CA, and exposes the root certificate at:
/__admin/certs/wiremock-ca.crt
This works fine, I can trust the CA in my clients and avoid SSL errors when intercepting HTTPS traffic. However, I'm looking for a way to
use a custom or persistent CA, so I don’t have to re-export and re-trust the CA every time WireMock restarts...
Does anyone know if there's a way to:
1. Provide a custom CA in standalone mode?
2. Or at least reuse a previously generated CA?
I’m aware this can be done when embedding WireMock as a Java library (caKeystorePath
, etc.), but I’d prefer to keep using the standalone JAR if possible.
Thanks in advance!Deepak Jayakumar
06/02/2025, 5:00 PM