|
8 | 8 |
|
9 | 9 | class CompleteCompletionSerializationTest { |
10 | 10 |
|
11 | | - @Test |
12 | | - void codeCompletionSerialization() throws IOException { |
13 | | - McpJsonMapper jsonMapper = McpJsonMapper.getDefault(); |
14 | | - McpSchema.CompleteResult.CompleteCompletion codeComplete |
15 | | - = new McpSchema.CompleteResult.CompleteCompletion(Collections.emptyList(), 0, false); |
16 | | - String json = jsonMapper.writeValueAsString(codeComplete); |
17 | | - String expected = """ |
18 | | - {"values":[],"total":0,"hasMore":false}"""; |
19 | | - assertEquals(expected, json, json); |
| 11 | + @Test |
| 12 | + void codeCompletionSerialization() throws IOException { |
| 13 | + McpJsonMapper jsonMapper = McpJsonMapper.getDefault(); |
| 14 | + McpSchema.CompleteResult.CompleteCompletion codeComplete = new McpSchema.CompleteResult.CompleteCompletion( |
| 15 | + Collections.emptyList(), 0, false); |
| 16 | + String json = jsonMapper.writeValueAsString(codeComplete); |
| 17 | + String expected = """ |
| 18 | + {"values":[],"total":0,"hasMore":false}"""; |
| 19 | + assertEquals(expected, json, json); |
| 20 | + |
| 21 | + McpSchema.CompleteResult completeResult = new McpSchema.CompleteResult(codeComplete); |
| 22 | + json = jsonMapper.writeValueAsString(completeResult); |
| 23 | + expected = """ |
| 24 | + {"completion":{"values":[],"total":0,"hasMore":false}}"""; |
| 25 | + assertEquals(expected, json, json); |
| 26 | + } |
20 | 27 |
|
21 | | - McpSchema.CompleteResult completeResult = new McpSchema.CompleteResult(codeComplete); |
22 | | - json = jsonMapper.writeValueAsString(completeResult); |
23 | | - expected = """ |
24 | | - {"completion":{"values":[],"total":0,"hasMore":false}}"""; |
25 | | - assertEquals(expected, json, json); |
26 | | - } |
27 | 28 | } |
0 commit comments