use of org.springframework.boot.actuate.context.properties.ConfigurationPropertiesReportEndpoint.ConfigurationPropertiesBeanDescriptor in project spring-boot by spring-projects.
the class ConfigurationPropertiesReportEndpointSerializationTests method testInetAddress.
@Test
void testInetAddress() {
ApplicationContextRunner contextRunner = new ApplicationContextRunner().withUserConfiguration(AddressedConfig.class).withPropertyValues("foo.address:192.168.1.10");
contextRunner.run((context) -> {
ConfigurationPropertiesReportEndpoint endpoint = context.getBean(ConfigurationPropertiesReportEndpoint.class);
ApplicationConfigurationProperties applicationProperties = endpoint.configurationProperties();
ConfigurationPropertiesBeanDescriptor foo = applicationProperties.getContexts().get(context.getId()).getBeans().get("foo");
assertThat(foo).isNotNull();
assertThat(foo.getPrefix()).isEqualTo("foo");
Map<String, Object> map = foo.getProperties();
assertThat(map).isNotNull();
assertThat(map).hasSize(3);
assertThat(map.get("address")).isEqualTo("192.168.1.10");
});
}
Aggregations