use of io.smallrye.config.SmallRyeConfig in project jqa-core-framework by buschmais.
the class ConfigurationLoaderImpl method load.
@Override
public Configuration load(File configurationDirectory, ConfigSource... configSources) {
List<ConfigSource> yamlConfigSources = getYamlConfigSources(configurationDirectory);
SmallRyeConfig config = new SmallRyeConfigBuilder().withMapping(Configuration.class).addDefaultSources().withSources(yamlConfigSources).withSources(configSources).withValidateUnknown(false).build();
return config.getConfigMapping(Configuration.class);
}
use of io.smallrye.config.SmallRyeConfig in project keycloak by keycloak.
the class ConfigurationTest method testDatabaseUrlProperties.
@Test
public void testDatabaseUrlProperties() {
System.setProperty(CLI_ARGS, "--db=mariadb" + ARG_SEPARATOR + "--db-url=jdbc:mariadb:aurora://foo/bar?a=1&b=2");
SmallRyeConfig config = createConfig();
assertEquals(MariaDBDialect.class.getName(), config.getConfigValue("quarkus.hibernate-orm.dialect").getValue());
assertEquals("jdbc:mariadb:aurora://foo/bar?a=1&b=2", config.getConfigValue("quarkus.datasource.jdbc.url").getValue());
}
use of io.smallrye.config.SmallRyeConfig in project keycloak by keycloak.
the class ConfigurationTest method testNestedDatabaseProperties.
// KEYCLOAK-15632
@Test
public void testNestedDatabaseProperties() {
System.setProperty("kc.home.dir", "/tmp/kc/bin/../");
SmallRyeConfig config = createConfig();
assertEquals("jdbc:h2:file:/tmp/kc/bin/..//data/keycloakdb", config.getConfigValue("quarkus.datasource.foo").getValue());
Assert.assertEquals("foo-def-suffix", config.getConfigValue("quarkus.datasource.bar").getValue());
System.setProperty("kc.prop5", "val5");
config = createConfig();
Assert.assertEquals("foo-val5-suffix", config.getConfigValue("quarkus.datasource.bar").getValue());
System.setProperty("kc.prop4", "val4");
config = createConfig();
Assert.assertEquals("foo-val4", config.getConfigValue("quarkus.datasource.bar").getValue());
System.setProperty("kc.prop3", "val3");
config = createConfig();
Assert.assertEquals("foo-val3", config.getConfigValue("quarkus.datasource.bar").getValue());
}
use of io.smallrye.config.SmallRyeConfig in project keycloak by keycloak.
the class ConfigurationTest method testResolveMetricsOption.
@Test
public void testResolveMetricsOption() {
System.setProperty(CLI_ARGS, "--metrics-enabled=true");
SmallRyeConfig config = createConfig();
assertEquals("true", config.getConfigValue("quarkus.datasource.metrics.enabled").getValue());
}
use of io.smallrye.config.SmallRyeConfig in project keycloak by keycloak.
the class ConfigurationTest method testDefaultDbPropertiesGetApplied.
@Test
public void testDefaultDbPropertiesGetApplied() {
System.setProperty(CLI_ARGS, "--db=postgres" + ARG_SEPARATOR + "--db-url-host=myhost" + ARG_SEPARATOR + "--db-url-database=kcdb" + ARG_SEPARATOR + "--db-url-properties=?foo=bar");
SmallRyeConfig config = createConfig();
assertEquals("io.quarkus.hibernate.orm.runtime.dialect.QuarkusPostgreSQL10Dialect", config.getConfigValue("quarkus.hibernate-orm.dialect").getValue());
assertEquals("jdbc:postgresql://myhost/kcdb?foo=bar", config.getConfigValue("quarkus.datasource.jdbc.url").getValue());
assertEquals("postgresql", config.getConfigValue("quarkus.datasource.db-kind").getValue());
}
Aggregations