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

fix: Use addExposedPort instead of setExposedPort which overrides user configuration #171

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

TheRealGuru
Copy link

…r configuration

Currently it is impossible to configure SSL, rather than go through all the hoops to add proper configuration for SSL I've applied this hotfix. By using addExposedPort we do not override the user configuration. Currently if I was to do the following:

  WireMockContainer wiremockServer = new WireMockContainer("wiremock/wiremock:2.35.0").withExposedPorts(8443);

This would never bind 8443 because when the container is started the configure also calls withExposedPorts, therefore overriding the user configured values.

This means we cannot configure SSL as we need a port for HTTP and HTTPS.

For testing I simply exposed an additional port to test that this would no longer override that port - this test if tried without the code change will fail. This confirms that the code is working as expected.

References

#164

Submitter checklist

  • Recommended: Join WireMock Slack to get any help in #help-contributing or a project-specific channel like #wiremock-java
  • [ x ] The PR request is well described and justified, including the body and the references
  • [ x ] The PR title represents the desired changelog entry
  • [ x ] The repository's code style is followed (see the contributing guide)
  • [ x ] Test coverage that demonstrates that the change works as expected
  • [ x ] For new features, there's necessary documentation in this pull request or in a subsequent PR to wiremock.org

@TheRealGuru TheRealGuru changed the title fix: Use addExposedPort instead of setExposedPort which overrides use… fix: Use addExposedPort instead of setExposedPort which overrides user configuration Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant