Skip to content

Support default port for known schemas#1478

Open
DavidJohnWilliams wants to merge 1 commit into
wiremock:masterfrom
DavidJohnWilliams:1477-default-ports
Open

Support default port for known schemas#1478
DavidJohnWilliams wants to merge 1 commit into
wiremock:masterfrom
DavidJohnWilliams:1477-default-ports

Conversation

@DavidJohnWilliams

Copy link
Copy Markdown
  • Update tests which expected urls without port to fail
  • Add new tests for default ports

References

Submitter checklist

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

- Update tests which expected urls without port to fail
- Add new tests for default ports
@StefH StefH added the feature label Jun 26, 2026
@StefH StefH self-requested a review June 26, 2026 12:32
public void PortUtils_TryExtract_DefaultPort_Https_Returns_True()
{
// Assign
var url = "https://0.0.0.0";

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you check if you can also add a "real" unit test which starts wiremock at https;//0.0.0.0 or https://localhost with that port?

Like this:
https://github.com/wiremock/WireMock.Net/blob/master/test/WireMock.Net.Tests/WireMockServerTests.cs#L199

(it could be that that test runs locally correct, and maybe in CI-CD fails, maybe, we have to see)

@DavidJohnWilliams

Copy link
Copy Markdown
Author

@StefH I tried adding a test as you suggested and it fails I believe because the port is already in use.

I guess something to do with running as a hosted service under IIS vs running in a unit test context.

It's essentially calling the same code WireMockServer.Start but I'm guessing there is a lot going on under the hood that I don't know about.

@StefH

StefH commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

I guess you test locally in Windows?


If you create a simple console-app, and use that setup, does it also fail?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants