Java 类org.springframework.boot.configurationsample.simple.DeprecatedSingleProperty 实例源码

项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:ConfigurationMetadataAnnotationProcessorTests.java   
@Test
public void singleDeprecatedProperty() throws Exception {
    Class<?> type = DeprecatedSingleProperty.class;
    ConfigurationMetadata metadata = compile(type);
    assertThat(metadata).has(Metadata.withGroup("singledeprecated").fromSource(type));
    assertThat(metadata)
            .has(Metadata.withProperty("singledeprecated.new-name", String.class)
                    .fromSource(type));
    assertThat(metadata).has(Metadata
            .withProperty("singledeprecated.name", String.class).fromSource(type)
            .withDeprecation("renamed", "singledeprecated.new-name"));
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:ConfigurationMetadataAnnotationProcessorTests.java   
@Test
public void mergeExistingPropertyDeprecationOverride() throws Exception {
    ItemMetadata property = ItemMetadata.newProperty("singledeprecated", "name", null,
            null, null, null, null,
            new ItemDeprecation("Don't use this.", "single.name"));
    writeAdditionalMetadata(property);
    ConfigurationMetadata metadata = compile(DeprecatedSingleProperty.class);
    assertThat(metadata).has(
            Metadata.withProperty("singledeprecated.name", String.class.getName())
                    .fromSource(DeprecatedSingleProperty.class)
                    .withDeprecation("Don't use this.", "single.name"));
    assertThat(metadata.getItems()).hasSize(3);
}
项目:spring-boot-concourse    文件:ConfigurationMetadataAnnotationProcessorTests.java   
@Test
public void singleDeprecatedProperty() throws Exception {
    Class<?> type = DeprecatedSingleProperty.class;
    ConfigurationMetadata metadata = compile(type);
    assertThat(metadata).has(Metadata.withGroup("singledeprecated").fromSource(type));
    assertThat(metadata)
            .has(Metadata.withProperty("singledeprecated.new-name", String.class)
                    .fromSource(type));
    assertThat(metadata).has(Metadata
            .withProperty("singledeprecated.name", String.class).fromSource(type)
            .withDeprecation("renamed", "singledeprecated.new-name"));
}
项目:spring-boot-concourse    文件:ConfigurationMetadataAnnotationProcessorTests.java   
@Test
public void mergeExistingPropertyDeprecationOverride() throws Exception {
    ItemMetadata property = ItemMetadata.newProperty("singledeprecated", "name", null,
            null, null, null, null,
            new ItemDeprecation("Don't use this.", "single.name"));
    writeAdditionalMetadata(property);
    ConfigurationMetadata metadata = compile(DeprecatedSingleProperty.class);
    assertThat(metadata).has(
            Metadata.withProperty("singledeprecated.name", String.class.getName())
                    .fromSource(DeprecatedSingleProperty.class)
                    .withDeprecation("Don't use this.", "single.name"));
    assertThat(metadata.getItems()).hasSize(3);
}
项目:contestparser    文件:ConfigurationMetadataAnnotationProcessorTests.java   
@Test
public void singleDeprecatedProprety() throws Exception {
    Class<?> type = DeprecatedSingleProperty.class;
    ConfigurationMetadata metadata = compile(type);
    assertThat(metadata, containsGroup("singledeprecated").fromSource(type));
    assertThat(metadata, containsProperty("singledeprecated.new-name", String.class)
            .fromSource(type));
    assertThat(metadata,
            containsProperty("singledeprecated.name", String.class).fromSource(type)
                    .withDeprecation("renamed", "singledeprecated.new-name"));
}
项目:contestparser    文件:ConfigurationMetadataAnnotationProcessorTests.java   
@Test
public void mergeExistingPropertyDeprecationOverride() throws Exception {
    ItemMetadata property = ItemMetadata.newProperty("singledeprecated", "name", null,
            null, null, null, null,
            new ItemDeprecation("Don't use this.", "single.name"));
    writeAdditionalMetadata(property);
    ConfigurationMetadata metadata = compile(DeprecatedSingleProperty.class);
    assertThat(metadata,
            containsProperty("singledeprecated.name", String.class.getName())
                    .fromSource(DeprecatedSingleProperty.class)
                    .withDeprecation("Don't use this.", "single.name"));
    assertThat(metadata.getItems().size(), is(3));
}