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

TCK: MissingValueOnObserverMethodInjectionTest fails for a different reason #543

Closed
mkouba opened this issue Mar 13, 2020 · 4 comments · Fixed by #786
Closed

TCK: MissingValueOnObserverMethodInjectionTest fails for a different reason #543

mkouba opened this issue Mar 13, 2020 · 4 comments · Fixed by #786
Labels
bug 🪲 An error in the implementation code or documentation
Milestone

Comments

@mkouba
Copy link

mkouba commented Mar 13, 2020

Describe the bug
org.eclipse.microprofile.config.tck.broken.MissingValueOnObserverMethodInjectionTest asserts a DeploymentException. However, since the ConfigObserver bean is @ApplicationScoped (must be proxyable) and final (unproxybale type) the deployment fails but for a different reason:
https://github.com/eclipse/microprofile-config/blob/master/tck/src/main/java/org/eclipse/microprofile/config/tck/broken/ConfigObserver.java#L40

@mkouba mkouba added the bug 🪲 An error in the implementation code or documentation label Mar 13, 2020
@mkouba
Copy link
Author

mkouba commented Mar 13, 2020

Actually, it seems that the bean class is final and declares private no-args constructor, ie. unproxyable, but the observer method is static. That's very confusing. The truth is that a CDI container should only validate bean types used for injection points but what's the point of @ApplicationScoped?

@dmlloyd
Copy link
Contributor

dmlloyd commented Mar 13, 2020

@ljnelson ?

@ljnelson
Copy link
Contributor

ljnelson commented Mar 13, 2020

Happy to make any changes needed. What's the recommendation? The original PR is here: #423.

@mkouba
Copy link
Author

mkouba commented Mar 16, 2020

Ideally, a test like this should rely on minimum features and if possible avoid "unusual" features. In this particular case, pls remove the final flag from the ConfigObserver class and use an ordinary observer method instead of the static one.

@radcortez radcortez added this to the MP Config 2.1 milestone Mar 4, 2021
@Emily-Jiang Emily-Jiang modified the milestones: MP Config 3.1, 3.1 Jun 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🪲 An error in the implementation code or documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants