-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
Reduce boilerplate in plugins utils tests #88593
Reduce boilerplate in plugins utils tests #88593
Conversation
Tests for PluginsUtils need to create many different plugin descriptors. But the vast majority of these just need a plugin name and dependencies. This commit adds a utility method to simplify these tests.
Pinging @elastic/es-core-infra (Team:Core/Infra) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -38,6 +37,21 @@ | |||
@LuceneTestCase.SuppressFileSystems(value = "ExtrasFS") | |||
public class PluginsUtilsTests extends ESTestCase { | |||
|
|||
PluginDescriptor newTestDescriptor(String name, List<String> deps) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe make deps variadic to avoid list creation by caller?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have to create a List for the descriptor regardless.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, minor suggestion.
Tests for PluginsUtils need to create many different plugin descriptors.
But the vast majority of these just need a plugin name and dependencies.
This commit adds a utility method to simplify these tests.