public Connector createConnector(Props props) {
    Connector connector = new Connector(HTTP_PROTOCOL);
    connector.setURIEncoding("UTF-8");
    connector.setProperty("address", props.value(WEB_HOST.getKey(), "0.0.0.0"));
    connector.setProperty("socket.soReuseAddress", "true");
    // See Tomcat configuration reference: https://tomcat.apache.org/tomcat-9.0-doc/config/http.html
    connector.setProperty("relaxedQueryChars", "\"<>[\\]^`{|}");
    connector.setProperty("maxHttpHeaderSize", String.valueOf(MAX_HTTP_HEADER_SIZE_BYTES));
    connector.setMaxPostSize(MAX_POST_SIZE);
    configurePort(connector, props);
    configurePool(props, connector);
    configureCompression(connector);
    return connector;
  }
@Test
  public void createConnector_whenNotValidPort_shouldThrow() {
    Props props = getEmptyProps();
    props.set("sonar.web.port", "-1");
    assertThatThrownBy(() -> tomcatHttpConnectorFactory.createConnector(props))
      .isInstanceOf(IllegalStateException.class)
      .hasMessage("HTTP port -1 is invalid");
  }