@VisibleForTesting
  static Properties extractCommonsHikariProperties(Properties properties) {
    Properties result = new Properties();
    for (Map.Entry<Object, Object> entry : properties.entrySet()) {
      String key = (String) entry.getKey();
      if (!ALLOWED_SONAR_PROPERTIES.contains(key)) {
        if (DEPRECATED_SONAR_PROPERTIES.contains(key)) {
          LOG.warn("Property [{}] has no effect as pool connection implementation changed, check 9.7 upgrade notes.", key);
        }
        continue;
      }
      if (StringUtils.startsWith(key, SONAR_JDBC)) {
        String resolvedKey = toHikariPropertyKey(key);
        String existingValue = (String) result.setProperty(resolvedKey, (String) entry.getValue());
        checkState(existingValue == null || existingValue.equals(entry.getValue()),
          "Duplicate property declaration for resolved jdbc key '%s': conflicting values are '%s' and '%s'", resolvedKey, existingValue, entry.getValue());
        result.setProperty(resolvedKey, (String) entry.getValue());
      }
    }
    return result;
  }
@Test
  public void logWarningIfDeprecatedPropertyUsed() {
    Properties props = new Properties();

    props.setProperty("sonar.jdbc.maxIdle", "5");
    props.setProperty("sonar.jdbc.minEvictableIdleTimeMillis", "300000");
    props.setProperty("sonar.jdbc.timeBetweenEvictionRunsMillis", "1000");
    props.setProperty("sonar.jdbc.connectionTimeout", "8000");

    DefaultDatabase.extractCommonsHikariProperties(props);

    assertThat(logTester.logs())
      .contains("Property [sonar.jdbc.maxIdle] has no effect as pool connection implementation changed, check 9.7 upgrade notes.")
      .contains("Property [sonar.jdbc.minEvictableIdleTimeMillis] has no effect as pool connection implementation changed, check 9.7 upgrade notes.")
      .contains("Property [sonar.jdbc.timeBetweenEvictionRunsMillis] has no effect as pool connection implementation changed, check 9.7 upgrade notes.");
  }