use of io.helidon.config.Config in project helidon by oracle.
the class ConfigCreateDefaultFromMetaHoconTest method testCreateKeyFromSysProps.
@Test
@ExtendWith(RestoreSystemPropertiesExt.class)
public void testCreateKeyFromSysProps() {
System.setProperty(KEY, PROP_VALUE);
Config config = Config.create();
assertThat(config.get(KEY).asString(), is(ConfigValues.simpleValue(PROP_VALUE)));
}
use of io.helidon.config.Config in project helidon by oracle.
the class ConfigCreateDefaultFromMetaYamlTest method testCreateKeyFromSysProps.
@Test
@ExtendWith(RestoreSystemPropertiesExt.class)
public void testCreateKeyFromSysProps() {
System.setProperty(KEY, PROP_VALUE);
Config config = Config.create();
assertThat(config.get(KEY).asString(), is(ConfigValues.simpleValue(PROP_VALUE)));
}
use of io.helidon.config.Config in project helidon by oracle.
the class ConfigCreateDefaultFromMetaYamlTest method testCreate.
@Test
@ExtendWith(RestoreSystemPropertiesExt.class)
public void testCreate() {
Config config = Config.create();
assertThat(config.get(KEY).asString(), is(ConfigValues.simpleValue(CONFIG_VALUE)));
}
use of io.helidon.config.Config in project helidon by oracle.
the class BuilderConfigMapperTest method testTransientBuilder.
@Test
public void testTransientBuilder() {
Config config = Config.empty();
assertThrows(ConfigMappingException.class, () -> config.as(TransientBuilderBean.class).get());
}
use of io.helidon.config.Config in project helidon by oracle.
the class AbstractComplexConfigTest method testStringDefault.
//
// defaults
//
@Test
public void testStringDefault() {
Config node = getMissingConfig();
String defaultValue = "default-value";
String expected = defaultValue;
assertThat(node.asString().orElse(defaultValue), is(expected));
assertThat(node.as(String.class).orElse(defaultValue), is(expected));
}
Aggregations