use of org.springframework.boot.configurationprocessor.metadata.ConfigurationMetadata in project spring-boot by spring-projects.
the class ConfigurationMetadataAnnotationProcessorTests method simpleProperties.
@Test
public void simpleProperties() throws Exception {
ConfigurationMetadata metadata = compile(SimpleProperties.class);
assertThat(metadata).has(Metadata.withGroup("simple").fromSource(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.withProperty("simple.flag", Boolean.class).fromSource(SimpleProperties.class).withDescription("A simple flag.").withDeprecation(null, null));
assertThat(metadata).has(Metadata.withProperty("simple.comparator"));
assertThat(metadata).doesNotHave(Metadata.withProperty("simple.counter"));
assertThat(metadata).doesNotHave(Metadata.withProperty("simple.size"));
}
use of org.springframework.boot.configurationprocessor.metadata.ConfigurationMetadata in project spring-boot by spring-projects.
the class ConfigurationMetadataAnnotationProcessorTests method mergingOfHintWithNonCanonicalName.
@Test
public void mergingOfHintWithNonCanonicalName() throws Exception {
writeAdditionalHints(ItemHint.newHint("simple.theName", new ItemHint.ValueHint("boot", "Bla bla")));
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").withValue(0, "boot", "Bla bla"));
}
use of org.springframework.boot.configurationprocessor.metadata.ConfigurationMetadata in project spring-boot by spring-projects.
the class ConfigurationMetadataAnnotationProcessorTests method simpleTypeProperties.
@Test
public void simpleTypeProperties() throws Exception {
ConfigurationMetadata metadata = compile(SimpleTypeProperties.class);
assertThat(metadata).has(Metadata.withGroup("simple.type").fromSource(SimpleTypeProperties.class));
assertThat(metadata).has(Metadata.withProperty("simple.type.my-string", String.class));
assertThat(metadata).has(Metadata.withProperty("simple.type.my-byte", Byte.class));
assertThat(metadata).has(Metadata.withProperty("simple.type.my-primitive-byte", Byte.class));
assertThat(metadata).has(Metadata.withProperty("simple.type.my-char", Character.class));
assertThat(metadata).has(Metadata.withProperty("simple.type.my-primitive-char", Character.class));
assertThat(metadata).has(Metadata.withProperty("simple.type.my-boolean", Boolean.class));
assertThat(metadata).has(Metadata.withProperty("simple.type.my-primitive-boolean", Boolean.class));
assertThat(metadata).has(Metadata.withProperty("simple.type.my-short", Short.class));
assertThat(metadata).has(Metadata.withProperty("simple.type.my-primitive-short", Short.class));
assertThat(metadata).has(Metadata.withProperty("simple.type.my-integer", Integer.class));
assertThat(metadata).has(Metadata.withProperty("simple.type.my-primitive-integer", Integer.class));
assertThat(metadata).has(Metadata.withProperty("simple.type.my-long", Long.class));
assertThat(metadata).has(Metadata.withProperty("simple.type.my-primitive-long", Long.class));
assertThat(metadata).has(Metadata.withProperty("simple.type.my-double", Double.class));
assertThat(metadata).has(Metadata.withProperty("simple.type.my-primitive-double", Double.class));
assertThat(metadata).has(Metadata.withProperty("simple.type.my-float", Float.class));
assertThat(metadata).has(Metadata.withProperty("simple.type.my-primitive-float", Float.class));
assertThat(metadata.getItems().size()).isEqualTo(18);
}
use of org.springframework.boot.configurationprocessor.metadata.ConfigurationMetadata in project spring-boot by spring-projects.
the class ConfigurationMetadataAnnotationProcessorTests method innerClassRootConfig.
@Test
public void innerClassRootConfig() throws Exception {
ConfigurationMetadata metadata = compile(InnerClassRootConfig.class);
assertThat(metadata).has(Metadata.withProperty("config.name"));
}
Aggregations