File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
src/main/java/org/wiremock/extensions/state/extensions Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -57,6 +57,7 @@ public void contributeAdminApiRoutes(Router router) {
5757 router .add (RequestMethod .GET , createPath ("contexts" ), getContexts ());
5858 router .add (RequestMethod .GET , createPath ("contexts/{context}" ), getContext ());
5959 router .add (RequestMethod .DELETE , createPath ("contexts/{context}" ), deleteContext ());
60+ router .add (RequestMethod .DELETE , createPath ("contexts" ), deleteContexts ());
6061
6162 }
6263
@@ -78,6 +79,13 @@ private AdminTask deleteContext() {
7879 };
7980 }
8081
82+ private AdminTask deleteContexts () {
83+ return (admin , serveEvent , pathParams ) -> {
84+ contextManager .deleteAllContexts (UUID .randomUUID ().toString ());
85+ return ResponseDefinition .noContent ();
86+ };
87+ }
88+
8189 private String createPath (String path ) {
8290 return String .format ("/state-extension/%s" , path );
8391 }
You can’t perform that action at this time.
0 commit comments