Skip to content

Conversation

@alxkm
Copy link
Contributor

@alxkm alxkm commented Aug 21, 2025

Summary
Adds comprehensive test coverage for ChatClientResponseEntity, ChatClientResponse, and DefaultChatClientBuilder classes to improve error handling validation and edge case coverage.

Changes

ChatClientResponseEntityTests: Added tests for null responses, primitive types, array parsing, and malformed JSON handling
ChatClientResponseTests: Enhanced context mutation, immutability, and builder pattern edge cases
DefaultChatClientBuilderTests: Added resource loading with different encodings, large file handling, and clone behavior validation

Key Improvements

  • Error handling for null/empty responses and invalid JSON
  • Type safety validation for primitives and collections
  • Resource loading edge cases and memory efficiency
  • Builder state isolation and immutability guarantees
  • Complex object preservation in contexts

Test Coverage Added

  • new tests for response entity parsing
  • new tests for response wrapper functionality
  • new tests for builder pattern validation

Backward Compatibility

  • All existing tests pass
  • No API changes
  • No breaking changes

…der functionality

Co-authored-by: Oleksandr Klymenko <[email protected]>
Signed-off-by: Oleksandr Klymenko <[email protected]>
@sobychacko sobychacko merged commit 24845ca into spring-projects:main Aug 27, 2025
2 checks passed
@sobychacko sobychacko added this to the 1.1.0.M1 milestone Aug 27, 2025
scionaltera pushed a commit to scionaltera/spring-ai that referenced this pull request Sep 3, 2025
chedim pushed a commit to couchbaselabs/spring-ai that referenced this pull request Sep 19, 2025
Willam2004 pushed a commit to Willam2004/spring-ai that referenced this pull request Oct 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants