Hi everyone :wave: I'm making use of the containe...
# help
w
Hi everyone 👋 I'm making use of the containerised version of Wiremock (version 3.13.1) running on GCP cloudrun, with a bucket mounted as a volume to store the Wiremock stub mapping files. My workflow involves making use of the admin API to create new stub mappings (POST
/__admin/mappings
) with the
persistent
flag set to true. I've read from the Wiremock documentation that when there are "overlapping" stubs, Wiremock will default to using the most recently added matching stub. One thing I've noticed however is that that only seems to hold true until the next time Wiremock is restarted (or the stubs are reloaded). Just to get a better understanding of the underlying behaviour, I had a look at the relevant classes I could find (
JsonFileMappingsSource
,
AbstractStubMappings
,
InMemoryMappingStore
, and
SortedConcurrentPrioritisableSet
) and it appears that although the
insertionIndex
is persisted in the stub mapping JSON file. it effectively gets overwritten during the stub loading process. I couldn't seem to find much about this specific situation in the documentation or other discussion forum, so I wanted to ask: is this intended behaviour? I am a beginner when it comes to looking at Wiremocks codebase, however I'm absolutely happy to share/discuss what I've found/observed if it's any help at all. Thank you!