Add support for multiple webhooks (#615)

This commit is contained in:
Stef Heyenrath
2021-05-19 13:58:48 +02:00
committed by GitHub
parent 93ab4e1853
commit b04000bfdd
12 changed files with 403 additions and 235 deletions

View File

@@ -84,10 +84,18 @@ namespace WireMock.Serialization
Response = new ResponseModel
{
Delay = (int?)response.Delay?.TotalMilliseconds
},
Webhook = WebhookMapper.Map(mapping.Webhook)
}
};
if (mapping.Webhooks?.Length == 1)
{
mappingModel.Webhook = WebhookMapper.Map(mapping.Webhooks[0]);
}
else if (mapping.Webhooks?.Length > 1)
{
mappingModel.Webhooks = mapping.Webhooks.Select(WebhookMapper.Map).ToArray();
}
if (bodyMatcher?.Matchers != null)
{
mappingModel.Request.Body = new BodyModel();