Commit d7453aa
Maintenance: CrossEncoderReranker - Add comprehensive tests and improve code quality
This commit adds comprehensive test coverage for CrossEncoderReranker
implementations and fixes a code quality issue in NoopCrossEncoderReranker.
Changes made:
- Replace deprecated Collectors.toList() with .toList() in NoopCrossEncoderReranker
- Add 11 comprehensive unit tests for NoopCrossEncoderReranker covering:
* Score-based sorting (descending order)
* Equal scores handling
* Edge cases (empty list, single candidate, null/blank query)
* Negative and zero scores
* Large score values
* Many candidates
- Add 15 comprehensive unit tests for NaverCrossEncoderReranker covering:
* Successful API reranking
* Partial document citation
* Fallback scenarios (no citations, API errors, invalid JSON)
* Null/blank query handling
* Empty candidates handling
* API key validation
* Request body and headers verification
* Document structure validation
All tests pass successfully and maintain consistency with existing test patterns
in the codebase.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <[email protected]>1 parent 312323d commit d7453aa
File tree
3 files changed
+606
-2
lines changed- src
- main/java/spring/memewikibe/infrastructure/ai
- test/java/spring/memewikibe/infrastructure/ai
3 files changed
+606
-2
lines changedLines changed: 1 addition & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | 7 | | |
9 | 8 | | |
10 | 9 | | |
| |||
16 | 15 | | |
17 | 16 | | |
18 | 17 | | |
19 | | - | |
| 18 | + | |
20 | 19 | | |
21 | 20 | | |
0 commit comments