Ability To Pin WireMock.NET Test Container To A Particular Version Of WireMock.NET #620

Closed
opened 2025-12-29 08:31:18 +01:00 by adam · 7 comments
Owner

Originally created by @Xor-el on GitHub (Jul 29, 2024).

Originally assigned to: @StefH on GitHub.

Is your feature request related to a problem? Please describe.

As of today, it is not possible to anchor a WireMock.NET test container to a specific version of WireMock, unlike other test containers such as Redis and SQL Server that offer this capability. Recently, the SQL Server Docker Image incorporated a breaking change, which subsequently disrupted SQL Server test containers in numerous CI/CD pipelines where the image was not pinned to a fixed version. Fortunately, these containers permit version pinning, thereby providing a provisional solution for development teams while the underlying issue is addressed.

Furthermore, it is deemed best practice by the test container team to consistently pin the image to a specific version.

Describe the solution you'd like
Having the ability to pin the needed WireMock.NET version when building a WireMock.NET test container would be a welcome development.

Describe alternatives you've considered
N/A

Is your feature request supported by WireMock (java version)? Please provide details.
Provide relevant information if requested feature is supported in Handlebarsjs but is missing in our implementation.
N/A

Additional context
N/A

Originally created by @Xor-el on GitHub (Jul 29, 2024). Originally assigned to: @StefH on GitHub. **Is your feature request related to a problem? Please describe.** As of today, it is not possible to anchor a WireMock.NET test container to a specific version of WireMock, unlike other test containers such as Redis and SQL Server that offer this capability. Recently, the SQL Server Docker Image incorporated a [breaking change](https://github.com/microsoft/mssql-docker/issues/892), [which subsequently disrupted](https://github.com/testcontainers/testcontainers-dotnet/issues/1220) SQL Server test containers in numerous CI/CD pipelines where the image was not pinned to a fixed version. Fortunately, these containers permit version pinning, thereby providing a provisional solution for development teams while the underlying issue is addressed. Furthermore, it is deemed [best practice](https://dotnet.testcontainers.org/api/best_practices/) by the test container team to consistently pin the image to a specific version. **Describe the solution you'd like** Having the ability to pin the needed WireMock.NET version when building a WireMock.NET test container would be a welcome development. **Describe alternatives you've considered** N/A **Is your feature request supported by [WireMock (java version)](https://www.wiremock.org)? Please provide details.** Provide relevant information if requested feature is supported in [Handlebarsjs](https://handlebarsjs.com/) but is missing in our implementation. N/A **Additional context** N/A
adam added the question label 2025-12-29 08:31:18 +01:00
adam closed this issue 2025-12-29 08:31:18 +01:00
Author
Owner

@StefH commented on GitHub (Sep 25, 2024):

https://github.com/WireMock-Net/WireMock.Net/pull/1181

@StefH commented on GitHub (Sep 25, 2024): https://github.com/WireMock-Net/WireMock.Net/pull/1181
Author
Owner

@StefH commented on GitHub (Sep 25, 2024):

@Xor-el
This is already possible.

By default you would use this code:

var container = new WireMockContainerBuilder()
            .WithAdminUserNameAndPassword("x", "y")
            .WithAutoRemove(true)
            .WithCleanUp(true)
            .Build();

And in case you want to use a different version, use:

var container = new WireMockContainerBuilder()
            .WithImage("sheyenrath/wiremock.net-alpine:1.6.4")
            .WithAdminUserNameAndPassword("x", "y")
            .WithAutoRemove(true)
            .WithCleanUp(true)
            .Build();
@StefH commented on GitHub (Sep 25, 2024): @Xor-el This is already possible. By default you would use this code: ``` c# var container = new WireMockContainerBuilder() .WithAdminUserNameAndPassword("x", "y") .WithAutoRemove(true) .WithCleanUp(true) .Build(); ``` And in case you want to use a different version, use: ``` c# var container = new WireMockContainerBuilder() .WithImage("sheyenrath/wiremock.net-alpine:1.6.4") .WithAdminUserNameAndPassword("x", "y") .WithAutoRemove(true) .WithCleanUp(true) .Build(); ```
Author
Owner

@Xor-el commented on GitHub (Sep 26, 2024):

Hello @StefH thanks for the sample and changes.
very much appreciated.

@Xor-el commented on GitHub (Sep 26, 2024): Hello @StefH thanks for the sample and changes. very much appreciated.
Author
Owner

@StefH commented on GitHub (Sep 26, 2024):

If you have time, can you also take a quick look at the PR https://github.com/WireMock-Net/WireMock.Net/pull/1181

If it's correct, I'll merge this PR to master.

@StefH commented on GitHub (Sep 26, 2024): If you have time, can you also take a quick look at the PR https://github.com/WireMock-Net/WireMock.Net/pull/1181 If it's correct, I'll merge this PR to master.
Author
Owner

@Xor-el commented on GitHub (Sep 26, 2024):

PR looks good to me. I just added one minor comment, please take a look at it.

@Xor-el commented on GitHub (Sep 26, 2024): PR looks good to me. I just added one minor comment, please take a look at it.
Author
Owner

@StefH commented on GitHub (Sep 26, 2024):

PR looks good to me. I just added one minor comment, please take a look at it.

I cannot see your comment? Did you save it?

@StefH commented on GitHub (Sep 26, 2024): > PR looks good to me. I just added one minor comment, please take a look at it. I cannot see your comment? Did you save it?
Author
Owner

@Xor-el commented on GitHub (Sep 26, 2024):

PR looks good to me. I just added one minor comment, please take a look at it.

I cannot see your comment? Did you save it?

apologies, submitted now

@Xor-el commented on GitHub (Sep 26, 2024): > > PR looks good to me. I just added one minor comment, please take a look at it. > > I cannot see your comment? Did you save it? apologies, submitted now
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/WireMock.Net#620