From ac0ef16600103a546ce33f6b5eaff6f4bd2d3e35 Mon Sep 17 00:00:00 2001 From: Kabir Khan Date: Tue, 15 Jul 2025 16:31:29 +0100 Subject: [PATCH 1/4] chore: Clean up AbstractA2AServerTest --- .../io/a2a/server/apps/common/AbstractA2AServerTest.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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..b070b85e6 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(response.statusCode() + ": Saving task failed! " + 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(response.statusCode() + ": Getting task failed! " + 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(response.statusCode() + ": Ensuring queue failed!" + response.body()); } } From 7f8913dd333f8506106c9f473eb46f29f6f6dfb0 Mon Sep 17 00:00:00 2001 From: Kabir Khan Date: Tue, 15 Jul 2025 17:03:25 +0100 Subject: [PATCH 2/4] Update tests/server-common/src/test/java/io/a2a/server/apps/common/AbstractA2AServerTest.java Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --- .../java/io/a2a/server/apps/common/AbstractA2AServerTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 b070b85e6..c5032c29f 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 @@ -906,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() + ": Saving task failed! " + response.body()); +throw new RuntimeException(String.format("Saving task failed! Status: %d, Body: %s", response.statusCode(), response.body())); } } From 38ec4992d8c95b431452b6f5b4ffe0c1e61d3aae Mon Sep 17 00:00:00 2001 From: Kabir Khan Date: Tue, 15 Jul 2025 17:03:32 +0100 Subject: [PATCH 3/4] Update tests/server-common/src/test/java/io/a2a/server/apps/common/AbstractA2AServerTest.java Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --- .../java/io/a2a/server/apps/common/AbstractA2AServerTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 c5032c29f..08c1a28ff 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 @@ -924,7 +924,7 @@ protected Task getTaskFromTaskStore(String taskId) throws Exception { return null; } if (response.statusCode() != 200) { - throw new RuntimeException(response.statusCode() + ": Getting 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); } From 4e8ec8d81832b3ab3572a6f163d712c72054a15b Mon Sep 17 00:00:00 2001 From: Kabir Khan Date: Tue, 15 Jul 2025 17:03:38 +0100 Subject: [PATCH 4/4] Update tests/server-common/src/test/java/io/a2a/server/apps/common/AbstractA2AServerTest.java Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --- .../java/io/a2a/server/apps/common/AbstractA2AServerTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 08c1a28ff..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 @@ -953,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() + ": Ensuring queue failed!" + response.body()); +throw new RuntimeException(String.format("Ensuring queue failed! Status: %d, Body: %s", response.statusCode(), response.body())); } }