-
Notifications
You must be signed in to change notification settings - Fork 642
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
[ISSUE#4510] Add test case for SpringSinkConnector. #4511
Conversation
LGTM, but can we have a more descriptive method name? Like |
ConnectRecord poll = queue.poll(); | ||
assertNotNull(poll); | ||
String expectedMessage = message + i; | ||
assertThat(poll.getData(), is(expectedMessage)); |
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.
Isn't it more convenient to use JUnit 5's Assertions
directly? Why did you deliberately introduce 'hamcrest' to make assertions?
直接使用JUnit 5的Assertions
不是更方便吗?为何特意引入'hamcrest'来断言?
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.
Hamcrest's assertion is more powerful than junit5, and I think can be combined.
hamcrest的断言比junit5更强大, 我认为两者可以组合使用。
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.
But your test case does not require more powerful features in 'hamcrest' than 'JUnit'. Shouldn't it be used on demand?
但是你的测试用例并不需要'hamcrest'比'JUnit'更强大的特性啊。不应该按需使用吗?
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.
Hamcrest is an additional dependency, and if we're using it solely for simple assertions, I believe that standard JUnit assertions should suffice. This can help us keep our project dependencies minimal and reduce complexity in our tests. This is just my opinion.
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.
I also think it's right to keep minimal dependencies, it has been fixed in new commit.
The name of the unit test method has been changed, but about the unit test when the queue is empty, the original class does not have a special case, so i think it does not need to be handle with. |
Codecov Report
@@ Coverage Diff @@
## master #4511 +/- ##
============================================
+ Coverage 15.92% 15.97% +0.05%
- Complexity 1541 1549 +8
============================================
Files 727 727
Lines 28872 28872
Branches 2744 2744
============================================
+ Hits 4597 4613 +16
+ Misses 23792 23776 -16
Partials 483 483 see 2 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
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.
LGTM
Fixes #4510 .
Modifications