Sebastián Gómez
06/26/2024, 3:34 PMJames
06/26/2024, 6:17 PMJames
06/26/2024, 8:33 PMMichael Zelina
06/27/2024, 9:32 AMRainer Scholz
06/27/2024, 10:36 AMrequest
- "urlPathTemplate": "/organizations/{organization}/members/{member}"
inside a serveEventListeners
- "url": "<https://my.organization.net/webhook-processor/organizations/{{originalRequest.path.organization}}/members/{{originalRequest.path.member}}/activated>"
.
It seems that this is only possible inside a response
definition. Any advice e.g. available extensions to help me?Soni Anand
06/27/2024, 11:39 AMCristobal
06/27/2024, 1:53 PMCristobal
06/27/2024, 1:53 PMAngela Yuan
06/27/2024, 5:17 PMhttp://localhost:8080/some/thing
, it just returns a "Not Found" error. Does anyone know what might be causing this problem, such as if I'm not starting WireMock properly, etc.? For context, my .json file is in a folder, and I moved into the auto-generated mappings folderFlavio Oliveira
06/28/2024, 6:52 AMSarah Javier-Sampan
07/02/2024, 11:33 AMAnzar Ahsan
07/02/2024, 6:57 PM<Envelope
xmlns="<http://www.example.com/Envelope>"
xmlns:xsi="<http://www.w3.org/2001/XMLSchema-instance>">
<Header>
<SourceID>SOURCE_ID</SourceID>
<Timestamp>2024-07-01T16:27:26Z</Timestamp>
</Header>
<Body>
<Record>
<Metadata>
<Key>
<Name>RequestNumber</Name>
<Value>REQ12345</Value>
</Key>
</Metadata>
</Record>
</Body>
</Envelope>
Sample Response Payload (JSON):
{
"event": {
"source": "example",
"type": "example_event",
"timestamp": "2024-07-01T16:27:26Z",
"payload": {
"requestNumber": "REQ12345"
}
}
}
XPath Expressions I've Tried:
{{{xpath request.body '//Key[Name="RequestNumber"]/Value/text()'}}}
{{{xpath request.body '//*[local-name()="Key"]//*[local-name()="Name" and text()="RequestNumber"]/*[local-name()="Value"]/text()'}}}
{{{xpath request.body '/*[local-name()="Envelope"]/*[local-name()="Body"]/*[local-name()="Record"]/*[local-name()="Metadata"]/*[local-name()="Key"]/*[local-name()="Name"][text()="RequestNumber"]/following-sibling::*[local-name()="Value"]/text()'}}}
Problem:
I'm getting an UncheckedExecutionException
in WireMock, indicating an issue with the XPath expression. Despite trying various XPath expressions, the correct value is not being extracted and placed into the JSON response.
Request for Help:
Can anyone guide me on the correct way to extract the value from the XML request payload using XPath in WireMock? Any insights or examples would be greatly appreciated. #helpWojtek Zieba
07/03/2024, 2:09 PMcom.github.tomakehurst.wiremock.extension.Extensions
, there’s a call to ServiceLoader#stream
- a method that is not available on Android, even using desugaring.Sarah Javier-Sampan
07/03/2024, 2:58 PMwiremock/
├── dir1/
│ └── stubs/
│ ├── mappings
│ ├── __files
│ └── __admin
└── dir2/
└── stubs/
├── mappings
├── __files
└── __admin
I would like to ask how I can set up different directories in a Dockerfile with different ports using wiremock/wiremock:latest as image. Thanks!Mark Rouse
07/04/2024, 12:53 PMmockserver:
image: "wiremock/wiremock:latest"
container_name: mockserver
volumes:
- $PWD/tests:/home/wiremock
entrypoint: [ "/docker-entrypoint.sh", "--global-response-templating", "--disable-gzip", "--verbose" ]
and even doing:
curl <http://localhost:8080/__admin/mappings>
gives me the following error:
html><head><meta http-equiv='refresh' content='1;url=/login?from=%2F__admin%2Fmappings'/><script>window.location.replace('/login?from=%2F__admin%2Fmappings');</script></head><body style='background-color:white; color:white;'>
Authentication required
<!--
-->
</body></html>
Priyatosh
07/05/2024, 10:48 AM(using standalone flavour)
• org.wiremockwiremock standalone3.6.0
• org.wiremockwiremock grpc extension standalone0.6.0
What I've noticed is, that wiremock stubs work great 💪 using BlockingStubs, If I don't add them I get an error of io.grpc.StatusRuntimeException: NOT_FOUND
, and once I add them they work like a charm 🪄
However,
There was a need to stub the Async stub too, and for that I've tried to create the stubs just in the same way as I did for the Blocking ones, and noticed whether I add stubs or not, I always get the error as io.grpc.StatusRuntimeException: CANCELLED
Not sure what am I missing, any help would be greatly appreciated 🙏Krystian Minta
07/09/2024, 5:39 AMSebastián Gómez
07/09/2024, 1:57 PMproxyBaseUrl
3. Let go traffic to the original destination (out of cluster)
4. Redirect traffic to another service inside the cluster
The problem I'm facing is that for #3 to work I need to redirect the traffic via an external proxy, so I started up WireMock with --proxy-via
but I need to exclude local calls (.svc.cluster.local
) from that proxy (#4). I would usually use the NO_PROXY environment variable, but I don't think that's even available, right? Does anybody has a suggestion?Luis Fernando Tavares Affonso
07/09/2024, 10:31 PMJosué
07/10/2024, 8:51 AM{
"request": {
"method": "GET",
"urlPath": "/service/api/v1/user/username/user%40my-company.com/"
},
"response": {
"status": 200,
"bodyFileName": "abc_getUserByUsername_user%40my-company.com.json",
"headers": {
"Content-Type": "application/json"
}
}
},
{
"request": {
"method": "GET",
"urlPath": "/service/api/v1/user/username/user-high-clv%40my-company.com/"
},
"response": {
"status": 200,
"bodyFileName": "abc_getUserByUsername_user-high-clv%40my-company.com.json",
"headers": {
"Content-Type": "application/json"
}
}
},
{
"request": {
"method": "GET",
"urlPath": "/service/api/v1/user/username/user-non-high-clv%40my-company.com/"
},
"response": {
"status": 200,
"bodyFileName": "abc_getUserByUsername_user-non-high-clv%40my-company.com.json",
"headers": {
"Content-Type": "application/json"
}
}
}
I’m trying to simplify it using urlPathPattern
, I managed to do it in other mocks but not here:
{
"request": {
"method": "GET",
"urlPathPattern": "/service/api/v1/user/username/()/"
},
"response": {
"status": 200,
"bodyFileName": "abc_getUserByUsername_{{request.pathSegments.[5]}}.json",
"headers": {
"Content-Type": "application/json"
}
}
}
The part with ()
is where I’m trying to add the regex, but I tried many variations without successDeepak Kumar
07/11/2024, 8:51 PMDušan Plavak
07/12/2024, 2:03 PMSarah Javier-Sampan
07/18/2024, 6:39 PMSteven Carter
07/18/2024, 7:42 PMPOST /v1/token HTTP/1.1
Host: localhost:54287
traceparent: oa-2a7ac95c456e05294be1ff5e58083ee8-kaldfjl
Content-Type: application/json
Content-Length: 22
{
"test": true
}
Mapping - only included a portion that was relevant
"request": {
"url": "/v1/token",
"method": "POST",
"headers": {
"traceparent": {
"contains": "2a7ac95c456e05294be1ff5e58083ee8"
}
}
}
I'm checking the various endpoints to diagnose like the near misses endpoints, but I can't see any revelant information as to why it wouldn't match. Is there any other things I can check like adding better logging in the docker container that wiremock is running inside?Алейдин Караимин
07/21/2024, 8:49 AM127.0.0.1 - POST /com.example.MyService/GetStatus
content-type: [application/grpc]
te: [trailers]
user-agent: [grpc-java-netty/1.65.0]
grpc-accept-encoding: [gzip]
123
Matched response definition:
{
"status" : 200,
"body" : "{\n \"id\": \"123\"\n}",
"headers" : {
"grpc-status-name" : "OK"
}
}
Response:
HTTP/2.0 200
grpc-status-name: [OK]
Matched-Stub-Id: [657ca985-dc4e-4da5-8c6b-07de073d8b8d]
And this is the error log from my application code (grpc-java)
io.grpc.StatusRuntimeException: UNKNOWN: HTTP status code 200
invalid content-type: null
headers: Metadata(:status=200,grpc-status-name=OK,matched-stub-id=657ca985-dc4e-4da5-8c6b-07de073d8b8d)
DATA-----------------------------
{
"id": "123"
}
DATA-----------------------------
at io.grpc.stub.ClientCalls.toStatusRuntimeException(ClientCalls.java:268) ~[grpc-stub-1.65.0.jar:1.65.0]
at io.grpc.stub.ClientCalls.getUnchecked(ClientCalls.java:249) ~[grpc-stub-1.65.0.jar:1.65.0]
It is really strange. The :status
should have been set to 0 I guessAngela Yuan
07/24/2024, 6:41 PM%ae
.
For context, my problem was that WireMock is complaining that it's not a valid UTF-8 (but, I validated that the file getting written is UTF-8, and it's getting read as UTF-8).
Does anyone have recommendations on getting past this issue?cc cc
07/25/2024, 8:03 AMRavindra VL
07/25/2024, 9:03 AMresponse-template
?
eg: [A-Z]{3}[0-9]{5}
should produce ABC12345, XYZ54321 etcBryson Edwards
07/25/2024, 1:56 PMManojkumar Kasiviswanathan
07/26/2024, 10:39 AM