Questions tagged [wiremock-standalone]
119 questions
2
votes
1 answer
Dynamic wiremock to capture path parameter and return in response
I am trying to create dynamic mocks using WireMock. I have a situation where if I specify URL like
http://localhost:8989/api/account/121
then I should receive response like this:
"cycleSpecification": {
"id": "121"
}
}
In brief,…

sagar verma
- 404
- 4
- 10
2
votes
0 answers
Use JSON schema check on POST request with WireMock
I'm using WireMock (Docker) docker.io/rodolpheche/wiremock:2.27.2-alpine. I set it up via Docker Compose and everything works flawlessly.
I'm trying to set up a stub/mapping to check the JSON input against the corresponding JSON schema. Basically,…

x80486
- 6,627
- 5
- 52
- 111
2
votes
0 answers
Wiremock, get request mappings with absoluteUrl that shows host
I am checking all the stubs using http://localhost:9001/__admin/mappings.
Pls can you tell if there is a flag we can add in this path http://localhost:9001/__admin/mappings, which can list all mappings with absoluteUrl, just not urlPathPattern.
I…

ApprenticeWST
- 117
- 1
- 7
2
votes
1 answer
How we can ignore the order of query parameter in WireMock
Suppose I have endpoint:
/url?number="321"&name="TEST" but when we are matching a request matching how we want to ignore the order of query parameter(ignore order of query param)
In this case if pass query param in query param tag then I will not…

Piyush Garg
- 37
- 2
- 10
2
votes
0 answers
Disable Request Journaling, without restarting
I want to proxy requests and then snapshot them using Wiremock. So I have to have request-journaling enabled. But for subsequent runs, after taking the snapshot, I don't really need this functionality, is there a way to switch the config, without…

uncaught_exceptions
- 21,712
- 4
- 41
- 48
2
votes
1 answer
How to remove the last comma in an each loop in Wiremock
I need to write a stub for a request that would look something like this:
[
{ "todo_id": 1 },
{ "todo_id": 2 }
]
The number of todo objects in the request can vary.
My response currently looks like this:
"response": {
"status": 200,
…

Vilius Gudžiūnas
- 199
- 2
- 11
2
votes
1 answer
How to use mappingsloader in wiremock to load mappings file(s)?
I have created my mappings by recording the server's transactions. Now I want to use my json mapping file(s) to load the mappings. For that I have the code below:
import com.github.tomakehurst.wiremock.WireMockServer;
public class mockedTests{
…

Mansour.M
- 500
- 4
- 18
2
votes
1 answer
Is it possible to mock two ports using Java version of Wiremock-standalone?
I have an app which fetches some data from a url on port 8085. processes the data, then sends it to another url on port 8080 for another process, then processes the response from port 8080 again. Is it possible to have either wiremock or wiremock…

Mansour.M
- 500
- 4
- 18
2
votes
0 answers
Wiremock: byte range request for mp4
I'm trying to mock a byte range request for mp4 videos with Wiremock (standalone jar).
My mapping is currently:
{"mappings": [ {
"request": {
"method": "GET",
"urlPathPattern": "/video/(.*?).mp4"
},
"response": {
…

Sebastian
- 3,379
- 2
- 23
- 39
2
votes
1 answer
wiremock is throwing Nullpointer when trying from the mvn clean install but working fine with eclipse JunitTest
I am using the following wiremock dependency :
com.github.tomakehurst
wiremock-standalone
test
2.6.0
and when running from eclipse by choosing run as JunitTest everything is working fine. But when I am running this program from maven I am getting…

Madhusudan Sahu
- 247
- 1
- 2
- 11
1
vote
0 answers
Wiremock - standalone - proxy authorization header
I'm using standalone wiremock and I'm creating a proxy mapping.
The proxy target requires bearer authentication and the token expires every 5 minute.
I don't want to use the static value of the token inside the proxy mapping because it would require…

ddfra
- 2,413
- 14
- 24
1
vote
1 answer
WireMock - How to Include Request JSON Body Into the Response Body?
What I have achieved so far?
I'm using WireMock with Spring Boot Application using the JUNIT 5.
I am stubbing the test endpoint with the custom Request and Response JSON payload:
REQUEST PAYLOAD:
{
"merchantId": "xxxx",
"data": [
{
…

Zahid Khan
- 2,130
- 2
- 18
- 31
1
vote
1 answer
How to set wiremock server and stub request based on hostname
I was able to implement the basic setup of wire mock by using:
public void mock(){
WireMockServer wireMockServer = new WireMockServer(443)
wireMockServer.start()
configureFor("localhost", 443)
…

daniel
- 557
- 1
- 4
- 15
1
vote
1 answer
How to start wiremock standalone with custom hostname?
For example, I want to start wiremock standalone with hostname "my.abc.com" with port 9999. Where can I config that? Or what is the right command line options for hostname?
Thanks a lot in advance.

Sifeng
- 713
- 9
- 23
1
vote
1 answer
When is a second priority request trigged on Wiremock?
I'm new to Wiremock and I'm not sure how priority works. I am able to trigger a request I've labeled as first priority but I'm not able to trigger a request I've labeled as second priority. It always just triggers the request that is first priority.…

user2415183
- 61
- 1
- 8