I am trying basic mock example on decimals using wiremock and I couldn’t get it to work. And I dont see any example online either. Below is the response section of my json file
"response": {
"status": 200,
"jsonBody": {
"weekly_rate": "{{randomDecimal lower=100.00 upper=800.00 precision=2}}",
"max_amount": "{{randomDecimal lower=5000.00 upper=20000.00 precision=2}}"
},
"transformers": ["response-template"]
}
and I get this response
{
"weekly_rate": "220.87939761296946",
"max_amount": "8860.916637737479"
}
Two issues
- The numbers have more than 2 decimal places so the precision is not
respected. - The numbers are strings instead of numeric