|
33 | 33 | import io.opentelemetry.instrumentation.testing.junit.LibraryInstrumentationExtension; |
34 | 34 | import java.util.ArrayList; |
35 | 35 | import java.util.List; |
36 | | -import java.util.concurrent.ExecutionException; |
37 | 36 | import java.util.function.Consumer; |
38 | 37 | import org.junit.jupiter.api.BeforeAll; |
39 | 38 | import org.junit.jupiter.api.Test; |
@@ -403,8 +402,7 @@ void testConverseToolCallNoMessageContent() { |
403 | 402 | } |
404 | 403 |
|
405 | 404 | @Test |
406 | | - void testConverseToolCallStreamNoMessageContent() |
407 | | - throws InterruptedException, ExecutionException { |
| 405 | + void testConverseToolCallStreamNoMessageContent() { |
408 | 406 | BedrockRuntimeAsyncClientBuilder builder = BedrockRuntimeAsyncClient.builder(); |
409 | 407 | AwsSdkTelemetry telemetry = |
410 | 408 | AwsSdkTelemetry.builder(testing.getOpenTelemetry()) |
@@ -472,7 +470,7 @@ void testConverseToolCallStreamNoMessageContent() |
472 | 470 | .toolConfig(currentWeatherToolConfig()) |
473 | 471 | .build(), |
474 | 472 | responseHandler) |
475 | | - .get(); |
| 473 | + .join(); |
476 | 474 |
|
477 | 475 | if (currentToolArgs.length() > 0 && !responseChunksTools.isEmpty()) { |
478 | 476 | JsonNode node = JsonNode.parser().parse(currentToolArgs.toString()); |
@@ -650,7 +648,7 @@ void testConverseToolCallStreamNoMessageContent() |
650 | 648 | .toolConfig(currentWeatherToolConfig()) |
651 | 649 | .build(), |
652 | 650 | responseHandler1) |
653 | | - .get(); |
| 651 | + .join(); |
654 | 652 |
|
655 | 653 | assertThat(String.join("", responseChunks)) |
656 | 654 | .contains( |
@@ -1191,8 +1189,7 @@ void testInvokeModelToolCallAmazonNovaNoMessageContent() { |
1191 | 1189 | } |
1192 | 1190 |
|
1193 | 1191 | @Test |
1194 | | - void testInvokeModelWithResponseStreamToolCallAmazonNovaNoMessageContent() |
1195 | | - throws InterruptedException, ExecutionException { |
| 1192 | + void testInvokeModelWithResponseStreamToolCallAmazonNovaNoMessageContent() { |
1196 | 1193 | BedrockRuntimeAsyncClientBuilder builder = BedrockRuntimeAsyncClient.builder(); |
1197 | 1194 | AwsSdkTelemetry telemetry = |
1198 | 1195 | AwsSdkTelemetry.builder(testing.getOpenTelemetry()) |
@@ -1337,7 +1334,7 @@ public void accept(PayloadPart chunk) { |
1337 | 1334 | .build()) |
1338 | 1335 | .build(); |
1339 | 1336 |
|
1340 | | - client.invokeModelWithResponseStream(request0, responseHandler0).get(); |
| 1337 | + client.invokeModelWithResponseStream(request0, responseHandler0).join(); |
1341 | 1338 |
|
1342 | 1339 | String seattleToolUseId0 = ""; |
1343 | 1340 | String sanFranciscoToolUseId0 = ""; |
@@ -1557,7 +1554,7 @@ public void accept(PayloadPart chunk) { |
1557 | 1554 | .build()) |
1558 | 1555 | .build(); |
1559 | 1556 |
|
1560 | | - client.invokeModelWithResponseStream(request1, responseHandler1).get(); |
| 1557 | + client.invokeModelWithResponseStream(request1, responseHandler1).join(); |
1561 | 1558 |
|
1562 | 1559 | assertThat(text.toString()) |
1563 | 1560 | .contains( |
@@ -2027,8 +2024,7 @@ void testInvokeModelToolCallAnthropicClaudeNoMessageContent() { |
2027 | 2024 | } |
2028 | 2025 |
|
2029 | 2026 | @Test |
2030 | | - void testInvokeModelWithResponseStreamToolCallAnthropicClaudeNoMessageContent() |
2031 | | - throws InterruptedException, ExecutionException { |
| 2027 | + void testInvokeModelWithResponseStreamToolCallAnthropicClaudeNoMessageContent() { |
2032 | 2028 | BedrockRuntimeAsyncClientBuilder builder = BedrockRuntimeAsyncClient.builder(); |
2033 | 2029 | AwsSdkTelemetry telemetry = |
2034 | 2030 | AwsSdkTelemetry.builder(testing.getOpenTelemetry()) |
@@ -2176,7 +2172,7 @@ public void accept(PayloadPart chunk) { |
2176 | 2172 | .build()) |
2177 | 2173 | .build(); |
2178 | 2174 |
|
2179 | | - client.invokeModelWithResponseStream(request0, responseHandler0).get(); |
| 2175 | + client.invokeModelWithResponseStream(request0, responseHandler0).join(); |
2180 | 2176 |
|
2181 | 2177 | String seattleToolUseId0 = ""; |
2182 | 2178 | String sanFranciscoToolUseId0 = ""; |
@@ -2370,7 +2366,7 @@ public void accept(PayloadPart chunk) { |
2370 | 2366 | .build()) |
2371 | 2367 | .build(); |
2372 | 2368 |
|
2373 | | - client.invokeModelWithResponseStream(request1, responseHandler1).get(); |
| 2369 | + client.invokeModelWithResponseStream(request1, responseHandler1).join(); |
2374 | 2370 |
|
2375 | 2371 | assertThat(text.toString()) |
2376 | 2372 | .contains( |
|
0 commit comments