Issue#1290 refactor sim functions tests#1291
Open
padam-prakash wants to merge 3 commits intozinggAI:mainfrom
Open
Issue#1290 refactor sim functions tests#1291padam-prakash wants to merge 3 commits intozinggAI:mainfrom
padam-prakash wants to merge 3 commits intozinggAI:mainfrom
Conversation
Introduce SimilarityFunctionTestHelper to centralize common null/empty and exact-match checks for similarity functions. Refactor TestEmailMatchTypeFunction and TestOnlyAlphabetsAffineGapSimilarity to use the helper, reorganize and add test cases.
Replace string concatenation of the caught exception with passing it as the cause to the ZinggClientException constructor. This preserves the original exception and its stack trace (change in TrainingDataFinder.java catch block).
Contributor
There was a problem hiding this comment.
Pull request overview
Refactors similarity-function unit tests to reduce duplication by introducing a shared test helper for common behaviors (null/empty handling and exact-match checks), and updates an exception message typo in TrainingDataFinder.
Changes:
- Added
SimilarityFunctionTestHelperto centralize common similarity-function assertions. - Refactored
TestEmailMatchTypeFunctionandTestOnlyAlphabetsAffineGapSimilarityto use the helper and reorganized test cases. - Updated a
ZinggClientExceptionmessage inTrainingDataFinder.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
common/core/src/test/java/zingg/common/core/similarity/function/TestOnlyAlphabetsAffineGapSimilarity.java |
Refactors tests to reuse shared null/empty and exact-match assertions, and keeps function-specific cases. |
common/core/src/test/java/zingg/common/core/similarity/function/TestEmailMatchTypeFunction.java |
Refactors tests to reuse shared assertions and keeps email-specific delegation behavior tests. |
common/core/src/test/java/zingg/common/core/similarity/function/SimilarityFunctionTestHelper.java |
Adds shared test utilities for common similarity-function behavior. |
common/core/src/main/java/zingg/common/core/executor/TrainingDataFinder.java |
Fixes/updates an exception message string. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
...n/core/src/test/java/zingg/common/core/similarity/function/SimilarityFunctionTestHelper.java
Outdated
Show resolved
Hide resolved
common/core/src/main/java/zingg/common/core/executor/TrainingDataFinder.java
Outdated
Show resolved
Hide resolved
Update wording for clarity: change exception message in TrainingDataFinder to "Error while finding training data" and simplify Javadoc comments in SimilarityFunctionTestHelper by removing redundant phrase about usage
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes #1290 . Introduce SimilarityFunctionTestHelper to centralize common null/empty and exact-match checks for similarity functions. Refactor TestEmailMatchTypeFunction and TestOnlyAlphabetsAffineGapSimilarity to use the helper, reorganize and add test cases.