-
Notifications
You must be signed in to change notification settings - Fork 478
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
#371 Support dynamic measurement name in InfluxDBResultMapper #423
Conversation
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.
Please update the unit tests with tests that could cover your changes and address the issues mentioned in my comments. Thanks!
throwExceptionIfResultWithError(queryResult); | ||
cacheMeasurementClass(clazz); | ||
|
||
List<T> result = new LinkedList<T>(); | ||
String measurementName = getMeasurementName(clazz); | ||
|
||
if (measurementName == null || measurementName.isEmpty()) |
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.
Please move these verification to the top of the method. IMO Objects.requireNonNull(measurementName, "measurementName");
would be enough and the code should be resilient against an empty string.
String measurementName = getMeasurementName(clazz); | ||
|
||
if (measurementName == null || measurementName.isEmpty()) | ||
{ |
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.
This block { }
is not compliant with the existing checkstyle.xml that you can find at the root of the project. If you have considered my previous argument as valid (Object.requireNonNull as enough), just remove this block.
parseSeriesAs(series, clazz, result); | ||
}); | ||
}); | ||
.filter(internalResult -> Objects.nonNull(internalResult) && Objects.nonNull(internalResult.getSeries())) |
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.
Please, do not change the indentation of lines that are not direct related with your changes. Unfortunately you will have to revert these changes.
Codecov Report
@@ Coverage Diff @@
## master #423 +/- ##
============================================
+ Coverage 84.86% 84.89% +0.02%
- Complexity 270 271 +1
============================================
Files 19 19
Lines 1183 1185 +2
Branches 119 119
============================================
+ Hits 1004 1006 +2
Misses 118 118
Partials 61 61
Continue to review full report at Codecov.
|
Checkstyle not added. Please review it. Added just one single method that supports a dynamic measurement name.