public StandardContext configure(Tomcat tomcat, Props props) {
    addStaticDir(tomcat, getContextPath(props) + "/deploy", new File(props.nonNullValueAsFile(PATH_DATA.getKey()), WEB_DEPLOY_PATH_RELATIVE_TO_DATA_DIR));

    StandardContext webapp = addContext(tomcat, getContextPath(props), webappDir(props));
    for (Map.Entry<Object, Object> entry : props.rawProperties().entrySet()) {
      String key = entry.getKey().toString();
      webapp.addParameter(key, entry.getValue().toString());
    }
    return webapp;
  }
@Test
  public void context_path_must_start_with_slash() {
    props.setProperty("sonar.web.context", "foo");

    assertThatThrownBy(() -> underTest.configure(tomcat, new Props(props)))
      .isInstanceOf(MessageException.class)
      .hasMessageContaining("Value of 'sonar.web.context' must start with a forward slash: 'foo'");
  }