11package io .a2a .server .rest .quarkus ;
22
3- import io .a2a .server .rest .quarkus .A2AServerRoutes ;
4-
53import static io .vertx .core .http .HttpHeaders .CONTENT_TYPE ;
64import static jakarta .ws .rs .core .MediaType .APPLICATION_JSON ;
75import static jakarta .ws .rs .core .MediaType .TEXT_PLAIN ;
@@ -41,28 +39,29 @@ public void init() {
4139 A2AServerRoutes .setStreamingMultiSseSupportSubscribedRunnable (() -> streamingSubscribedCount .incrementAndGet ());
4240 }
4341
44-
45- @ Route ( path = "/test/task" , methods = { Route . HttpMethod . POST }, consumes = { APPLICATION_JSON }, type = Route .HandlerType .BLOCKING )
42+ @ Route ( path = "/test/task" , methods = { Route . HttpMethod . POST }, consumes = {
43+ APPLICATION_JSON }, type = Route .HandlerType .BLOCKING )
4644 public void saveTask (@ Body String body , RoutingContext rc ) {
4745 try {
4846 Task task = Utils .OBJECT_MAPPER .readValue (body , Task .class );
4947 testUtilsBean .saveTask (task );
5048 rc .response ()
51- .setStatusCode (200 )
52- .end ();
49+ .setStatusCode (200 )
50+ .end ();
5351 } catch (Throwable t ) {
5452 errorResponse (t , rc );
5553 }
5654 }
5755
58- @ Route (path = "/test/task/:taskId" , methods = {Route .HttpMethod .GET }, produces = {APPLICATION_JSON }, type = Route .HandlerType .BLOCKING )
59- public void getTask (@ Param String taskId , RoutingContext rc ) {
56+ @ Route (path = "/test/task/:taskId" , methods = { Route .HttpMethod .GET }, produces = {
57+ APPLICATION_JSON }, type = Route .HandlerType .BLOCKING )
58+ public void getTask (@ Param String taskId , RoutingContext rc ) {
6059 try {
6160 Task task = testUtilsBean .getTask (taskId );
6261 if (task == null ) {
6362 rc .response ()
64- .setStatusCode (404 )
65- .end ();
63+ .setStatusCode (404 )
64+ .end ();
6665 return ;
6766 }
6867 rc .response ()
@@ -75,7 +74,7 @@ public void getTask(@Param String taskId, RoutingContext rc) {
7574 }
7675 }
7776
78- @ Route (path = "/test/task/:taskId" , methods = {Route .HttpMethod .DELETE }, type = Route .HandlerType .BLOCKING )
77+ @ Route (path = "/test/task/:taskId" , methods = { Route .HttpMethod .DELETE }, type = Route .HandlerType .BLOCKING )
7978 public void deleteTask (@ Param String taskId , RoutingContext rc ) {
8079 try {
8180 Task task = testUtilsBean .getTask (taskId );
@@ -94,7 +93,7 @@ public void deleteTask(@Param String taskId, RoutingContext rc) {
9493 }
9594 }
9695
97- @ Route (path = "/test/queue/ensure/:taskId" , methods = {Route .HttpMethod .POST })
96+ @ Route (path = "/test/queue/ensure/:taskId" , methods = { Route .HttpMethod .POST })
9897 public void ensureTaskQueue (@ Param String taskId , RoutingContext rc ) {
9998 try {
10099 testUtilsBean .ensureQueue (taskId );
@@ -106,7 +105,7 @@ public void ensureTaskQueue(@Param String taskId, RoutingContext rc) {
106105 }
107106 }
108107
109- @ Route (path = "/test/queue/enqueueTaskStatusUpdateEvent/:taskId" , methods = {Route .HttpMethod .POST })
108+ @ Route (path = "/test/queue/enqueueTaskStatusUpdateEvent/:taskId" , methods = { Route .HttpMethod .POST })
110109 public void enqueueTaskStatusUpdateEvent (@ Param String taskId , @ Body String body , RoutingContext rc ) {
111110
112111 try {
@@ -120,7 +119,7 @@ public void enqueueTaskStatusUpdateEvent(@Param String taskId, @Body String body
120119 }
121120 }
122121
123- @ Route (path = "/test/queue/enqueueTaskArtifactUpdateEvent/:taskId" , methods = {Route .HttpMethod .POST })
122+ @ Route (path = "/test/queue/enqueueTaskArtifactUpdateEvent/:taskId" , methods = { Route .HttpMethod .POST })
124123 public void enqueueTaskArtifactUpdateEvent (@ Param String taskId , @ Body String body , RoutingContext rc ) {
125124
126125 try {
@@ -134,22 +133,23 @@ public void enqueueTaskArtifactUpdateEvent(@Param String taskId, @Body String bo
134133 }
135134 }
136135
137- @ Route (path = "/test/streamingSubscribedCount" , methods = {Route .HttpMethod .GET }, produces = {TEXT_PLAIN })
136+ @ Route (path = "/test/streamingSubscribedCount" , methods = { Route .HttpMethod .GET }, produces = { TEXT_PLAIN })
138137 public void getStreamingSubscribedCount (RoutingContext rc ) {
139138 rc .response ()
140139 .setStatusCode (200 )
141140 .end (String .valueOf (streamingSubscribedCount .get ()));
142141 }
143142
144- @ Route (path = "/test/queue/childCount/:taskId" , methods = {Route .HttpMethod .GET }, produces = {TEXT_PLAIN })
143+ @ Route (path = "/test/queue/childCount/:taskId" , methods = { Route .HttpMethod .GET }, produces = { TEXT_PLAIN })
145144 public void getChildQueueCount (@ Param String taskId , RoutingContext rc ) {
146145 int count = testUtilsBean .getChildQueueCount (taskId );
147146 rc .response ()
148147 .setStatusCode (200 )
149148 .end (String .valueOf (count ));
150149 }
151150
152- @ Route (path = "/test/task/:taskId/config/:configId" , methods = {Route .HttpMethod .DELETE }, type = Route .HandlerType .BLOCKING )
151+ @ Route (path = "/test/task/:taskId/config/:configId" , methods = {
152+ Route .HttpMethod .DELETE }, type = Route .HandlerType .BLOCKING )
153153 public void deleteTaskPushNotificationConfig (@ Param String taskId , @ Param String configId , RoutingContext rc ) {
154154 try {
155155 Task task = testUtilsBean .getTask (taskId );
@@ -168,10 +168,11 @@ public void deleteTaskPushNotificationConfig(@Param String taskId, @Param String
168168 }
169169 }
170170
171- @ Route (path = "/test/task/:taskId" , methods = {Route .HttpMethod .POST }, type = Route .HandlerType .BLOCKING )
171+ @ Route (path = "/test/task/:taskId" , methods = { Route .HttpMethod .POST }, type = Route .HandlerType .BLOCKING )
172172 public void saveTaskPushNotificationConfig (@ Param String taskId , @ Body String body , RoutingContext rc ) {
173173 try {
174- PushNotificationConfig notificationConfig = Utils .OBJECT_MAPPER .readValue (body , PushNotificationConfig .class );
174+ PushNotificationConfig notificationConfig = Utils .OBJECT_MAPPER .readValue (body ,
175+ PushNotificationConfig .class );
175176 if (notificationConfig == null ) {
176177 rc .response ()
177178 .setStatusCode (404 )
0 commit comments