Initial support for converting the mappings to a Pact(flow) json file (#748)

* WithDescription

* WithConsumer / WithProvider

* x

* .

* .

* .

* .

* fix

* pact

* nullable

* ficx

* .

* fix
This commit is contained in:
Stef Heyenrath
2022-04-22 16:17:50 +02:00
committed by GitHub
parent b06b3c8e8b
commit a6ee2dacc7
93 changed files with 1876 additions and 1065 deletions

View File

@@ -21,6 +21,7 @@ namespace WireMock.Server
{
private int _priority;
private string _title;
private string _description;
private string _path;
private string _executionConditionState;
private string _nextState;
@@ -58,16 +59,16 @@ namespace WireMock.Server
/// <param name="provider">The provider.</param>
public void RespondWith(IResponseProvider provider)
{
_registrationCallback(new Mapping(Guid, _title, _path, _settings, _requestMatcher, provider, _priority, _scenario, _executionConditionState, _nextState, _timesInSameState, Webhooks, TimeSettings), _saveToFile);
_registrationCallback(new Mapping(Guid, _title, _description, _path, _settings, _requestMatcher, provider, _priority, _scenario, _executionConditionState, _nextState, _timesInSameState, Webhooks, TimeSettings), _saveToFile);
}
/// <see cref="IRespondWithAProvider.WithGuid(string)"/>
/// <inheritdoc />
public IRespondWithAProvider WithGuid(string guid)
{
return WithGuid(Guid.Parse(guid));
}
/// <see cref="IRespondWithAProvider.WithGuid(Guid)"/>
/// <inheritdoc />
public IRespondWithAProvider WithGuid(Guid guid)
{
Guid = guid;
@@ -75,7 +76,7 @@ namespace WireMock.Server
return this;
}
/// <see cref="IRespondWithAProvider.WithTitle"/>
/// <inheritdoc />
public IRespondWithAProvider WithTitle(string title)
{
_title = title;
@@ -83,6 +84,14 @@ namespace WireMock.Server
return this;
}
/// <inheritdoc />
public IRespondWithAProvider WithDescription(string description)
{
_description = description;
return this;
}
/// <see cref="IRespondWithAProvider.WithPath"/>
public IRespondWithAProvider WithPath(string path)
{
@@ -91,7 +100,7 @@ namespace WireMock.Server
return this;
}
/// <see cref="IRespondWithAProvider.AtPriority"/>
/// <inheritdoc />
public IRespondWithAProvider AtPriority(int priority)
{
_priority = priority;
@@ -99,7 +108,7 @@ namespace WireMock.Server
return this;
}
/// <see cref="IRespondWithAProvider.InScenario(string)"/>
/// <inheritdoc />
public IRespondWithAProvider InScenario(string scenario)
{
_scenario = scenario;
@@ -107,13 +116,13 @@ namespace WireMock.Server
return this;
}
/// <see cref="IRespondWithAProvider.InScenario(int)"/>
/// <inheritdoc />
public IRespondWithAProvider InScenario(int scenario)
{
return InScenario(scenario.ToString());
}
/// <see cref="IRespondWithAProvider.WhenStateIs(string)"/>
/// <inheritdoc />
public IRespondWithAProvider WhenStateIs(string state)
{
if (string.IsNullOrEmpty(_scenario))
@@ -126,13 +135,13 @@ namespace WireMock.Server
return this;
}
/// <see cref="IRespondWithAProvider.WhenStateIs(int)"/>
/// <inheritdoc />
public IRespondWithAProvider WhenStateIs(int state)
{
return WhenStateIs(state.ToString());
}
/// <see cref="IRespondWithAProvider.WillSetStateTo(string, int?)"/>
/// <inheritdoc />
public IRespondWithAProvider WillSetStateTo(string state, int? times = 1)
{
if (string.IsNullOrEmpty(_scenario))
@@ -146,7 +155,7 @@ namespace WireMock.Server
return this;
}
/// <see cref="IRespondWithAProvider.WillSetStateTo(int, int?)"/>
/// <inheritdoc />
public IRespondWithAProvider WillSetStateTo(int state, int? times = 1)
{
return WillSetStateTo(state.ToString(), times);
@@ -162,7 +171,7 @@ namespace WireMock.Server
return this;
}
/// <see cref="IRespondWithAProvider.WithWebhook(IWebhook[])"/>
/// <inheritdoc />
public IRespondWithAProvider WithWebhook(params IWebhook[] webhooks)
{
Guard.HasNoNulls(webhooks, nameof(webhooks));
@@ -172,7 +181,7 @@ namespace WireMock.Server
return this;
}
/// <see cref="IRespondWithAProvider.WithWebhook(string, string, IDictionary{string, WireMockList{string}}, string, bool, TransformerType)"/>
/// <inheritdoc />
public IRespondWithAProvider WithWebhook(
[NotNull] string url,
[CanBeNull] string method = "post",
@@ -196,7 +205,7 @@ namespace WireMock.Server
return this;
}
/// <see cref="IRespondWithAProvider.WithWebhook(string, string, IDictionary{string, WireMockList{string}}, object, bool, TransformerType)"/>
/// <inheritdoc />
public IRespondWithAProvider WithWebhook(
[NotNull] string url,
[CanBeNull] string method = "post",