Search code examples
wiremock-standalone

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 starts throwing exceptions

I am trying to pick random value for a Attribute in my response body to have random value either from a range of values or from a list of values like below

"response": { "status": 200, "fixedDelayMilliseconds": 1000, "body": "{"accountId": "{{{pickRandom '1' '2' '3'}}}"}", "transformers":[ "response-template" ]

but its give cannot find helper exception while randomValue works fine.

Any inputs are most welcomes. I am using wiremock-standalone-2.26.3


Solution

  • Issue was with standalone wiremock version 2.26.3 which was not compatible for these two methods. After upgrading to latest version 2.32.0 working fine now.