diff --git a/tests/server-common/src/test/java/io/a2a/server/apps/common/AbstractA2AServerTest.java b/tests/server-common/src/test/java/io/a2a/server/apps/common/AbstractA2AServerTest.java index 3a20660e8..8624f8e27 100644 --- a/tests/server-common/src/test/java/io/a2a/server/apps/common/AbstractA2AServerTest.java +++ b/tests/server-common/src/test/java/io/a2a/server/apps/common/AbstractA2AServerTest.java @@ -71,6 +71,7 @@ import io.restassured.specification.RequestSpecification; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Timeout; /** * This test requires doing some work on the server to add/get/delete tasks, and enqueue events. This is exposed via REST, @@ -622,6 +623,7 @@ public void testSendMessageStreamExistingTaskSuccess() throws Exception { } @Test + @Timeout(value = 3, unit = TimeUnit.MINUTES) public void testResubscribeExistingTaskSuccess() throws Exception { ExecutorService executorService = Executors.newSingleThreadExecutor(); saveTaskInTaskStore(MINIMAL_TASK); @@ -904,7 +906,7 @@ protected void saveTaskInTaskStore(Task task) throws Exception { HttpResponse response = client.send(request, HttpResponse.BodyHandlers.ofString(StandardCharsets.UTF_8)); if (response.statusCode() != 200) { - throw new RuntimeException(response.statusCode() + ": Creating task failed! " + response.body()); +throw new RuntimeException(String.format("Saving task failed! Status: %d, Body: %s", response.statusCode(), response.body())); } } @@ -922,7 +924,7 @@ protected Task getTaskFromTaskStore(String taskId) throws Exception { return null; } if (response.statusCode() != 200) { - throw new RuntimeException(response.statusCode() + ": Creating task failed! " + response.body()); +throw new RuntimeException(String.format("Getting task failed! Status: %d, Body: %s", response.statusCode(), response.body())); } return Utils.OBJECT_MAPPER.readValue(response.body(), Task.TYPE_REFERENCE); } @@ -951,7 +953,7 @@ protected void ensureQueueForTask(String taskId) throws Exception { .build(); HttpResponse response = client.send(request, HttpResponse.BodyHandlers.ofString(StandardCharsets.UTF_8)); if (response.statusCode() != 200) { - throw new RuntimeException(response.statusCode() + ": Deleting task failed!" + response.body()); +throw new RuntimeException(String.format("Ensuring queue failed! Status: %d, Body: %s", response.statusCode(), response.body())); } }