Specifying extra mappings folder as a CLI option of WireMock standalone

47 Views Asked by At

I'm using Wiremock docker and trying to set it up with:

  • proxy stub mappings used with --record-mappings option
  • recorded stub mappings

Proxy stub mappings are automatically generated and are meant to be used only in recording mode. They are not meant to be committed and I would like them under the target\mappings folder of a Maven project. We typically have multiple proxyBaseURls so we have to use mappings, as far as I can tell, i.e. can't use the proxy-all option.

Recorded stub mappings, on the other hand, are generated by WireMock and are used in most cases. They are meant to be committed and I would like them under src/test/resources.

We then map the /home/wiremock/mappings folder to src/test/resources/mappings, so that Wiremock will generate the recorded stubs in the expected folder. But I could not find any CLI option to specify target\mappings as an additional mappings folder. We have to resort to implementing a mappings loader extension, which requires extra code.

So my questions are:

  • is having two different types of mappings in two different folders a sensible use-case of WireMock?
  • and if it is, is there a way to specify them both on the CLI? Or an existing extension? I would expect this to be a common need, so maybe I'm missing something?
0

There are 0 best solutions below