wiremock / wiremock-testcontainers-go

WireMock module for Testcontainers Go

Home Page:https://wiremock.org/docs/solutions/testcontainers/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Mappings not applied when running on Windows

jmabuc opened this issue · comments

Proposal

When running the quickstart example on Windows, mappings are not applied and the test fails with a 404 error. The test succeeds when runnig the same example on Windows with WSL. The example should run on Windows as well.
By looking at the code at https://github.com/wiremock/wiremock-testcontainers-go/blob/main/tc-wiremock.go#L97:
ContainerFilePath: filepath.Join("/home/wiremock/mappings", id+".json"),
The path is built by calling filepath.Join. This seems to fail in Windows.

It works fine if the line is changed in the following way:
ContainerFilePath: "/home/wiremock/mappings/" + id + ".json",

This is the same approach used in line https://github.com/wiremock/wiremock-testcontainers-go/blob/main/tc-wiremock.go#L110

Reproduction steps

Run the quickstart example on Windows.

References

No response