Questions tagged [wiremock-standalone]
119 questions
5
votes
2 answers
Can we customize mapping file names in Wiremock?
I am recording the application through Wiremock using JAVA DSL, Do we have the option to customize the mapping file names? instead of getting the filename which is generated from wiremock..
Example: …

Anant patil
- 161
- 1
- 9
5
votes
3 answers
Query Parameter is not getting matched when using WireMock
I am trying to hit the WireMock with following stub but it seems that the query param is not getting matched. Here is the response:
Request was not matched
…

monty
- 108
- 1
- 2
- 7
4
votes
2 answers
Wiremock templating fixedDelayMilliseconds
I am trying to generated a response in wiremock, after a delay, where that delay is derived from the incoming request. e.g the family-name of the user in the request is "delay_10000" then delay by 10000 milliseconds, or delay_20000 then delay by…

Disgruntled Goat
- 107
- 2
- 7
3
votes
0 answers
Using Wiremock standalone, how can I define default headers?
I have a setup where I run Wiremock standalone (as a Docker container, if that matters), with mappings defined in JSON files.
Is there a way to specify certain headers that will be applied to all responses? Specifically, I want all responses to have…

Thomas Levesque
- 286,951
- 70
- 623
- 758
3
votes
1 answer
In wiremock mapping json BodyPatterns only the last comparison is happening
I am using wiremock-jre8-standalone-2.27.0 jar to mock an API. My mapping json looks like:
{
"request": {
"url": "/sampleUrl",
"method": "POST",
"bodyPatterns": [
{
"matchesJsonPath" : {
"expression":…

Raghvendra Rao
- 146
- 11
3
votes
4 answers
How to specify path of WireMock mappings and files present inside executable Spring Boot Jar?
I have built WireMock as a spring boot application using "spring-cloud-contract-wiremock" dependency.
I have kept the mapping and _files inside src/test/resources folder.
When I run the application from IDE it works perfectly. But when I run the Jar…

Roshni
- 137
- 1
- 2
- 11
3
votes
3 answers
Wiremock Docker Container not using the supplied port (instead using 8080)
I am using WireMock Docker image and spinning off the container using it. I can verify the container is up and running but after looking at container logs, looks like it is still running on 8080? At least, I am not able to access Wiremock using…

Code-Strings
- 111
- 2
- 10
3
votes
2 answers
Wiremock Placeholder isn't recognized
I tried with the following json but the wiremock doesn't recognize my change. I read the documentation of wiremock and I saw that they said: JSON equality matching is based on JsonUnit and therefore supports placeholders. I also tried with both JDK…

Sang Mai
- 61
- 2
- 4
3
votes
0 answers
Wiremock server returning HTTP ERROR 500 when calling
I am using wireMock and I am getting a consistent response of 500 Internal Server Error.
I am using below code to create mock server, wiremock version : 2.24.0
final URI listenUri = URI.create(listenAddress);
final Duration responseTimeout =…

Bhushan Phalak
- 73
- 7
3
votes
1 answer
Push a pdf file on wiremock
I'm using a wiremock standlaone service to mock several json Object.
Actually I want to mock a pdf file: it works fine on my local by just adding my pdf to the __files folder
However I'm trying to use a POSTMAN (or curl) to push the pdf on the…

Mohamed Taboubi
- 6,663
- 11
- 55
- 87
2
votes
2 answers
How to check that value of field in request body is json using Wiremock
I have a JSON request and I need to check that the value of one field is json.
I'm trying use regex:
"request": {
...
"bodyPatterns": [
{
"equalToJson": {
"field_1": "Value",
"field_2":…

lojz
- 23
- 4
2
votes
1 answer
Could not initialize class com.github.tomakehurst.wiremock.core.WireMockApp
I recently upgraded my Java version to Java11 for 8 and since then i am seeing this error:
java.lang.NoClassDefFoundError: Could not initialize class com.github.tomakehurst.wiremock.core.WireMockApp
at…

Rajat Pratap
- 29
- 1
- 5
2
votes
2 answers
Implement different response with WireMock when no request(s) match
I'm trying to stub a RESTful API. One of the resources return the details when the resource is (indeed) found, or an HTTP 404 (Not Found) when, eventually, there is no resource for the given URL.
This is my simplified stub/mapping:
{
"mappings":…

x80486
- 6,627
- 5
- 52
- 111
2
votes
0 answers
WireMock memory consumption when idle
I'm seeing strange memory consumption patterns when using WireMock for API-stubbing. Our mocks run in standalone mode in Docker containers, which can typically run unchanged for days.
Strangely enough, WireMock seems to be allocating memory when…

Stefan Haberl
- 9,812
- 7
- 72
- 81
2
votes
1 answer
How to return request body in a field in response using Wiremock
I have a JSON request as below:
{
"fieldOne": 12345,
"fieldTwo": 1234,
"fieldThree": "2019-12-05T12:32:42.323905",
"fieldFour": "string",
"fieldFive": 5432,
"fieldSix": "string",
"fieldSeven": "string",
"fieldEight":…

firstpostcommenter
- 2,328
- 4
- 30
- 59