mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-11-13 12:23:48 +01:00
Update WireMockContainerBuilder (WithImage and WithCustomImage) (#1391)
* Update WireMockContainerBuilder (WithImage and WithCustomImage) * .
This commit is contained in:
1 parent
ceabd27ce0
commit
e2acac55a4
2 files changed
+24
-1
No files matched your search
@@ -62,6 +62,29 @@ public sealed class WireMockContainerBuilder : ContainerBuilder<WireMockContaine
|
||||
return WithImage(OSPlatform.Windows);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets a custom WireMock.Net image for which to create the container.
|
||||
/// </summary>
|
||||
/// <param name="image">The image name.</param>
|
||||
/// <returns>A configured instance of <see cref="WireMockContainerBuilder"/></returns>
|
||||
[PublicAPI]
|
||||
public new WireMockContainerBuilder WithImage(string image)
|
||||
{
|
||||
return WithCustomImage(image);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets a custom WireMock.Net image for which to create the container.
|
||||
/// </summary>
|
||||
/// <param name="image">The image name.</param>
|
||||
/// <returns>A configured instance of <see cref="WireMockContainerBuilder"/></returns>
|
||||
[PublicAPI]
|
||||
public WireMockContainerBuilder WithCustomImage(string image)
|
||||
{
|
||||
_imageOS ??= TestcontainersUtils.GetImageOSAsync.Value.GetAwaiter().GetResult();
|
||||
return base.WithImage(image);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Set the admin username and password for the container (basic authentication).
|
||||
/// </summary>
|
||||
|
||||
@@ -92,7 +92,7 @@ public partial class TestcontainersTests(ITestOutputHelper testOutputHelper)
|
||||
}
|
||||
else
|
||||
{
|
||||
wireMockContainerBuilder = wireMockContainerBuilder.WithImage("sheyenrath/wiremock.net");
|
||||
wireMockContainerBuilder = wireMockContainerBuilder.WithImage("sheyenrath/wiremock.net-alpine");
|
||||
}
|
||||
|
||||
var wireMockContainer = wireMockContainerBuilder.Build();
|
||||
|
||||
Reference in new issue
Block a user