Replace magic test port 12110 with 0 (#345)

Also introduce constants for some test package SHAs
to make them easier to update.
This commit is contained in:
translatenix authored and GitHub committed 2024-03-20 10:47:28 -07:00
1 parent 2aa60eaf1f
commit dfe85b786e
123 files changed
+469 -469

No files matched your search

@@ -111,8 +111,8 @@ public interface HttpClient extends AutoCloseable {
/**
* Sets a test server's listening port.
*
* <p>If set, requests that specify port 12110 will be modified to use the given port. This is
* an internal test option.
* <p>If set, requests that specify port 0 will be modified to use the given port. This is an
* internal test option.
*/
Builder setTestPort(int port);
@@ -105,9 +105,7 @@ final class RequestRewritingClient implements HttpClient {
}
private URI rewriteUri(URI uri) {
// Would be nice to use port 0 instead of 12110,
// but this is best done in a separate commit.
if (testPort != -1 && uri.getPort() == 12110) {
if (testPort != -1 && uri.getPort() == 0) {
return HttpUtils.setPort(uri, testPort);
}
return uri;