Skip to content

Conversation

@yanrongzhen
Copy link
Contributor

Fixes #4530 .

Modifications

Add unit test for RedisSourceConnector.

@codecov
Copy link

codecov bot commented Nov 7, 2023

Codecov Report

Merging #4545 (59285bd) into master (7438a55) will increase coverage by 0.01%.
Report is 2 commits behind head on master.
The diff coverage is 0.00%.

❗ Current head 59285bd differs from pull request most recent head 739c05e. Consider uploading reports for the commit 739c05e to get more accurate results

@@             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     
Files Coverage Δ
...me/core/protocol/http/push/HTTPMessageHandler.java 0.00% <0.00%> (ø)

... 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()));
Copy link
Member

@pandaapo pandaapo Nov 7, 2023

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));
Copy link
Member

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?

Copy link
Contributor Author

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.

@yanrongzhen yanrongzhen requested a review from pandaapo November 7, 2023 09:55
@mxsm mxsm merged commit 9fdc30a into apache:master Nov 12, 2023
@xwm1992 xwm1992 added this to the 1.10 milestone Dec 12, 2023
xuhongjia pushed a commit to Deckers-Ohana/eventmesh that referenced this pull request Mar 13, 2025
* Add unit test for RedisSourceConnector.

* Cleanup redisson.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Unit Test] Add unit test for RedisSourceConnector.

4 participants