mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-04-26 18:28:27 +02:00
Implement prefix for saved mapping file (#1040)
* Implement PrefixForSavedMappingFile * Add missing new line * Add missing new line * Fix warning * Fix typo * Change from readonly to const * Assign default value * Use nameof() * Change from readonly to const * Update tests * Update failing test * Rename settingsMock to settings * Create public const * Use const from ProxyAndRecordSettings --------- Co-authored-by: Mindaugas Laganeckas <mindaugas.laganeckas@nexigroup.com>
This commit is contained in:
committed by
GitHub
parent
68ad015dcf
commit
7b8e7bb684
@@ -7,6 +7,11 @@ namespace WireMock.Settings;
|
||||
/// </summary>
|
||||
public class ProxyAndRecordSettings : HttpClientSettings
|
||||
{
|
||||
/// <summary>
|
||||
/// Default prefix value for saved mapping file
|
||||
/// </summary>
|
||||
public const string DefaultPrefixForSavedMappingFile = "Proxy Mapping for ";
|
||||
|
||||
/// <summary>
|
||||
/// The URL to proxy.
|
||||
/// </summary>
|
||||
@@ -95,9 +100,14 @@ public class ProxyAndRecordSettings : HttpClientSettings
|
||||
/// </summary>
|
||||
public bool AppendGuidToSavedMappingFile { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Set prefix for saved mapping file.
|
||||
/// </summary>
|
||||
public string PrefixForSavedMappingFile { get; set; } = DefaultPrefixForSavedMappingFile;
|
||||
|
||||
/// <summary>
|
||||
/// Proxy all Api calls, irrespective of any condition
|
||||
/// </summary>
|
||||
[PublicAPI]
|
||||
public bool ProxyAll { get; set; } = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -120,6 +120,7 @@ public static class WireMockServerSettingsParser
|
||||
SaveMappingToFile = parser.GetBoolValue("SaveMappingToFile"),
|
||||
UseDefinedRequestMatchers = parser.GetBoolValue(nameof(ProxyAndRecordSettings.UseDefinedRequestMatchers)),
|
||||
AppendGuidToSavedMappingFile = parser.GetBoolValue(nameof(ProxyAndRecordSettings.AppendGuidToSavedMappingFile)),
|
||||
PrefixForSavedMappingFile = parser.GetStringValue(nameof(ProxyAndRecordSettings.PrefixForSavedMappingFile), null),
|
||||
Url = proxyUrl!,
|
||||
SaveMappingSettings = new ProxySaveMappingSettings
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user