@@ -40,7 +40,7 @@ public sealed class WireMockContainerBuilder : ContainerBuilder<WireMockContaine
40
40
} ) ;
41
41
42
42
private OSPlatform ? _imageOS ;
43
- private string ? _staticMappingsPath ;
43
+ // private string? _staticMappingsPath;
44
44
45
45
/// <summary>
46
46
/// Initializes a new instance of the <see cref="ContainerBuilder" /> class.
@@ -143,9 +143,11 @@ public WireMockContainerBuilder WithWatchStaticMappings(bool includeSubDirectori
143
143
[ PublicAPI ]
144
144
public WireMockContainerBuilder WithMappings ( string path , bool includeSubDirectories = false )
145
145
{
146
- _staticMappingsPath = Guard . NotNullOrEmpty ( path ) ;
146
+ Guard . NotNullOrEmpty ( path ) ;
147
147
148
- return WithReadStaticMappings ( ) . WithCommand ( $ "--WatchStaticMappingsInSubdirectories { includeSubDirectories } ") ;
148
+ return Merge ( DockerResourceConfiguration , DockerResourceConfiguration . WithStaticMappingsPath ( path ) )
149
+ . WithReadStaticMappings ( )
150
+ . WithCommand ( $ "--WatchStaticMappingsInSubdirectories { includeSubDirectories } ") ;
149
151
}
150
152
151
153
private WireMockContainerBuilder ( WireMockConfiguration dockerResourceConfiguration ) : base ( dockerResourceConfiguration )
@@ -178,9 +180,9 @@ public override WireMockContainer Build()
178
180
_imageOS = builder . DockerResourceConfiguration . Image . FullName . IndexOf ( "windows" , StringComparison . OrdinalIgnoreCase ) >= 0 ? OSPlatform . Windows : OSPlatform . Linux ;
179
181
}
180
182
181
- if ( ! string . IsNullOrEmpty ( _staticMappingsPath ) )
183
+ if ( ! string . IsNullOrEmpty ( builder . DockerResourceConfiguration . StaticMappingsPath ) )
182
184
{
183
- builder = builder . WithBindMount ( _staticMappingsPath , _info [ _imageOS . Value ] . MappingsPath ) ;
185
+ builder = builder . WithBindMount ( builder . DockerResourceConfiguration . StaticMappingsPath , _info [ _imageOS . Value ] . MappingsPath ) ;
184
186
}
185
187
186
188
builder . Validate ( ) ;
0 commit comments