incubator-xtable
incubator-xtable copied to clipboard
Improved all tests in TestHudiInstantUtils by parameterising and adding more test cases
What is the purpose of the pull request
This pull request improves both the tests in TestHudiInstantUtils by refactoring them into parameterised unit tests and also adding more test cases to enhance testing logic.
Elaboration:
- The same method calls (parseFromInstantTime & convertInstantToCommit) are repeated with different inputs, making the test harder to maintain and extend.
- When a test fails, JUnit only shows which type of assertion failed, but not which specific input caused the failure.
- Adding new test cases requires copying and pasting another Assertions.assertEquals(...) statement instead of simply adding new data.
Brief change log
- Parameterised tests:
testParseCommitTimeToInstant&testInstantToCommit - Added more test cases as value sets to above parameterised tests
Verify this pull request
Below are the before and after unit test run reports:
Below changes:
After changes: