@@ -13,8 +13,7 @@ use a2a_server::jsonrpc::jsonrpc_router;
1313use a2a_server:: rest:: rest_router;
1414use a2a_server:: {
1515 DefaultRequestHandler , ExecutorContext , HttpPushSender , InMemoryPushConfigStore ,
16- InMemoryTaskStore , RequestHandler , ServiceParams ,
17- WELL_KNOWN_AGENT_CARD_PATH ,
16+ InMemoryTaskStore , RequestHandler , ServiceParams , WELL_KNOWN_AGENT_CARD_PATH ,
1817} ;
1918use async_trait:: async_trait;
2019use axum:: body:: Bytes ;
@@ -271,7 +270,10 @@ impl RequestHandler for TestHandler {
271270}
272271
273272impl a2a_server:: AgentExecutor for PushTransportExecutor {
274- fn execute ( & self , ctx : ExecutorContext ) -> BoxStream < ' static , Result < StreamResponse , A2AError > > {
273+ fn execute (
274+ & self ,
275+ ctx : ExecutorContext ,
276+ ) -> BoxStream < ' static , Result < StreamResponse , A2AError > > {
275277 let working = StreamResponse :: StatusUpdate ( TaskStatusUpdateEvent {
276278 task_id : ctx. task_id . clone ( ) ,
277279 context_id : ctx. context_id . clone ( ) ,
@@ -346,10 +348,7 @@ async fn spawn_http_server() -> (String, tokio::task::JoinHandle<()>) {
346348async fn spawn_push_http_server ( ) -> ( String , tokio:: task:: JoinHandle < ( ) > ) {
347349 let handler = Arc :: new (
348350 DefaultRequestHandler :: new ( PushTransportExecutor , InMemoryTaskStore :: new ( ) )
349- . with_push_notifications (
350- InMemoryPushConfigStore :: new ( ) ,
351- HttpPushSender :: new ( None ) ,
352- ) ,
351+ . with_push_notifications ( InMemoryPushConfigStore :: new ( ) , HttpPushSender :: new ( None ) ) ,
353352 ) ;
354353 let app = Router :: new ( )
355354 . nest ( "/rest" , rest_router ( handler. clone ( ) ) )
@@ -389,14 +388,15 @@ async fn capture_push(
389388 StatusCode :: ACCEPTED
390389}
391390
392- async fn spawn_webhook_server (
393- ) -> (
391+ async fn spawn_webhook_server ( ) -> (
394392 String ,
395393 mpsc:: UnboundedReceiver < CapturedPush > ,
396394 tokio:: task:: JoinHandle < ( ) > ,
397395) {
398396 let ( sender, receiver) = mpsc:: unbounded_channel ( ) ;
399- let app = Router :: new ( ) . route ( "/" , post ( capture_push) ) . with_state ( sender) ;
397+ let app = Router :: new ( )
398+ . route ( "/" , post ( capture_push) )
399+ . with_state ( sender) ;
400400 let listener = TcpListener :: bind ( "127.0.0.1:0" ) . await . unwrap ( ) ;
401401 let addr = listener. local_addr ( ) . unwrap ( ) ;
402402 let handle = tokio:: spawn ( async move {
@@ -861,7 +861,10 @@ async fn rest_transport_push_delivery_end_to_end() {
861861 assert ! ( matches!( response, SendMessageResponse :: Task ( _) ) ) ;
862862
863863 let first = recv_push ( & mut receiver) . await ;
864- assert_eq ! ( first. authorization. as_deref( ) , Some ( "Basic dGVzdDpzZWNyZXQ=" ) ) ;
864+ assert_eq ! (
865+ first. authorization. as_deref( ) ,
866+ Some ( "Basic dGVzdDpzZWNyZXQ=" )
867+ ) ;
865868 assert_eq ! ( first. notification_token. as_deref( ) , Some ( "rest-token" ) ) ;
866869 match first. event {
867870 StreamResponse :: StatusUpdate ( update) => {
@@ -872,7 +875,10 @@ async fn rest_transport_push_delivery_end_to_end() {
872875 }
873876
874877 let second = recv_push ( & mut receiver) . await ;
875- assert_eq ! ( second. authorization. as_deref( ) , Some ( "Basic dGVzdDpzZWNyZXQ=" ) ) ;
878+ assert_eq ! (
879+ second. authorization. as_deref( ) ,
880+ Some ( "Basic dGVzdDpzZWNyZXQ=" )
881+ ) ;
876882 assert_eq ! ( second. notification_token. as_deref( ) , Some ( "rest-token" ) ) ;
877883 match second. event {
878884 StreamResponse :: Task ( task) => {
0 commit comments