Questions tagged [wiremock-standalone]
119 questions
1
vote
0 answers
Unable to get mocked response from Feign Client in Spring Boot
I am unable to get the mocked response from Feign Client. I provide below the code.
In the service class, it has been written like this.
public String getInfo(HttpServletRequest request, String id, String type) {
.... other code .....
…

Deba
- 859
- 5
- 9
- 21
1
vote
0 answers
Turn on wiremock logs
I can't get any wiremock logs in the console during the execution tests
java - wiremock - testNG
wiremock standalone starts on pod using java with option --verbose
also, set level="TRACE" for STDOUT in logback.xml file
however, I added different…

Jenka K
- 11
- 3
1
vote
1 answer
Wiremock response of a certain regex
I have to send a random value back from wiremocked response. I have seen examples using {{randomValue type='ALPHANUMERIC'}}
However I could not find anything where I can give randomvalue of a particular regex - say alphanumeric value which starts…

user3276247
- 1,046
- 2
- 9
- 24
1
vote
2 answers
Wiremock admin stub issue
I have a stub file that i'm sending via the c# admin api to a standalone wiremock instance. I'm getting the expected response back when i send via postman except the response body is always empty, even though in my file i have this:
"Response":…

auburg
- 1,373
- 2
- 12
- 22
1
vote
0 answers
Include a runtime JAR when running a fat JAR
Pretty sure this is a duplicate question, but couldn't find the answer I'm looking for.
I'm trying to run WireMock standalone with WebHook extensions. Both come packaged as JAR files. First one, wiremock-jre8-standalone-2.28.1.jar is a runnable fat…

DiegoAlfonso
- 237
- 5
- 15
1
vote
1 answer
WireMock CustomTransformer (handlebars helpers not working in bodyFile)
I have problems with Handlebars helpers in Wiremock.
I registered a custom transformer like that:
final WireMockServer wireMockServer = new WireMockServer(wireMockConfig().port(PORT).extensions(new ResponseTemplateTransformer(true), new…

MikeL
- 27
- 4
1
vote
1 answer
Wiremock Request Templating for JSON Payload with multiple allowed keys, but same response
Trying to mock an API endpoint that allows a request with 2 possible payloads, but the same response:
Request Option 1
{
"key1": "value1"
}
Request Option 2
{
"key2": "value2"
}
Based on the Request Templating documentation, I see that there's…

muya_
- 768
- 7
- 21
1
vote
1 answer
Wiremock JsonMatcher or JsonPathMatcher not working
I want to match a request body using Wiremock dotnet. Sample request body
{
"name": "ashutosh",
"age": 33
}
I want to match it with one of the key value combination like either age or name.
I tried the below combinations but nothing seems to…

ashutosh
- 45
- 4
1
vote
1 answer
Standalone wiremock server as spring boot application
I am trying to make a mock service as a spring boot application.
Can I use standalone mock server inside a spring boot application?
When I tried to run a mock server on any port inside the spring boot application it throws the "Address already bound…

Monish Das
- 383
- 2
- 12
- 28
1
vote
1 answer
wiremock to mock public backend response
I am testing on an app that is making calls to a public backend.
I want to use wiremock to mock reponses from the public backends.
I was looking at something like
the app makes a request to api.example.com which is forced through the wiremock proxy…

archit wagle
- 35
- 6
1
vote
1 answer
ConditionTimeout of async tests when using wiremock
I have one instance of wiremock that is used across multiple test classes, It has worked fine until recently, when used to test
async methods, when the test classes are ran singly, tests pass but when the entire tests are ran(mvn test), some of the…

lawDino
- 11
- 3
1
vote
0 answers
Wiremock not returning saved responses
I have a wiremock standalone server, which is proxying all requests even if a response is already saved on root dir.
Here is my configuration:
WireMockConfiguration wireMockConfiguration = new WireMockConfiguration()
…

rfel
- 11
- 3
1
vote
1 answer
How to use an if conditional in a WireMock JSON stub?
I need to use if conditional in my stub. I know there are the different scenarios you can create with body patterns but this does not work in my case because I am getting a variable number of objects in the payload and I need to use a for loop to…

Vilius Gudžiūnas
- 199
- 2
- 11
1
vote
1 answer
Wiremock- standalone jar --port option not working
I'm new to wiremock, and I'm trying to use it to record the requests & responses of a java application.
I am using standalone wiremock jar for this. Below is the command I am using
java -jar /jenkins/tools/wiremock-jre8-standalone-2.26.3.jar…

usha duddu
- 33
- 3
1
vote
2 answers
Wiremock how to map a 302 response in JSON for standalone run
In wiremock, if you are using it for testing, you can programately return 302 using temporaryRedirect(String destination) with a detination path
stubFor(post(urlEqualTo("/firsturl"))
…