Skip to content
New issue

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 using io.helidon.config.Config and doing get of a non existent property, Exception message is missing the key #9494

Open
cyrilgeorge-oracle opened this issue Nov 13, 2024 · 0 comments
Assignees
Labels
4.x Version 4.x bug Something isn't working config P3

Comments

@cyrilgeorge-oracle
Copy link

Environment Details

  • Helidon Version: 4.1.3
  • Helidon MP
  • JDK version: 23
  • OS: Windows

Problem Description

@HelidonTest
class MyTest {
    @Inject
    Config config;

    @Test
    void printConfig(WebTarget t) {
        System.out.println(config.get("not.a.valid.property").asString().get());
    }
}

Above test throws below exception
io.helidon.config.MissingValueException: Requested value for configuration key '' is not present in the configuration.
where key is empty

The behaviour is mainly due to the asString() method invocation io.helidon.config.mp.SeConfig#as(java.lang.Class<T>) which in turn calls ConfigValues.empty() where key is set to empty string

Expected behavior

Test should throw exception io.helidon.config.MissingValueException: Requested value for configuration key 'not.a.valid.property' is not present in the configuration.

@github-project-automation github-project-automation bot moved this to Triage in Backlog Nov 13, 2024
@m0mus m0mus added enhancement New feature or request config P3 4.x Version 4.x bug Something isn't working and removed enhancement New feature or request labels Nov 18, 2024
@m0mus m0mus moved this from Triage to High priority in Backlog Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4.x Version 4.x bug Something isn't working config P3
Projects
Status: High priority
Development

No branches or pull requests

3 participants