Skip to content

Conversation

@alxkm
Copy link
Contributor

@alxkm alxkm commented Aug 17, 2025

Adds essential test coverage for the Document class to improve code quality and prevent regressions.

Tests Added:

  • Input validation (null/empty ID, metadata validation)
  • Builder pattern validation and custom ID generator support
  • Content formatter functionality and error handling
  • Document mutation ensuring immutability
  • Equals/hashCode contract verification
  • Text document behavior validation
  • Metadata immutability guarantees

Benefits:

  • Prevents runtime errors through comprehensive validation testing
  • Ensures API contracts are maintained during refactoring
  • Improves confidence in Document class reliability
  • Covers edge cases and error conditions

Coverage: 19 new test methods covering validation, builder patterns, mutation, equality, and core functionality.

…ests

Co-authored-by: Oleksandr Klymenko <[email protected]>
Signed-off-by: Oleksandr Klymenko <[email protected]>
@markpollack markpollack self-assigned this Aug 20, 2025
@markpollack markpollack added this to the 1.1.0.M1 milestone Aug 20, 2025
spring-builds pushed a commit that referenced this pull request Aug 20, 2025
…ests

Co-authored-by: Oleksandr Klymenko <[email protected]>
Signed-off-by: Oleksandr Klymenko <[email protected]>

Fixes #4174

(cherry picked from commit 2bca047)
scionaltera pushed a commit to scionaltera/spring-ai that referenced this pull request Sep 3, 2025
…ests

Co-authored-by: Oleksandr Klymenko <[email protected]>
Signed-off-by: Oleksandr Klymenko <[email protected]>

Auto-cherry-pick to 1.0.x
Fixes spring-projects#4174
chedim pushed a commit to couchbaselabs/spring-ai that referenced this pull request Sep 19, 2025
…ests

Co-authored-by: Oleksandr Klymenko <[email protected]>
Signed-off-by: Oleksandr Klymenko <[email protected]>

Auto-cherry-pick to 1.0.x
Fixes spring-projects#4174
Willam2004 pushed a commit to Willam2004/spring-ai that referenced this pull request Oct 11, 2025
…ests

Co-authored-by: Oleksandr Klymenko <[email protected]>
Signed-off-by: Oleksandr Klymenko <[email protected]>

Auto-cherry-pick to 1.0.x
Fixes spring-projects#4174

Signed-off-by: 家娃 <[email protected]>
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