Skip to content

Conversation

alxkm
Copy link
Contributor

@alxkm alxkm commented Sep 24, 2025

Description

This PR adds comprehensive test coverage for the AzureAiSearchFilterExpressionConverter class, focusing on missing operators and important edge cases that were not previously tested.

Changes

New Test Cases Added:

  • testNullValue: Validates that null values in filter expressions are properly converted to Azure search syntax (eq null)
  • testEmptyStringValue: Tests edge case of empty string values in filter expressions
  • testGtAndLt: Adds missing coverage for GT (greater than) and LT (less than) operators
  • testNestedGroups: Tests complex nested group expressions with multiple levels of AND/OR combinations
  • testCaseSensitiveFieldNames: Verifies that field names with different cases are handled correctly

Why These Tests Matter

  • Missing Operators: GT and LT operators were not covered in the original test suite
  • Null Safety: Ensures proper handling of null values which are common in real-world scenarios
  • Complex Queries: Nested groups test validates that complex boolean logic is properly converted with correct parentheses
  • Edge Cases: Empty strings and case-sensitive fields are important edge cases that could cause issues in production

…rExpressionConverter

Co-authored-by: Oleksandr Klymenko <alexanderklmn@gmail.com>
Signed-off-by: Oleksandr Klymenko <alexanderklmn@gmail.com>
@ilayaperumalg ilayaperumalg self-assigned this Sep 25, 2025
@ilayaperumalg ilayaperumalg added this to the 1.1.0.M3 milestone Sep 25, 2025
@ilayaperumalg
Copy link
Member

@alxkm Thanks for the test coverage and @sunyuhan1998 thanks for the review.

@ilayaperumalg ilayaperumalg merged commit c796cbd into spring-projects:main Sep 25, 2025
2 checks passed
Willam2004 pushed a commit to Willam2004/spring-ai that referenced this pull request Oct 11, 2025
…rExpressionConverter (spring-projects#4467)

Signed-off-by: Oleksandr Klymenko <alexanderklmn@gmail.com>
Signed-off-by: 家娃 <guanjing.pangj@alibaba-inc.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants