From 369321da7102acde5e0c9440d196bc797810254f Mon Sep 17 00:00:00 2001 From: Kabir Khan Date: Mon, 12 Jan 2026 12:06:52 +0000 Subject: [PATCH 1/2] chore: Use default protocol version in tests --- spec/src/main/java/io/a2a/util/Utils.java | 2 +- .../java/io/a2a/transport/grpc/handler/GrpcHandlerTest.java | 4 ---- .../io/a2a/transport/jsonrpc/handler/JSONRPCHandlerTest.java | 4 ---- .../java/io/a2a/transport/rest/handler/RestHandlerTest.java | 4 ---- 4 files changed, 1 insertion(+), 13 deletions(-) diff --git a/spec/src/main/java/io/a2a/util/Utils.java b/spec/src/main/java/io/a2a/util/Utils.java index ca0610b1f..033c5f17a 100644 --- a/spec/src/main/java/io/a2a/util/Utils.java +++ b/spec/src/main/java/io/a2a/util/Utils.java @@ -41,7 +41,7 @@ public class Utils { /** * Specification version constant for deprecation annotations. */ - public static final String SPEC_VERSION_1_0 = "1.0"; + public static final String SPEC_VERSION_1_0 = AgentCard.CURRENT_PROTOCOL_VERSION; /** * Returns the provided value if non-null, otherwise returns the default value. diff --git a/transport/grpc/src/test/java/io/a2a/transport/grpc/handler/GrpcHandlerTest.java b/transport/grpc/src/test/java/io/a2a/transport/grpc/handler/GrpcHandlerTest.java index ad9b879f9..77a2c955f 100644 --- a/transport/grpc/src/test/java/io/a2a/transport/grpc/handler/GrpcHandlerTest.java +++ b/transport/grpc/src/test/java/io/a2a/transport/grpc/handler/GrpcHandlerTest.java @@ -966,7 +966,6 @@ public void testVersionNotSupportedErrorOnSendMessage() throws Exception { .defaultInputModes(List.of("text")) .defaultOutputModes(List.of("text")) .skills(List.of()) - .protocolVersion("1.0") .build(); // Create handler that provides incompatible version 2.0 in the context @@ -1012,7 +1011,6 @@ public void testVersionNotSupportedErrorOnSendStreamingMessage() throws Exceptio .defaultInputModes(List.of("text")) .defaultOutputModes(List.of("text")) .skills(List.of()) - .protocolVersion("1.0") .build(); // Create handler that provides incompatible version 2.0 in the context @@ -1058,7 +1056,6 @@ public void testCompatibleVersionSuccess() throws Exception { .defaultInputModes(List.of("text")) .defaultOutputModes(List.of("text")) .skills(List.of()) - .protocolVersion("1.0") .build(); // Create handler that provides compatible version 1.1 in the context @@ -1110,7 +1107,6 @@ public void testNoVersionDefaultsToCurrentVersionSuccess() throws Exception { .defaultInputModes(List.of("text")) .defaultOutputModes(List.of("text")) .skills(List.of()) - .protocolVersion("1.0") .build(); // Create handler that provides null version (should default to 1.0) diff --git a/transport/jsonrpc/src/test/java/io/a2a/transport/jsonrpc/handler/JSONRPCHandlerTest.java b/transport/jsonrpc/src/test/java/io/a2a/transport/jsonrpc/handler/JSONRPCHandlerTest.java index c8e69f43f..a55233adb 100644 --- a/transport/jsonrpc/src/test/java/io/a2a/transport/jsonrpc/handler/JSONRPCHandlerTest.java +++ b/transport/jsonrpc/src/test/java/io/a2a/transport/jsonrpc/handler/JSONRPCHandlerTest.java @@ -1781,7 +1781,6 @@ public void testVersionNotSupportedErrorOnMessageSend() { .defaultInputModes(List.of("text")) .defaultOutputModes(List.of("text")) .skills(List.of()) - .protocolVersion("1.0") .build(); JSONRPCHandler handler = new JSONRPCHandler(agentCard, requestHandler, internalExecutor); @@ -1821,7 +1820,6 @@ public void testVersionNotSupportedErrorOnMessageSendStream() throws Exception { .defaultInputModes(List.of("text")) .defaultOutputModes(List.of("text")) .skills(List.of()) - .protocolVersion("1.0") .build(); JSONRPCHandler handler = new JSONRPCHandler(agentCard, requestHandler, internalExecutor); @@ -1898,7 +1896,6 @@ public void testCompatibleVersionSuccess() { .defaultInputModes(List.of("text")) .defaultOutputModes(List.of("text")) .skills(List.of()) - .protocolVersion("1.0") .build(); JSONRPCHandler handler = new JSONRPCHandler(agentCard, requestHandler, internalExecutor); @@ -1942,7 +1939,6 @@ public void testNoVersionDefaultsToCurrentVersionSuccess() { .defaultInputModes(List.of("text")) .defaultOutputModes(List.of("text")) .skills(List.of()) - .protocolVersion("1.0") .build(); JSONRPCHandler handler = new JSONRPCHandler(agentCard, requestHandler, internalExecutor); diff --git a/transport/rest/src/test/java/io/a2a/transport/rest/handler/RestHandlerTest.java b/transport/rest/src/test/java/io/a2a/transport/rest/handler/RestHandlerTest.java index df2a5e7af..7a151cfc2 100644 --- a/transport/rest/src/test/java/io/a2a/transport/rest/handler/RestHandlerTest.java +++ b/transport/rest/src/test/java/io/a2a/transport/rest/handler/RestHandlerTest.java @@ -628,7 +628,6 @@ public void testVersionNotSupportedErrorOnSendMessage() { .defaultInputModes(List.of("text")) .defaultOutputModes(List.of("text")) .skills(List.of()) - .protocolVersion("1.0") .build(); RestHandler handler = new RestHandler(agentCard, requestHandler, internalExecutor); @@ -680,7 +679,6 @@ public void testVersionNotSupportedErrorOnSendStreamingMessage() { .defaultInputModes(List.of("text")) .defaultOutputModes(List.of("text")) .skills(List.of()) - .protocolVersion("1.0") .build(); RestHandler handler = new RestHandler(agentCard, requestHandler, internalExecutor); @@ -769,7 +767,6 @@ public void testCompatibleVersionSuccess() { .defaultInputModes(List.of("text")) .defaultOutputModes(List.of("text")) .skills(List.of()) - .protocolVersion("1.0") .build(); RestHandler handler = new RestHandler(agentCard, requestHandler, internalExecutor); @@ -825,7 +822,6 @@ public void testNoVersionDefaultsToCurrentVersionSuccess() { .defaultInputModes(List.of("text")) .defaultOutputModes(List.of("text")) .skills(List.of()) - .protocolVersion("1.0") .build(); RestHandler handler = new RestHandler(agentCard, requestHandler, internalExecutor); From cffcf7b812382a1b75fd1a50288a5c2622bc543a Mon Sep 17 00:00:00 2001 From: Kabir Khan Date: Mon, 12 Jan 2026 15:36:33 +0000 Subject: [PATCH 2/2] Unused constant --- spec/src/main/java/io/a2a/util/Utils.java | 5 ----- 1 file changed, 5 deletions(-) diff --git a/spec/src/main/java/io/a2a/util/Utils.java b/spec/src/main/java/io/a2a/util/Utils.java index 033c5f17a..792365579 100644 --- a/spec/src/main/java/io/a2a/util/Utils.java +++ b/spec/src/main/java/io/a2a/util/Utils.java @@ -38,11 +38,6 @@ public class Utils { private static final Logger log = Logger.getLogger(Utils.class.getName()); - /** - * Specification version constant for deprecation annotations. - */ - public static final String SPEC_VERSION_1_0 = AgentCard.CURRENT_PROTOCOL_VERSION; - /** * Returns the provided value if non-null, otherwise returns the default value. *