use of org.springframework.boot.context.properties.source.ConfigurationProperty in project spring-boot by spring-projects.
the class InvalidConfigDataPropertyExceptionTests method createWhenProfileSpecificHasCorrectMessage.
@Test
void createWhenProfileSpecificHasCorrectMessage() {
ConfigurationProperty property = new ConfigurationProperty(this.invalid, "bad", null);
assertThat(new InvalidConfigDataPropertyException(property, true, null, this.resource)).hasMessage("Property 'invalid' imported from location 'test' is invalid in a profile specific resource");
}
use of org.springframework.boot.context.properties.source.ConfigurationProperty in project spring-boot by spring-projects.
the class ConfigurationPropertiesReportEndpoint method getCandidate.
private ConfigurationProperty getCandidate(ConfigurationPropertyName currentName) {
BoundConfigurationProperties bound = BoundConfigurationProperties.get(this.context);
if (bound == null) {
return null;
}
ConfigurationProperty candidate = bound.get(currentName);
if (candidate == null && currentName.isLastElementIndexed()) {
candidate = bound.get(currentName.chop(currentName.getNumberOfElements() - 1));
}
return candidate;
}
use of org.springframework.boot.context.properties.source.ConfigurationProperty in project spring-boot by spring-projects.
the class ConfigurationPropertiesReportEndpoint method applyInput.
private Map<String, Object> applyInput(String qualifiedKey) {
ConfigurationPropertyName currentName = getCurrentName(qualifiedKey);
ConfigurationProperty candidate = getCandidate(currentName);
PropertySource<?> propertySource = getPropertySource(candidate);
if (propertySource != null) {
Object value = stringifyIfNecessary(candidate.getValue());
SanitizableData data = new SanitizableData(propertySource, currentName.toString(), value);
return getInput(candidate, this.sanitizer.sanitize(data));
}
return Collections.emptyMap();
}
Aggregations