-
Notifications
You must be signed in to change notification settings - Fork 641
[ISSUE#4530] Add unit test for RedisSourceConnector. #4545
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4545 +/- ##
============================================
+ Coverage 16.14% 16.16% +0.01%
- Complexity 1581 1584 +3
============================================
Files 747 747
Lines 28965 28960 -5
Branches 2541 2539 -2
============================================
+ Hits 4677 4681 +4
+ Misses 23840 23829 -11
- Partials 448 450 +2
... and 15 files with indirect coverage changes 📣 Codecov offers a browser extension for seamless coverage viewing on GitHub. Try it in Chrome or Firefox today! |
| public void setUp() throws Exception { | ||
| connector = new RedisSourceConnector(); | ||
| RedisSourceConfig sourceConfig = (RedisSourceConfig) ConfigUtil.parse(connector.configClass()); | ||
| setupRedisServer(getPortFromUrl(sourceConfig.getConnectorConfig().getServer())); |
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.
You need shut down the Redis server when the testing is completed.
| RecordPartition partition = new RecordPartition(); | ||
| RecordOffset offset = new RecordOffset(); | ||
| ConnectRecord connectRecord = new ConnectRecord(partition, offset, System.currentTimeMillis(), | ||
| ("\"" + expectedMessage + "\"").getBytes(StandardCharsets.UTF_8)); |
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.
Is this double quotation mark necessary?
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.
Yes, if double quotes are not added, an error will occur during redisson deserialization.
* Add unit test for RedisSourceConnector. * Cleanup redisson.
Fixes #4530 .
Modifications
Add unit test for RedisSourceConnector.