use of org.springframework.boot.configurationprocessor.metadata.ItemHint in project spring-boot by spring-projects.
the class ConfigurationMetadataAnnotationProcessorTests method mergingOfHintWithProvider.
@Test
public void mergingOfHintWithProvider() throws Exception {
writeAdditionalHints(new ItemHint("simple.theName", Collections.<ItemHint.ValueHint>emptyList(), Arrays.asList(new ItemHint.ValueProvider("first", Collections.<String, Object>singletonMap("target", "org.foo")), new ItemHint.ValueProvider("second", null))));
ConfigurationMetadata metadata = compile(SimpleProperties.class);
assertThat(metadata).has(Metadata.withProperty("simple.the-name", String.class).fromSource(SimpleProperties.class).withDescription("The name of this simple properties.").withDefaultValue("boot").withDeprecation(null, null));
assertThat(metadata).has(Metadata.withHint("simple.the-name").withProvider("first", "target", "org.foo").withProvider("second"));
}
use of org.springframework.boot.configurationprocessor.metadata.ItemHint in project spring-boot by spring-projects.
the class MergeMetadataGenerationTests method mergingOfHintWithProvider.
@Test
void mergingOfHintWithProvider() throws Exception {
writeAdditionalHints(new ItemHint("simple.theName", Collections.emptyList(), Arrays.asList(new ItemHint.ValueProvider("first", Collections.singletonMap("target", "org.foo")), new ItemHint.ValueProvider("second", null))));
ConfigurationMetadata metadata = compile(SimpleProperties.class);
assertThat(metadata).has(Metadata.withProperty("simple.the-name", String.class).fromSource(SimpleProperties.class).withDescription("The name of this simple properties.").withDefaultValue("boot").withDeprecation(null, null));
assertThat(metadata).has(Metadata.withHint("simple.the-name").withProvider("first", "target", "org.foo").withProvider("second"));
}
Aggregations