-
Notifications
You must be signed in to change notification settings - Fork 8
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
Adding ProducerRecord to ConsumerRecord mapper to MockKafka builder #2
Conversation
…lt mapper does not include metadata and headers. Alternative mappers can now be specified.
…he default mapper does not include metadata and headers. Alternative mappers can now be specified." Reapplied without previous reformatting. This reverts commit 0589e41.
…nsumerRecord mapper. The default mapper does not include metadata and headers. Alternative mappers can now be specified."" Removed reformatting. Reapplied changes. This reverts commit bf4135f
…rd to ConsumerRecord mapper. The default mapper does not include metadata and headers. Alternative mappers can now be specified.""" This reverts commit 7d4a94c
…he default mapper does not include metadata and headers. Alternative mappers can now be specified." This reverts commit 0589e41
…per. The default mapper does not include metadata and headers. Alternative mappers can now be specified. No reformatting.
Codecov Report
@@ Coverage Diff @@
## master #2 +/- ##
=======================================
Coverage 100% 100%
- Complexity 256 259 +3
=======================================
Files 42 42
Lines 724 730 +6
Branches 47 47
=======================================
+ Hits 724 730 +6
Continue to review full report at Codecov.
|
Would you mind fixing the coverage issue? I would like to run it at 100% branch coverage please. Also, I'd happily have us change the default mapper implementation to push the headers through. Makes sense to do it. |
Added test. Something is reformatting my commits, I can try to fix if you prefer. Sorry. |
Nah that's ok. What do you think of making header passing as part of the default mapper? |
Agree that headers should be passed by default. |
If you'd like to make that change, I'll pull it all in one go. |
Done |
The current implementation discards the record headers. The constructors for ConsumerRecord have some arguments that don't make sense for mocking, but I do need the headers.
I thought it would be good to parameterize the mapping from ProducerRecord to ConsumerRecord, with the default being the current implementation.
(I'm not that experienced with Git and pull requests and had to clean up some accidental reformatting)
Example usage: