mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-04-26 02:38:54 +02:00
Fix StaticMappingsPath in WireMockContainerBuilder (#1187)
* Fix StaticMappingsPath in WireMockContainerBuilder * .
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
using System;
|
||||
using Docker.DotNet.Models;
|
||||
using DotNet.Testcontainers.Builders;
|
||||
using DotNet.Testcontainers.Configurations;
|
||||
@@ -16,6 +17,8 @@ public sealed class WireMockConfiguration : ContainerConfiguration
|
||||
|
||||
public string? Password { get; }
|
||||
|
||||
public string? StaticMappingsPath { get; private set; }
|
||||
|
||||
public bool HasBasicAuthentication => !string.IsNullOrEmpty(Username) && !string.IsNullOrEmpty(Password);
|
||||
|
||||
public WireMockConfiguration(string? username = null, string? password = null)
|
||||
@@ -61,5 +64,17 @@ public sealed class WireMockConfiguration : ContainerConfiguration
|
||||
{
|
||||
Username = BuildConfiguration.Combine(oldValue.Username, newValue.Username);
|
||||
Password = BuildConfiguration.Combine(oldValue.Password, newValue.Password);
|
||||
StaticMappingsPath = BuildConfiguration.Combine(oldValue.StaticMappingsPath, newValue.StaticMappingsPath);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Set the StaticMappingsPath.
|
||||
/// </summary>
|
||||
/// <param name="path">The path which contains the StaticMappings.</param>
|
||||
/// <returns><see cref="WireMockConfiguration"/> </returns>
|
||||
public WireMockConfiguration WithStaticMappingsPath(string path)
|
||||
{
|
||||
StaticMappingsPath = path;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user