refactor: avoid unneeded initializations in injection contexts by metacosm · Pull Request #2950 · operator-framework/java-operator-sdk
|
|
||
| private void init(ConfigurationService configurationService, boolean allowDeferredInit) { | ||
| if (configurationService == null) { | ||
| if (!allowDeferredInit) { |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a unit test for this?
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a test, though it's not great and additional documentation, along with a protected method for subclasses to set the configuration service after intialization, if needed.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, if there is an elegant way pls add unit test so we don't break this in the future.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters