|
48 | 48 | import static org.awaitility.Awaitility.await; |
49 | 49 | import static org.mockito.Mockito.mock; |
50 | 50 |
|
51 | | -public class WebFluxSseIntegrationTests { |
| 51 | +class WebFluxSseIntegrationTests { |
52 | 52 |
|
53 | | - private static final int PORT = 8182; |
| 53 | + private static final int PORT = TestUtil.findAvailablePort(); |
54 | 54 |
|
55 | 55 | private static final String CUSTOM_SSE_ENDPOINT = "/somePath/sse"; |
56 | 56 |
|
@@ -129,7 +129,7 @@ void testCreateMessageWithoutSamplingCapabilities(String clientType) { |
129 | 129 |
|
130 | 130 | @ParameterizedTest(name = "{0} : {displayName} ") |
131 | 131 | @ValueSource(strings = { "httpclient", "webflux" }) |
132 | | - void testCreateMessageSuccess(String clientType) throws InterruptedException { |
| 132 | + void testCreateMessageSuccess(String clientType) { |
133 | 133 |
|
134 | 134 | // Client |
135 | 135 | var clientBuilder = clientBuilders.get(clientType); |
@@ -188,8 +188,7 @@ void testCreateMessageSuccess(String clientType) throws InterruptedException { |
188 | 188 |
|
189 | 189 | CallToolResult response = mcpClient.callTool(new McpSchema.CallToolRequest("tool1", Map.of())); |
190 | 190 |
|
191 | | - assertThat(response).isNotNull(); |
192 | | - assertThat(response).isEqualTo(callResponse); |
| 191 | + assertThat(response).isNotNull().isEqualTo(callResponse); |
193 | 192 |
|
194 | 193 | mcpClient.close(); |
195 | 194 | mcpServer.close(); |
@@ -417,8 +416,7 @@ void testToolCallSuccess(String clientType) { |
417 | 416 |
|
418 | 417 | CallToolResult response = mcpClient.callTool(new McpSchema.CallToolRequest("tool1", Map.of())); |
419 | 418 |
|
420 | | - assertThat(response).isNotNull(); |
421 | | - assertThat(response).isEqualTo(callResponse); |
| 419 | + assertThat(response).isNotNull().isEqualTo(callResponse); |
422 | 420 |
|
423 | 421 | mcpClient.close(); |
424 | 422 | mcpServer.close(); |
|
0 commit comments