DatabaseClient { public final Map<String, String> getProperties() { Map<String, String> props = new HashMap<>(); props.putAll(additionalProperties); addProperty(props, "sonar.jdbc.dialect", getDialect()); addProperty(props, "sonar.jdbc.url", url); addProperty(props, "sonar.jdbc.schema", schema); addProperty(props, "sonar.jdbc.username", login); addProperty(props, "sonar.jdbc.password", password); addProperty(props, "sonar.jdbc.rootUrl", rootUrl); addProperty(props, "sonar.jdbc.rootUsername", rootLogin); addProperty(props, "sonar.jdbc.rootPassword", rootPassword); addProperty(props, "sonar.jdbc.driverClassName", driverClassName); if (driverFile != null) { addProperty(props, "sonar.jdbc.driverFile", driverFile.getAbsolutePath()); } return props; } protected  DatabaseClient(Builder builder); abstract String getDialect(); String getDriverClassName(); File getDriverFile(); boolean isDropAndCreate(); void setDropAndCreate(boolean dropAndCreate); String getUrl(); String getSchema(); String getLogin(); String getPassword(); String getRootUrl(); String getRootLogin(); String getRootPassword(); Map<String, String> getAdditionalProperties(); int getDBMajorVersion(); int getDBMinorVersion(); String getDBProductName(); String[] getDropDdl(); String[] getCreateDdl(); @CheckForNull String getSelectConnectionIdsSql(); @CheckForNull String getKillConnectionSql(String connectionId); final Map<String, String> getProperties(); @Override String toString(); Connection openConnection(); Connection openRootConnection();  }
@Test public void testGetProperties() { H2 h2 = H2.builder().setDriverClassName("my.Driver").build(); Map<String, String> props = h2.getProperties(); assertThat(props.get("sonar.jdbc.dialect")).isEqualTo("h2"); assertThat(props.get("sonar.jdbc.username")).isEqualTo("sonar"); assertThat(props.get("sonar.jdbc.password")).isEqualTo("sonar"); assertThat(props.get("sonar.jdbc.driverClassName")).isEqualTo("my.Driver"); assertThat(h2.isDropAndCreate()).isFalse(); }