public String getBaseUrl() {
    String url = config.get(SERVER_BASE_URL).orElse("");
    if (isEmpty(url)) {
      url = computeBaseUrl();
    }
    // Remove trailing slashes
    return StringUtils.removeEnd(url, "/");
  }
@Test
  public void getBaseUrl_throws_when_port_not_an_int() {
    settings.setProperty(PORT_PORPERTY, "not a number");

    assertThatThrownBy(() ->  underTest().getBaseUrl())
      .isInstanceOf(IllegalStateException.class)
      .hasMessageContaining("The property 'sonar.web.port' is not an int value");
  }