DELETE /__admin/mappings

This commit is contained in:
Stef Heyenrath
2017-01-29 17:50:12 +01:00
parent edb1354986
commit 5db727549c
2 changed files with 18 additions and 2 deletions

View File

@@ -32,6 +32,7 @@ namespace WireMock.Server
// __admin/mappings
Given(Request.Create().WithPath(AdminMappings).UsingGet()).RespondWith(new DynamicResponseProvider(MappingsGet));
Given(Request.Create().WithPath(AdminMappings).UsingPost()).RespondWith(new DynamicResponseProvider(MappingsPost));
Given(Request.Create().WithPath(AdminMappings).UsingDelete()).RespondWith(new DynamicResponseProvider(MappingsDelete));
// __admin/mappings/{guid}
Given(Request.Create().WithPath(_guidPathMatcher).UsingGet()).RespondWith(new DynamicResponseProvider(MappingGet));
@@ -111,6 +112,13 @@ namespace WireMock.Server
return new ResponseMessage { Body = "Mapping added" };
}
private ResponseMessage MappingsDelete(RequestMessage requestMessage)
{
ResetMappings();
return new ResponseMessage { Body = "Mappings deleted" };
}
private IRequestBuilder InitRequestBuilder(MappingModel mappingModel)
{
IRequestBuilder requestBuilder = Request.Create();