The stub which was saved using Admin API endpoint /__admin/mappings/save DOES NOT get deleted from backing store.
Version of WireMock: wiremock-standalone-2.24.1
Started with CLI: java -jar wiremock-standalone-2.24.1.jar --port 8181
Steps to reproduce:
All steps should be executed using admin API
{
"request": {
"method": "GET",
"url": "/some/thing"
},
"response": {
"status": 200,
"body": "Hello world!",
"headers": {
"Content-Type": "text/plain"
}
}
}
/__admin/mappings/save/__admin/mappings/{stubMappingId}Actual Behaviour:
The stub does not get deleted from backing store
Expected Behaviour:
The stub should also be deleted from backing store
This is an annoying bug because it deletes the mock "in memory" but not on disk, as the result it is not idempotent: if you do twice the DELETE it generates an error "status 404 reading WiremockClient#deleteStub(UUID)" the second time.
Do you think you could seize this bug opportunity to make the DELETE indempotent ?
It's already idempotent. The problem is here is just that when you persist a stub via the save call it doesn't mark it as persistent, so doesn't attempt to delete it from the disk when removed from the set.
Yes, it does get removed from desk on delete if it's persisted by setting a persistent attribute to true. That's the workaround we follow to eradicate the duplicates currently since the deletion didn't work and all the undeleted stubs get loaded on server restart.
For clarity - I'm planning to fix the persistent flag problem, just not change the semantics of the API call.
That'll be great
Most helpful comment
For clarity - I'm planning to fix the persistent flag problem, just not change the semantics of the API call.