Questions tagged [wiremock-standalone]
119 questions
0
votes
0 answers
How to create wiremock extension with encrypt and decrypt text
I want to create decrypt or encrypt function from python and it can call in wiremock function.
For example
https://i.stack.imgur.com/SjHpP.png
From above picture , I expect Wiremock that can decrypt data (I already have decrypt code from Python) and…

Nekokukki
- 15
- 3
0
votes
1 answer
Extract an attribute value from JSON request when running standalone wiremock server
I want to extract an attribute's value from JSON request body coming in a request in a running standalone wiremock server and use the value in the response. Is there any way to this dynamically.
For example, if below is the request body :
{
…

Sumeet Ambastha
- 15
- 4
0
votes
1 answer
Wiremock request matching for dynamic values
The sample JSON I use for stub
{
"request": {
...
"bodyPatterns" : [ {
"equalToJson" : "{ \"id\": abc123 }",
"ignoreArrayOrder" : true,
"ignoreExtraElements" : true
} ]
...
},
here the id is a dynamic value,…

Cork Kochi
- 1,783
- 6
- 29
- 45
0
votes
1 answer
Wiremock: how to validate ALL objects in an array
Using wiremock-standalone (version 2.29.1), I want to verify a request with its body holding an array of objects, containing optional properties.
For instance, consider this request:
Request body (JSON format)
{
"foo": [
{ "bar":…

scottinet
- 171
- 2
0
votes
2 answers
Wiremock request templating in standalone mode: can I use a XML file as response template and inject value with XPATH?
I know that request template supports XPath, so that I can get value from request like {{xPath request.body '/outer/inner/text()'}}. I already have a XML file as response, and I want to inject this value I got from request, but keep the other parts…

WesternGun
- 11,303
- 6
- 88
- 157
0
votes
2 answers
Wiremock to remove additional data (meta-data) in response
I am trying to post a file in wiremock and configure the file in mapping like below. And in the response I am seeing Content-Type, Content-Disposition etc, is there a way to disable this?
POST file
http://localhost:8080/__admin/files/some.json
used…

Minisha
- 2,117
- 2
- 25
- 56
0
votes
1 answer
How to return a mock response object from HTTP request?
I'm new to Java programming and I have the following snippet on which I want to write unit test:
Response response = request.get();
if (response.getStatusInfo().getFamily().equals(Response.Status.Family.SUCCESSFUL)) {
return…

Mandeep Singh
- 3
- 5
0
votes
1 answer
Wiremock not able to match the url
I have very basic mapping.json
{
"mappings": [
{
"priority": 1,
"request": {
"method": "GET",
"url": "/your/url?and=query"
},
"response": {
…

Mohammed
- 637
- 13
- 26
0
votes
1 answer
Wiremock not templating request path segments
I am trying to use the request.pathSegments to render some information in a response and that placeholder is empty...
using 2.26
Wiremock standalone start up cmd:
java -jar ./wiremock.jar --root-dir "/usr/share/wiremock" --verbose…

lurker
- 5
- 3
0
votes
1 answer
Ignoring certain elements in request during wiremock record mappings
I am using wiremock to record mappings. I am using proxyBaseUrl, so that when mapping is not there it gets routed to proxy and the request and response is recorded. In my request there are a few timestamp related request object items I want the…

nilesh
- 14,131
- 7
- 65
- 79
0
votes
1 answer
What are the modifications needed to be done to get Wiremock running?
I have a .Net Core web API solution called ReportService, which calls another API endpoint (we can call this PayrollService) to get payroll reports. So my requirement is to mock the PayrollService using Wiremock.Net.
Also currently I have a…

Sam Amarasinghe
- 1
- 1
0
votes
1 answer
Validate/Match JSON field for number and not string in the input request in Wiremock
I am trying to validate a particular json field amount in the request to have number and not string
{
"request": {
"method": "POST",
"urlPath": "/charges",
"bodyPatterns" : [
{"matchesJsonPath" : "$[?(@.amount =~ /^[0-9]*$/i)]"}
…

firstpostcommenter
- 2,328
- 4
- 30
- 59
0
votes
1 answer
Dynamic wiremock to capture filter parameter and return in response
I am trying to create dynamic mocks using WireMock. I have a situation where if I specify URL like
for this kind of request
/myManagement/v1/source?filters=myParty.id%3D%3D539%26myParty.role%3D%individual
what can I used so response will filter out…

sagar verma
- 404
- 4
- 10
0
votes
1 answer
How to verify if json key contains specific value in Wiremock
I have below request URL:
http://localhost:9082/v1/action/query
And I have below requests in wiremock request file:
{"queryString":"Select firstname, lastname, workphone, id, accountId from mydetails}
{
"request": {
"method": "POST",
"url":…

Gaurav Khandelwal
- 360
- 2
- 12
0
votes
0 answers
Generate specific time in wiremock
In Wiremock, I need to generate specific time. I need a difference from 0-59 minute from Wiremock in yyyyMMdd format. Is this possible?
I tried {{now offset = '83160 seconds' format='yyyyMMdd'}}, but now able to get desired result.
Can you any one…

Piyush Garg
- 37
- 2
- 10