-
Notifications
You must be signed in to change notification settings - Fork 224
adding new method signature plus test #1570
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
base: master
Are you sure you want to change the base?
Conversation
1da2f75
to
62f1fda
Compare
46da31f
to
f7b2be6
Compare
Signed-off-by: salaboy <[email protected]>
Signed-off-by: salaboy <[email protected]>
Signed-off-by: salaboy <[email protected]>
Signed-off-by: salaboy <[email protected]>
9746e04
to
d6fe7d5
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1570 +/- ##
============================================
+ Coverage 76.91% 78.51% +1.60%
- Complexity 1592 1916 +324
============================================
Files 145 215 +70
Lines 4843 5833 +990
Branches 562 650 +88
============================================
+ Hits 3725 4580 +855
- Misses 821 916 +95
- Partials 297 337 +40 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
@salaboy nice job! I just think we should be careful not to change the incoming parameter. For example if someone would send an unmodifiable map as parameter, it will result in a runtime exception.
*/ | ||
@Override | ||
public Mono<Void> saveState(String storeName, String key, String etag, Object value, Map<String, String> meta, | ||
StateOptions options) { |
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.
It is dangerous to modify the incoming method parameter. I would rather make a copy and add the content type if value
is not null.
} | ||
|
||
if (value != null) { | ||
meta.put("contentType", stateSerializer.getContentType()); |
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.
What if the key already exists? Is it ok to overwrite it?
Description
Add new method signature to support metadata map, I've added a test that validates that the custom metadata is added.
Issue reference
We strive to have all PR being opened based on an issue, where the problem or feature have been discussed prior to implementation.
Please reference the issue this PR will close: #1569
Checklist
Please make sure you've completed the relevant tasks for this PR, out of the following list: