From 01fcc2af2b0350bfc378f3473632a30964e2e3e2 Mon Sep 17 00:00:00 2001 From: leeturner Date: Mon, 20 May 2024 16:42:48 +0100 Subject: [PATCH] Document the new lifecycle methods in the Extension interface --- _docs/extending-wiremock.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/_docs/extending-wiremock.md b/_docs/extending-wiremock.md index 90e3576a..be464785 100644 --- a/_docs/extending-wiremock.md +++ b/_docs/extending-wiremock.md @@ -28,6 +28,10 @@ At present, the following extension interfaces are available: The interfaces in this list ending with `V2` supercede deprecated equivalents with an older, more restrictive interface. Additionally `ServeEventListener` deprecates `PostServeAction`. +As of WireMock version `3.6.0`, the `Extension` interface has two new lifecycle methods called `start()` and `stop()`. +The `start()` method is called on each extension when the WireMock server first starts (just before the stub mappings +are loaded) and the `stop()` method is called when the server is stopped. This allows extensions to perform any +initialisation or cleanup tasks. ## Registering Extensions