Small clean up of flex duration factor/offset - #5856
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev-2.x #5856 +/- ##
=============================================
+ Coverage 67.95% 68.37% +0.42%
- Complexity 16607 16677 +70
=============================================
Files 1914 1914
Lines 72648 72650 +2
Branches 7452 7452
=============================================
+ Hits 49368 49675 +307
+ Misses 20750 20418 -332
- Partials 2530 2557 +27 ☔ View full report in Codecov by Sentry. |
| @Nullable | ||
| @Override | ||
| public String logName() { | ||
| return "timePenalty=(%s)".formatted(timePenalty.toString()); |
There was a problem hiding this comment.
I do not think this is what the logName() method is intended for - it is to add name/description to entity logging. If the goal is to tests the penalty, the best way to do it is to test that the calculator retuned is of type TimePenaltyCalculator - that should be suffisient, since I assume there is unit tests on the calculator - no need to test the same features twice. Theoretical this is a white-box testing, but it is better than nothing.
There was a problem hiding this comment.
I feel a bit stupid because I should have thought of that myself. 🤦♂️
Summary
After merging of #5796 I realised that I missed a couple of renames where I still used the old name for time penalty (modifier, factors). This is fixed in this PR.
I also cleaned up the modifcation logic a bit: the check for
isZerois no longer necessary as the default is a value that doesn't modify at all.Lastly, I added a test that makes sure that the mapper sets the correct default value.