Refactor FakeValues#1335
Merged
Merged
Conversation
Class FakeValues called FakeValuesContext.setPaths(), but these "paths" are only used by FakeValues itself. Now FakeValuesContext holds only a single immutable "path", and FakeValues either uses it, or calculates "paths" if it's null. P.S. Removed method fakeValues.supportsPath() because it was not used.
PR Summary
|
Instead of `Object`, method fetchObject() now returns `T`. So clients of fetchObject() don't need to cast it to needed type.
c3a5ad2 to
ca4091d
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1335 +/- ##
============================================
+ Coverage 92.04% 92.15% +0.11%
- Complexity 3155 3156 +1
============================================
Files 316 317 +1
Lines 6232 6209 -23
Branches 634 623 -11
============================================
- Hits 5736 5722 -14
+ Misses 337 334 -3
+ Partials 159 153 -6 ☔ View full report in Codecov by Sentry. |
kingthorin
reviewed
Aug 23, 2024
|
|
||
| private List<String> loadBuzzwords() { | ||
| List<List<String>> buzzwordLists = faker.fakeValuesService().fetchObject("company.buzzwords", faker.getContext()); | ||
| return buzzwordLists.stream().flatMap(Collection::stream).toList(); |
Collaborator
There was a problem hiding this comment.
Why stream it then map it to a stream then collect it? Why not just:
buzzwordLists.stream().collect(Collectors.toList())
Collaborator
Author
There was a problem hiding this comment.
no, buzzwordLists.stream().collect(Collectors.toList()) is the same as just buzzwordLists.
The point is that buzzwordLists is list of lists. And we need to convert it to a list.
Collaborator
There was a problem hiding this comment.
Okay, devil in the detail 👿
this allows downloading test report from GitHub actions in case of test failure.
kingthorin
approved these changes
Aug 23, 2024
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.