LocalRequest implements HttpRequest { @Override public Optional<Integer> getPort() { final int port = request.url().port(); final int defaultPort = defaultPort(request.url().scheme()); return port == defaultPort ? Optional.empty() : Optional.of(port); }  @Override String getRemote(); @Override String getMethod(); @Override String getScheme(); @Override String getHost(); @Override Optional<Integer> getPort(); @Override String getPath(); @Override String getQuery(); @Override String getProtocolVersion(); @Override Origin getOrigin(); @Override HttpHeaders getHeaders(); @Override String getContentType(); @Override Charset getCharset(); @Override HttpRequest withBody(); @Override HttpRequest withoutBody(); @Override byte[] getBody();  }
@Test void shouldIgnoreDefaultHttpPort() { final LocalRequest unit = unit(get("http: assertThat(unit.getPort(), is(empty())); }
@Test void shouldIgnoreDefaultHttpsPort() { final LocalRequest unit = unit(get("https: assertThat(unit.getPort(), is(empty())); }