Wayne Liang
02/08/2026, 11:01 PM/__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!