Commit d8fe724
test: Add comprehensive edge case and validation tests for runtime hints registration (spring-projects#4028)
Adds 4 targeted test cases to strengthen runtime hints functionality across multiple components:
- ToolRuntimeHintsTests:
Null ClassLoader handling - Ensures tool hints registration doesn't fail when ClassLoader parameter is null (common in AOT processing)
- AiRuntimeHintsTests:
Record validation - Confirms records with @JsonProperty parameters are properly discovered for hint registration
Enum validation - Verifies enums with @JsonInclude annotations are correctly identified for reflection hints
- JdbcChatMemoryRepositoryRuntimeHintsTest:
Null ClassLoader robustness - Validates JDBC chat memory hints registration handles null ClassLoader gracefully
These tests prevent runtime failures in native images by ensuring proper discovery of JSON-annotated classes (records/enums), robust hint registration under various ClassLoader conditions, and reliable chat memory persistence in GraalVM environments.
Signed-off-by: Alex Klimenko <alexanderklmn@gmail.com>1 parent 5441c96 commit d8fe724
File tree
3 files changed
+38
-1
lines changed- memory/repository/spring-ai-model-chat-memory-repository-jdbc/src/test/java/org/springframework/ai/chat/memory/repository/jdbc/aot/hint
- spring-ai-model/src/test/java/org/springframework/ai/aot
3 files changed
+38
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
| |||
72 | 73 | | |
73 | 74 | | |
74 | 75 | | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
75 | 82 | | |
76 | 83 | | |
77 | 84 | | |
| |||
Lines changed: 21 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
| 31 | + | |
30 | 32 | | |
31 | 33 | | |
32 | 34 | | |
33 | | - | |
| 35 | + | |
34 | 36 | | |
35 | 37 | | |
36 | 38 | | |
| |||
40 | 42 | | |
41 | 43 | | |
42 | 44 | | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
43 | 63 | | |
44 | 64 | | |
45 | 65 | | |
| |||
Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| |||
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
40 | 50 | | |
0 commit comments