Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WireMock.Net 1.5.46 is incompatible with TestContainers 3.7.0 (issue 2) #1059

Closed
ruairica opened this issue Jan 24, 2024 · 3 comments
Closed
Assignees
Labels

Comments

@ruairica
Copy link

Describe the bug

When using another TestContainers Module that relies on Testcontainers 3.7.0, WireMock container throws an exception.
Program.cs

using DotNet.Testcontainers.Builders;
using WireMock.Net.Testcontainers;
await new WireMockContainerBuilder()
    .WithAutoRemove(true)
    .WithCleanUp(true)
    .Build().StartAsync().ConfigureAwait(false);

await new ContainerBuilder()
    .WithImage("testcontainers/helloworld:1.1.0")
    .WithPortBinding(8080, true)
    .WithWaitStrategy(Wait.ForUnixContainer().UntilHttpRequestIsSucceeded(r => r.ForPort(8080)))
    .Build()
    .StartAsync()
    .ConfigureAwait(false);

this code fails throws exception

Unhandled exception. System.MissingMethodException: Method not found: 'Void DotNet.Testcontainers.Configurations.ContainerConfiguration..ctor(DotNet.Testcontainers.Images.IImage, System.Func`2<Dock
   at WireMock.Net.Testcontainers.WireMockConfiguration..ctor(String username, String password)
   at WireMock.Net.Testcontainers.WireMockContainerBuilder..ctor()

when the csproj is

    <PackageReference Include="WireMock.Net.Testcontainers" Version="1.5.46" />
    <PackageReference Include="Testcontainers.CosmosDb" Version="3.7.0" />

the exception is not thrown when I downgrade Testcontainers.CosmosDb to 3.6.0.

Expected behavior:

On nuget (https://www.nuget.org/packages/WireMock.Net.Testcontainers#dependencies-body-tab) states atleast 3.6.0 TestContainers https://www.nuget.org/packages/Testcontainers/) (>= 3.6.0) so I would expect it not to throw an exception when I upgrade the other module to 3.7.0

Test to reproduce

Create a new console application
add the following to .csproj

  <PackageReference Include="WireMock.Net.Testcontainers" Version="1.5.46" />
    <PackageReference Include="Testcontainers.CosmosDb" Version="3.7.0" />

Program.cs:

using Testcontainers.CosmosDb;
using WireMock.Net.Testcontainers;

await new WireMockContainerBuilder()
    .WithAutoRemove(true)
    .WithCleanUp(true)
    .Build()
    .StartAsync();

await new CosmosDbBuilder()
    .Build()
    .StartAsync()
    .ConfigureAwait(false);
@ruairica ruairica added the bug label Jan 24, 2024
@StefH StefH changed the title WireMock 1.5.46 is incompatible with TestContainers 3.7.0 WireMock.Net 1.5.46 is incompatible with TestContainers 3.7.0 (2) Jan 24, 2024
@StefH StefH changed the title WireMock.Net 1.5.46 is incompatible with TestContainers 3.7.0 (2) WireMock.Net 1.5.46 is incompatible with TestContainers 3.7.0 (issue 2) Jan 24, 2024
@StefH StefH self-assigned this Jan 24, 2024
@StefH
Copy link
Collaborator

StefH commented Jan 24, 2024

@ruairica
You can try preview version 1.5.46-ci-18317 if that solves your problem.

https://github.com/WireMock-Net/WireMock.Net/wiki/MyGet-preview-versions

@StefH
Copy link
Collaborator

StefH commented Jan 25, 2024

#1059

@StefH
Copy link
Collaborator

StefH commented Jan 25, 2024

I'll release a new official NuGet today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants