Questions tagged [wiremock-standalone]
119 questions
0
votes
1 answer
Spring tests shutting down standalone wiremock server
I have some end-to-end UI tests with WebDriver that use a remote wiremock instance, that I connect to in the following way:
@Configuration
public class WireMockConfiguration {
@Bean
public WireMock wireMock() {
return new…

Ubeogesh
- 1,633
- 2
- 15
- 22
0
votes
1 answer
Why is Wiremock Standalone rejecting my valid JSONPath expression?
Background
I am using wiremock-jre8-standalone-2.35.0.jar
I want it to return a 200 response if the incoming request's array contains any values:
{
"field1": "data1",
"array": [
{...},
{...},
...
],
"field2":…

friend.code
- 67
- 5
0
votes
0 answers
How to set null value in wiremock standalone response template?
I want to pass a null value in wiremock standalone from request to a jsonBody response, the problem that i faced is that the handle bars convert anything to string so my response is showing empty string ("") instead of null object (null).
Wiremock…
0
votes
0 answers
Update wiremock stubmapping does not call MappingsSource.save(StubMapping stubMapping) (just happened)
This just happened today even if I use the same version, no changes in code.
When call PUT /__admin/mappings/{uuid}, the class that implements MappingsSource.save( StubMapping stubMapping ) is usually called but this method is NOT called today.
The…
0
votes
0 answers
how to mock backend api using WireMock
according to https://wiremock.org/docs/running-standalone/ , we can mock api hosted on localhost .
but how we can do the same process for api hosted remotely ?
somthing like this ..
curl -X POST --data
'{ "request": { "url":…
0
votes
1 answer
How to mock 3rd API response when 1st API and 2nd API is working on test environment
I have 3 microservices
Want to mock last ms api response.
Ex: my 1st api sends the correct request. And some fields are used in the 2nd MS API to send the request to 3rd MS API.
Now I want to send 403 from the 3rd MS api.

Ankur Verma
- 1
- 1
0
votes
1 answer
Wiremock how to return value in response from the request when the request key has dot
I have a request body in json with some keys having dot (.) in the name. ( i.e. get John Doe)
{
"details":{
"full.name":"John Doe",
"age":30,
"city":"Boston"
}
}
In the stub definition I have:
{
"request":{
"urlPath":"/path",
…

Deep
- 528
- 3
- 12
- 27
0
votes
2 answers
Using regex to negate a filter in wiremock jsonpath
I am using wiremock for stubbing and it uses Jayway JsonPath.
I want to create a stub only when the json element doesn't contain exactly 10 digits.
stub is
"request": {
"bodyPatterns": [
{
"matchingJsonPath":…

Deep
- 528
- 3
- 12
- 27
0
votes
1 answer
Array in QueryParams wiremock
I need to pass through queryParams in wireMock
Person=[{age=6,name=AAA}]
I've been getting 404 when I test in the curl request. Aly leads would be appreciated.
Only thing i know is
"Person": {
"matches": "^[a-zA-Z0-9_-]*$"
}
I'm not sure…

snehalg
- 53
- 5
0
votes
1 answer
WireMock - Is it possible to template the status code?
I'm currently trying to customize the Status code in a WireMock mapping.
I want to do something similar to this.
"response" : {
"status" :"{{#if true}}200{{/if}}{{else}} 204 {{/if}}",
...
...
...
}
When doing so, I get the…

user3799465
- 1
- 1
- 2
0
votes
0 answers
Disable Transfer-Encoding chunked in wiremock standalone server
I am running wiremock standalone using wiremockserver.
The application does not work in PCF because of the header Transfer-Encoding: chunked.
(If this header is present then in PCF I get the error 502 Bad Gateway: Registered endpoint failed to…

firstpostcommenter
- 2,328
- 4
- 30
- 59
0
votes
1 answer
is there a way to mock internal service calls while writing Component testcases
I'm writing my component level test-cases for my repository. My API calls internally a third party API which I need to mock. I don't have direct access to that API neither I can directly call it, it needs to be called from within the API calls. I…

thisisdude
- 543
- 1
- 7
- 31
0
votes
0 answers
pass docker cli args in dockerfile
would like to know if there is way to pass below https-port argument in entrypoint script or in the dockerfile
--https-port 443
docker run -it --rm -p 8443:8443 wiremock/wiremock --https-port 8443 --verbose
here is the link to the dockerfile:…

itgeek
- 549
- 1
- 15
- 33
0
votes
1 answer
WireMock Standalone issue while using {{{pickRandom '1' '2' '3'}}}, {{randomInt lower=5 upper=9}}
I am trying to use Pick random helper method for my standalone wiremocks.
I am able to use helper {{randomValue length=10 type='NUMERIC'}}
However when I try to use other helpers like {{{pickRandom '1' '2' '3'}}} or {{randomInt lower=5 upper=9}}
It…

Varun
- 1
- 2
0
votes
1 answer
Wiremock Capture path param and return in the response body after "=" symbol only
I am trying to create dynamic mocks using WireMock. My URL is like :
http://localhost:8080/manage/classids/query1=ns1/query2=id1
then I want output as
{
"yourId":"id1"
}
I try do like this way
{
"name": "Req_GET",
"request": {
…