-
Notifications
You must be signed in to change notification settings - Fork 1.1k
improve error message when multiple bean candidates are present and all are Secondary #11766
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
improve error message when multiple bean candidates are present and all are Secondary #11766
Conversation
could you add a test please |
wasn't sure where to put tests 😅 is there an existing test suite? (DefaultBeanContextSpec didn't look right, but maybe I'm looking in the wrong place) |
probably can go in test-suite submodule |
done - verified locally that without the runtime diff, the test fails. I couldn't figure out how to use |
@graemerocher is there anything else I should do here? |
looks like CI is green! is this PR ready to go? |
e.g. if you have this code: (kotlin syntax, hopefully the intent is clear)
micronaut throws a cryptic
java.util.NoSuchElementException
, because it blindly callsiterator.next()
.This PR just adds a check for empty list, and throws a more informative exception.
(wasn't sure how to update the unit tests to verify this - DefaultBeanContextSpec didn't seem like the right place? I'd appreciate a pointer to the relevant test suite)