Added guards on config splitting and default value is now code
This commit is contained in:
@@ -43,9 +43,18 @@ class ConfigurationPropertiesAggregator {
|
||||
// |foo|bar|baz -> foo|bar|baz -> split ->
|
||||
// foo,bar,baz
|
||||
String[] strings = s.substring(1).split("\\|");
|
||||
if (strings.length == 3) {
|
||||
return new ConfigurationProperty(
|
||||
strings[0].trim(), strings[1].trim(),
|
||||
strings[2].trim());
|
||||
}
|
||||
else if (strings.length == 2) {
|
||||
return new ConfigurationProperty(
|
||||
strings[0].trim(), strings[1].trim(),
|
||||
"");
|
||||
}
|
||||
return new ConfigurationProperty(
|
||||
strings[0].trim(), strings[1].trim(),
|
||||
strings[2].trim());
|
||||
strings[0].trim(), "", "");
|
||||
});
|
||||
}
|
||||
catch (IOException e) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
|===
|
||||
|Name | Default | Description
|
||||
|
||||
{{#each properties}} |{{name}} | {{defaultValue}} | {{description}}
|
||||
{{#each properties}} |{{name}} | `{{defaultValue}}` | {{description}}
|
||||
{{/each}}
|
||||
|
||||
|===
|
||||
@@ -104,7 +104,7 @@ public class GenerateReleaseTrainDocsTests {
|
||||
|
||||
BDDAssertions.then(generatedAdocs).isNotEmptyDirectory();
|
||||
BDDAssertions.then(configProps(generatedAdocs)).contains(
|
||||
"|spring.sleuth.async.configurer.enabled | true | Enable default AsyncConfigurer.");
|
||||
"|spring.sleuth.async.configurer.enabled | `true` | Enable default AsyncConfigurer.");
|
||||
}
|
||||
|
||||
private String configProps(File file) throws IOException {
|
||||
|
||||
Reference in New Issue
Block a user