mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-03-31 14:43:40 +02:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -27,11 +27,20 @@ namespace WireMock.Client
|
|||||||
Task<SettingsModel> GetSettingsAsync();
|
Task<SettingsModel> GetSettingsAsync();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Post the settings
|
/// Update the settings.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="settings">SettingsModel</param>
|
||||||
|
[Put("__admin/settings")]
|
||||||
|
[Header("Content-Type", "application/json")]
|
||||||
|
Task<string> PutSettingsAsync([Body] SettingsModel settings);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Update the settings
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="settings">SettingsModel</param>
|
/// <param name="settings">SettingsModel</param>
|
||||||
[Post("__admin/settings")]
|
[Post("__admin/settings")]
|
||||||
Task PostSettingsAsync([Body] SettingsModel settings);
|
[Header("Content-Type", "application/json")]
|
||||||
|
Task<string> PostSettingsAsync([Body] SettingsModel settings);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get the mappings.
|
/// Get the mappings.
|
||||||
@@ -41,11 +50,51 @@ namespace WireMock.Client
|
|||||||
Task<IList<MappingModel>> GetMappingsAsync();
|
Task<IList<MappingModel>> GetMappingsAsync();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get a mappings based on the guid
|
/// Add a new mapping.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="mapping">MappingModel</param>
|
||||||
|
[Post("__admin/mappings")]
|
||||||
|
Task<string> PostMappingAsync([Body] MappingModel mapping);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Delete all mappings.
|
||||||
|
/// </summary>
|
||||||
|
[Delete("__admin/mappings")]
|
||||||
|
Task<string> DeleteMappingsAsync();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Delete (reset) all mappings.
|
||||||
|
/// </summary>
|
||||||
|
[Post("__admin/mappings/reset")]
|
||||||
|
Task<string> ResetMappingsAsync();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get a mapping based on the guid
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="guid">The Guid</param>
|
/// <param name="guid">The Guid</param>
|
||||||
/// <returns>MappingModel</returns>
|
/// <returns>MappingModel</returns>
|
||||||
[Get("__admin/mappings/{guid}")]
|
[Get("__admin/mappings/{guid}")]
|
||||||
Task<MappingModel> GetMappingAsync([Path] Guid guid);
|
Task<MappingModel> GetMappingAsync([Path] Guid guid);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Update a mapping based on the guid
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="guid">The Guid</param>
|
||||||
|
/// <param name="mapping">MappingModel</param>
|
||||||
|
[Put("__admin/mappings/{guid}")]
|
||||||
|
Task<string> PutMappingAsync([Path] Guid guid, [Body] MappingModel mapping);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Delete a mapping based on the guid
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="guid">The Guid</param>
|
||||||
|
[Delete("__admin/mappings/{guid}")]
|
||||||
|
Task<string> DeleteMappingAsync([Path] Guid guid);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Save the mappings
|
||||||
|
/// </summary>
|
||||||
|
[Post("__admin/mappings/save")]
|
||||||
|
Task<string> SaveMappingAsync();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -86,12 +86,12 @@ namespace WireMock.Server
|
|||||||
{
|
{
|
||||||
// __admin/settings
|
// __admin/settings
|
||||||
Given(Request.Create().WithPath(AdminSettings).UsingGet()).RespondWith(new DynamicResponseProvider(SettingsGet));
|
Given(Request.Create().WithPath(AdminSettings).UsingGet()).RespondWith(new DynamicResponseProvider(SettingsGet));
|
||||||
Given(Request.Create().WithPath(AdminSettings).UsingVerb("PUT", "POST")).RespondWith(new DynamicResponseProvider(SettingsUpdate));
|
Given(Request.Create().WithPath(AdminSettings).UsingVerb("PUT", "POST").WithHeader("Content-Type", "application/json")).RespondWith(new DynamicResponseProvider(SettingsUpdate));
|
||||||
|
|
||||||
|
|
||||||
// __admin/mappings
|
// __admin/mappings
|
||||||
Given(Request.Create().WithPath(AdminMappings).UsingGet()).RespondWith(new DynamicResponseProvider(MappingsGet));
|
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).UsingPost().WithHeader("Content-Type", "application/json")).RespondWith(new DynamicResponseProvider(MappingsPost));
|
||||||
Given(Request.Create().WithPath(AdminMappings).UsingDelete()).RespondWith(new DynamicResponseProvider(MappingsDelete));
|
Given(Request.Create().WithPath(AdminMappings).UsingDelete()).RespondWith(new DynamicResponseProvider(MappingsDelete));
|
||||||
|
|
||||||
// __admin/mappings/reset
|
// __admin/mappings/reset
|
||||||
|
|||||||
Reference in New Issue
Block a user