use of org.springframework.boot.context.config.ConfigData.Options in project spring-boot by spring-projects.
the class ConfigDataTests method optionsWithoutReturnsNewOptions.
@Test
void optionsWithoutReturnsNewOptions() {
Options options = Options.of(Option.IGNORE_IMPORTS, Option.IGNORE_PROFILES);
Options without = options.without(Option.IGNORE_PROFILES);
assertThat(options.asSet()).containsExactly(Option.IGNORE_IMPORTS, Option.IGNORE_PROFILES);
assertThat(without.asSet()).containsExactly(Option.IGNORE_IMPORTS);
}
use of org.springframework.boot.context.config.ConfigData.Options in project spring-boot by spring-projects.
the class ConfigDataTests method optionsOfUsesCopyOfOptions.
@Test
void optionsOfUsesCopyOfOptions() {
Option[] array = { Option.IGNORE_IMPORTS, Option.IGNORE_PROFILES };
Options options = Options.of(array);
array[0] = Option.PROFILE_SPECIFIC;
assertThat(options.asSet()).containsExactly(Option.IGNORE_IMPORTS, Option.IGNORE_PROFILES);
}
use of org.springframework.boot.context.config.ConfigData.Options in project spring-boot by spring-projects.
the class ConfigDataTests method getOptionsReturnsOptionsFromPropertySourceOptions.
@Test
void getOptionsReturnsOptionsFromPropertySourceOptions() {
MapPropertySource source1 = new MapPropertySource("test", Collections.emptyMap());
MapPropertySource source2 = new MapPropertySource("test", Collections.emptyMap());
Options options1 = Options.of(Option.IGNORE_IMPORTS);
Options options2 = Options.of(Option.IGNORE_PROFILES);
PropertySourceOptions propertySourceOptions = (source) -> (source != source1) ? options2 : options1;
ConfigData configData = new ConfigData(Arrays.asList(source1, source2), propertySourceOptions);
assertThat(configData.getOptions(source1)).isEqualTo(options1);
assertThat(configData.getOptions(source2)).isEqualTo(options2);
}
use of org.springframework.boot.context.config.ConfigData.Options in project spring-boot by spring-projects.
the class ConfigDataTests method optionsWithReturnsNewOptions.
@Test
void optionsWithReturnsNewOptions() {
Options options = Options.of(Option.IGNORE_IMPORTS);
Options with = options.with(Option.IGNORE_PROFILES);
assertThat(options.asSet()).containsExactly(Option.IGNORE_IMPORTS);
assertThat(with.asSet()).containsExactly(Option.IGNORE_IMPORTS, Option.IGNORE_PROFILES);
}
use of org.springframework.boot.context.config.ConfigData.Options in project spring-boot by spring-projects.
the class ConfigDataTests method optionsOfCreatesOptions.
@Test
void optionsOfCreatesOptions() {
Options options = Options.of(Option.IGNORE_IMPORTS, Option.IGNORE_PROFILES);
assertThat(options.asSet()).containsExactly(Option.IGNORE_IMPORTS, Option.IGNORE_PROFILES);
}
Aggregations