We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When a config node is copied, if the key contains a dot the copied key is not escaped so the resulting copy has the wrong key.
Add the following test to ConfigCopyTest and run it. It fails because the copied key is not escaped when the new copy of the node is created:
ConfigCopyTest
@Test void testDottedKey() { var withDottedName = ConfigNode.ObjectNode.builder() .addValue(Config.Key.escapeName("first.one"), "firstValue") .addValue("second", "secondValue") .build(); var rootNode = ConfigNode.ObjectNode.builder() .addObject("object", withDottedName) .build(); var originalConfig = Config.builder() .disableSystemPropertiesSource() .disableEnvironmentVariablesSource() .addSource(io.helidon.config.ConfigSources.create(rootNode)) .build(); assertThat("Dotted name entry in original", originalConfig.get("object." + Config.Key.escapeName("first.one")).asString().get(), is("firstValue")); var copyConfig = Config.builder() .disableSystemPropertiesSource() .disableEnvironmentVariablesSource() .addSource(ConfigSources.create(originalConfig)) .build(); var firstOneConfigValue = copyConfig.get("object." + Config.Key.escapeName("first.one")).asString(); assertThat("Dotted name key in copy is present", firstOneConfigValue.isPresent(), is(true)); assertThat("Dotted name value in copy", firstOneConfigValue.get(), is("firstValue")); }
The text was updated successfully, but these errors were encountered:
Same test seems to be failing in 3.x too
Sorry, something went wrong.
Yes. I've created backport issues.
tjquinno
No branches or pull requests
Environment Details
Problem Description
When a config node is copied, if the key contains a dot the copied key is not escaped so the resulting copy has the wrong key.
Steps to reproduce
Add the following test to
ConfigCopyTest
and run it. It fails because the copied key is not escaped when the new copy of the node is created:The text was updated successfully, but these errors were encountered: