-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Update tests for multiple eventlistener plugin changes #24755
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -60,7 +60,16 @@ public interface QueryRunner | |
|
|
||
| StatsCalculator getStatsCalculator(); | ||
|
|
||
| Optional<EventListener> getEventListener(); | ||
| @Deprecated | ||
| default Optional<EventListener> getEventListener() | ||
| { | ||
| if (getEventListeners().isEmpty()) { | ||
| return Optional.empty(); | ||
| } | ||
| return Optional.of(getEventListeners().get(0)); | ||
| } | ||
|
|
||
| List<EventListener> getEventListeners(); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we add a log here if there are multiple event listeners?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Adding a log message here, is not a good convention. What I could do is add an assert, that invoker of this method expects no more than one eventlistener. But that has consequences, if people are upgrading. |
||
|
|
||
| TestingAccessControlManager getAccessControl(); | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -607,10 +607,10 @@ public StatsCalculator getStatsCalculator() | |
| } | ||
|
|
||
| @Override | ||
| public Optional<EventListener> getEventListener() | ||
| public List<EventListener> getEventListeners() | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this should be
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks @jaystarshot for taking a look. I am not fully sure, I understand that. List can have zero elements (an List#isEmpty check similar to Optional#isPresent check), and if we are concerned about not breaking existing users, we added a |
||
| { | ||
| checkState(coordinators.size() == 1, "Expected a single coordinator"); | ||
| return coordinators.get(0).getEventListener(); | ||
| return coordinators.get(0).getEventListeners(); | ||
| } | ||
|
|
||
| @Override | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.