Skip to content

Commit d2c5795

Browse files
committed
fix: Add missing config ID to RestTransportTest push notification test
The testSetTaskPushNotificationConfiguration was failing because the PushNotificationConfig was created without an ID. This caused the request to not match the expected protobuf format which requires both a configId field and the ID in the resource name path. Changes: - Added .id("default-config-id") to PushNotificationConfig.Builder in RestTransportTest.java - Updated SET_TASK_PUSH_NOTIFICATION_CONFIG_TEST_REQUEST in JsonRestMessages.java to include: - configId field at top level - Full resource name with config ID in path: tasks/{taskId}/pushNotificationConfigs/{configId} This matches the pattern used in the working JSONRPCTransportTest. Test now passes: ✅ RestTransportTest.testSetTaskPushNotificationConfiguration
1 parent e8240df commit d2c5795

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

client/transport/rest/src/test/java/io/a2a/client/transport/rest/JsonRestMessages.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,8 +347,9 @@ public class JsonRestMessages {
347347
static final String SET_TASK_PUSH_NOTIFICATION_CONFIG_TEST_REQUEST = """
348348
{
349349
"parent": "tasks/de38c76d-d54c-436c-8b9f-4c2703648d64",
350+
"configId": "default-config-id",
350351
"config": {
351-
"name": "tasks/de38c76d-d54c-436c-8b9f-4c2703648d64/pushNotificationConfigs",
352+
"name": "tasks/de38c76d-d54c-436c-8b9f-4c2703648d64/pushNotificationConfigs/default-config-id",
352353
"pushNotificationConfig": {
353354
"url": "https://example.com/callback",
354355
"authentication": {

client/transport/rest/src/test/java/io/a2a/client/transport/rest/RestTransportTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,7 @@ public void testSetTaskPushNotificationConfiguration() throws Exception {
304304
TaskPushNotificationConfig pushedConfig = new TaskPushNotificationConfig(
305305
"de38c76d-d54c-436c-8b9f-4c2703648d64",
306306
new PushNotificationConfig.Builder()
307+
.id("default-config-id")
307308
.url("https://example.com/callback")
308309
.authenticationInfo(
309310
new AuthenticationInfo(Collections.singletonList("jwt"), null))

0 commit comments

Comments
 (0)