@@ -18,7 +18,7 @@ use test_assets::{
1818 create_signed_receipt, SignedReceiptRequest , INDEXER_ALLOCATIONS , TAP_EIP712_DOMAIN ,
1919} ;
2020use tokio:: sync:: watch;
21- use tower:: ServiceExt ;
21+ use tower:: Service ;
2222use wiremock:: {
2323 matchers:: { method, path} ,
2424 Mock , MockServer , ResponseTemplate ,
@@ -95,7 +95,7 @@ async fn full_integration_test(database: PgPool) {
9595 . allocations ( allocations)
9696 . build ( ) ;
9797
98- let app = router. create_router ( ) . await . unwrap ( ) ;
98+ let mut app = router. create_router ( ) . await . unwrap ( ) ;
9999
100100 let receipt = create_signed_receipt (
101101 SignedReceiptRequest :: builder ( )
@@ -118,12 +118,29 @@ async fn full_integration_test(database: PgPool) {
118118 . unwrap ( ) ;
119119
120120 // with deployment
121- let res = app. oneshot ( request) . await . unwrap ( ) ;
121+ let res = app. call ( request) . await . unwrap ( ) ;
122122 assert_eq ! ( res. status( ) , StatusCode :: OK ) ;
123123
124124 let graphql_response = res. into_body ( ) ;
125125 let bytes = to_bytes ( graphql_response, usize:: MAX ) . await . unwrap ( ) ;
126126 let res = String :: from_utf8 ( bytes. into ( ) ) . unwrap ( ) ;
127127
128128 insta:: assert_snapshot!( res) ;
129+
130+ let request = Request :: builder ( )
131+ . method ( Method :: POST )
132+ . uri ( format ! ( "/subgraphs/id/{deployment}" ) )
133+ . body ( serde_json:: to_string ( & query) . unwrap ( ) )
134+ . unwrap ( ) ;
135+
136+ // without tap receipt
137+ let res = app. call ( request) . await . unwrap ( ) ;
138+
139+ assert_eq ! ( res. status( ) , StatusCode :: PAYMENT_REQUIRED ) ;
140+
141+ let graphql_response = res. into_body ( ) ;
142+ let bytes = to_bytes ( graphql_response, usize:: MAX ) . await . unwrap ( ) ;
143+ let res = String :: from_utf8 ( bytes. into ( ) ) . unwrap ( ) ;
144+
145+ insta:: assert_snapshot!( res) ;
129146}
0 commit comments