how to record the duplicate apis with different re...
# wiremock-java
y
how to record the duplicate apis with different response in wiremock
duplicate means same API URL
r
are you asking how to record multiple requests to an api?
or are you asking how to configure a wiremock server to serve different responses from the same url?
y
are you asking how to configure a wiremock server to serve different responses from the same url? ---yes
r
wiremock serves the response of the first stub mapping that matches the incoming request. you can define multiple stub mappings that all match on the same url and distinguish which one will match a given request by using other matching criteria, like header matchers or body pattern matchers. what is your use case?
y
One application produces different responses for the same APIs, but our WireMock didn't record these APIs; it excluded the duplicates. How can I resolve this? is it need any configuration changes how can we do that?
r
you're probably looking for the
repeatsAsScenarios
setting. more info here
y
repeatsAsScenarios="true" i'm using this key for duplicate API recording,but i got the below exception Exception: java.util.MissingResourceException thrown from the UncaughtExceptionHandler in thread "main" is beta version is required for this?if the answer is yes kindly share the version details. i've tried with latest wiremock version only.
r
is there an accompanying stack trace with that exception?
y
yes
r
can you share it please
y
java -jar wiremock-standalone-3.9.1.jar --port 8080 --https-port 8443 --https-keystore ./certificate/new.keystore --keystore-type JKS --keystore-password 'password' --print-all-network-traffic --record-mappings --proxy-all="https://analytics" --repeatsAsScenarios="true" }
r
that is not a stack trace, that is the command to start up wiremock. the
repeatsAsScenarios
is not an option you provide wiremock at startup time, it is a parameter you set when you make a request to start recording. how are you starting a recording session with wiremock? are you using the
/__admin/recorder
ui?
y
no i'm using "sh fake_actions.sh record "this commend in terminal
I've done a changes in fake actions.sh file