@@ -467,7 +467,14 @@ pub mod subscriptions {
467467#[ cfg( test) ]
468468mod tests {
469469 use actix_http:: body:: AnyBody ;
470- use actix_web:: { dev:: ServiceResponse , http, http:: header:: CONTENT_TYPE , test, web:: Data , App } ;
470+ use actix_web:: {
471+ dev:: ServiceResponse ,
472+ http,
473+ http:: header:: CONTENT_TYPE ,
474+ test:: { self , TestRequest } ,
475+ web:: Data ,
476+ App ,
477+ } ;
471478 use juniper:: {
472479 http:: tests:: { run_http_test_suite, HttpIntegration , TestResponse } ,
473480 tests:: fixtures:: starwars:: schema:: { Database , Query } ,
@@ -509,7 +516,7 @@ mod tests {
509516 }
510517 let mut app =
511518 test:: init_service ( App :: new ( ) . route ( "/" , web:: get ( ) . to ( graphql_handler) ) ) . await ;
512- let req = test :: TestRequest :: get ( )
519+ let req = TestRequest :: get ( )
513520 . uri ( "/" )
514521 . append_header ( ( ACCEPT , "text/html" ) )
515522 . to_request ( ) ;
@@ -525,7 +532,7 @@ mod tests {
525532 }
526533 let mut app =
527534 test:: init_service ( App :: new ( ) . route ( "/" , web:: get ( ) . to ( graphql_handler) ) ) . await ;
528- let req = test :: TestRequest :: get ( )
535+ let req = TestRequest :: get ( )
529536 . uri ( "/" )
530537 . append_header ( ( ACCEPT , "text/html" ) )
531538 . to_request ( ) ;
@@ -550,7 +557,7 @@ mod tests {
550557 }
551558 let mut app =
552559 test:: init_service ( App :: new ( ) . route ( "/" , web:: get ( ) . to ( graphql_handler) ) ) . await ;
553- let req = test :: TestRequest :: get ( )
560+ let req = TestRequest :: get ( )
554561 . uri ( "/" )
555562 . append_header ( ( ACCEPT , "text/html" ) )
556563 . to_request ( ) ;
@@ -566,7 +573,7 @@ mod tests {
566573 }
567574 let mut app =
568575 test:: init_service ( App :: new ( ) . route ( "/" , web:: get ( ) . to ( graphql_handler) ) ) . await ;
569- let req = test :: TestRequest :: get ( )
576+ let req = TestRequest :: get ( )
570577 . uri ( "/" )
571578 . append_header ( ( ACCEPT , "text/html" ) )
572579 . to_request ( ) ;
@@ -589,7 +596,7 @@ mod tests {
589596 EmptySubscription :: < Database > :: new ( ) ,
590597 ) ;
591598
592- let req = test :: TestRequest :: post ( )
599+ let req = TestRequest :: post ( )
593600 . append_header ( ( "content-type" , "application/json; charset=utf-8" ) )
594601 . set_payload (
595602 r##"{ "variables": null, "query": "{ hero(episode: NEW_HOPE) { name } }" }"## ,
@@ -625,7 +632,7 @@ mod tests {
625632 EmptySubscription :: < Database > :: new ( ) ,
626633 ) ;
627634
628- let req = test :: TestRequest :: get ( )
635+ let req = TestRequest :: get ( )
629636 . append_header ( ( "content-type" , "application/json" ) )
630637 . uri ( "/?query=%7B%20hero%28episode%3A%20NEW_HOPE%29%20%7B%20name%20%7D%20%7D&variables=null" )
631638 . to_request ( ) ;
@@ -663,7 +670,7 @@ mod tests {
663670 EmptySubscription :: < Database > :: new ( ) ,
664671 ) ;
665672
666- let req = test :: TestRequest :: post ( )
673+ let req = TestRequest :: post ( )
667674 . append_header ( ( "content-type" , "application/json" ) )
668675 . set_payload (
669676 r##"[
@@ -705,7 +712,7 @@ mod tests {
705712 pub struct TestActixWebIntegration ;
706713
707714 impl TestActixWebIntegration {
708- fn make_request ( & self , req : test :: TestRequest ) -> TestResponse {
715+ fn make_request ( & self , req : TestRequest ) -> TestResponse {
709716 actix_web:: rt:: System :: new ( ) . block_on ( async move {
710717 let schema = Schema :: new (
711718 Query ,
@@ -728,12 +735,12 @@ mod tests {
728735
729736 impl HttpIntegration for TestActixWebIntegration {
730737 fn get ( & self , url : & str ) -> TestResponse {
731- self . make_request ( test :: TestRequest :: get ( ) . uri ( url) )
738+ self . make_request ( TestRequest :: get ( ) . uri ( url) )
732739 }
733740
734741 fn post_json ( & self , url : & str , body : & str ) -> TestResponse {
735742 self . make_request (
736- test :: TestRequest :: post ( )
743+ TestRequest :: post ( )
737744 . append_header ( ( "content-type" , "application/json" ) )
738745 . set_payload ( body. to_string ( ) )
739746 . uri ( url) ,
@@ -742,7 +749,7 @@ mod tests {
742749
743750 fn post_graphql ( & self , url : & str , body : & str ) -> TestResponse {
744751 self . make_request (
745- test :: TestRequest :: post ( )
752+ TestRequest :: post ( )
746753 . append_header ( ( "content-type" , "application/graphql" ) )
747754 . set_payload ( body. to_string ( ) )
748755 . uri ( url) ,
0 commit comments