Search in sources :

Example 1 with SimpleTypeProperties

use of org.springframework.boot.configurationsample.simple.SimpleTypeProperties 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);
}
Also used : SimpleTypeProperties(org.springframework.boot.configurationsample.simple.SimpleTypeProperties) ConfigurationMetadata(org.springframework.boot.configurationprocessor.metadata.ConfigurationMetadata) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 ConfigurationMetadata (org.springframework.boot.configurationprocessor.metadata.ConfigurationMetadata)1 SimpleTypeProperties (org.springframework.boot.configurationsample.simple.SimpleTypeProperties)1