Commit 4aeeb1f
committed
refactor: make listRoots() return unmodifiable list and add comprehensive tests
- Refactor McpAsyncServerExchange.listRoots() to return Collections.unmodifiableList
- Fix typo in variable name (allRootssResult -> allRootsResult)
- Improve code formatting and readability with ternary operator
- Add comprehensive test suite for McpAsyncServerExchange covering:
- listRoots() pagination scenarios and edge cases
- Logging notification with level filtering
- Elicitation creation with various capabilities
- Message creation with sampling capabilities
- Error handling and validation scenarios
Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>1 parent 555c16a commit 4aeeb1f
File tree
2 files changed
+710
-9
lines changed- mcp/src
- main/java/io/modelcontextprotocol/server
- test/java/io/modelcontextprotocol/server
2 files changed
+710
-9
lines changedLines changed: 13 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
129 | 130 | | |
130 | 131 | | |
131 | 132 | | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
141 | 145 | | |
142 | 146 | | |
143 | 147 | | |
| |||
0 commit comments