-
Notifications
You must be signed in to change notification settings - Fork 641
[ISSUE #4547] Add unit test for OpenFunctionSourceConnector. #4561
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
|
@yanrongzhen Please review the pull request. If it is okay based on that I will add changes for OpenFunctionSinkConnectorTest |
| public class OpenFunctionSourceConnectorTest { | ||
|
|
||
| @Spy | ||
| private OpenFunctionSourceConnector connector; |
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.
This @Spy annotation is redundant, because you completely manually constructed connector without simulating it. Because @Spy is redundant, @ExtendWith(MockitoExtension.class) also becomes redundant.
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.
| Object actualMessage = String.valueOf(connectRecords.get(i).getData()); | ||
| String expectedMessage = "testMessage" + i; | ||
| Assertions.assertEquals(expectedMessage, actualMessage); | ||
| } |
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 better to call stop () at the last, although it is currently an empty method. Additionally, please fix the checkstyle error prompted by CI.
mxsm
left a comment
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.
@VishalMCF Please fix CI error
|
@mxsm Is it possible to see the test.html file to see what errors are happening? I have imported the checkstyle.xml and when I run ./gradlew check it works fine in my system. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #4561 +/- ##
============================================
- Coverage 16.81% 16.69% -0.12%
- Complexity 1627 1634 +7
============================================
Files 749 764 +15
Lines 28682 28968 +286
Branches 2487 2500 +13
============================================
+ Hits 4823 4837 +14
- Misses 23406 23676 +270
- Partials 453 455 +2 ☔ View full report in Codecov by Sentry. |
The following errors were reported by CI earlier, and they were actually checkstyle errors. You have fixed them in new commits. |
|
@mxsm I have made the requested changes. |
mxsm
left a comment
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
…pache#4561) * Added test for OpenFunction Source Connector * Removed Redundant @SPY annnotation * WIP resolved checkstyle errors
Fixes #4547 .
Motivation
OpenFunctionConnector module was lacking test cases.
Modifications
Added test file for OpenFunction Source Connector. Explored SpringSourceConnector and based on that the changes were added.
Documentation