@@ -94,7 +94,7 @@ async fn setup(lib_root: &Path, test_params: &TestParams) {
9494 server
9595 . mock ( "GET" , format ! ( "/repos/{REPO}/{diff_end_point}" ) . as_str ( ) )
9696 . match_header ( "Accept" , "application/vnd.github.diff" )
97- . match_header ( "Authorization" , TOKEN )
97+ . match_header ( "Authorization" , format ! ( "token { TOKEN}" ) . as_str ( ) )
9898 . with_body_from_file ( format ! ( "{asset_path}patch.diff" ) )
9999 . with_header ( REMAINING_RATE_LIMIT_HEADER , "50" )
100100 . with_header ( RESET_RATE_LIMIT_HEADER , reset_timestamp. as_str ( ) )
@@ -109,7 +109,7 @@ async fn setup(lib_root: &Path, test_params: &TestParams) {
109109 format ! ( "/repos/{REPO}/commits/{SHA}/comments" ) . as_str ( ) ,
110110 )
111111 . match_header ( "Accept" , "application/vnd.github.raw+json" )
112- . match_header ( "Authorization" , TOKEN )
112+ . match_header ( "Authorization" , format ! ( "token { TOKEN}" ) . as_str ( ) )
113113 . match_body ( Matcher :: Any )
114114 . match_query ( Matcher :: UrlEncoded ( "page" . to_string ( ) , "1" . to_string ( ) ) )
115115 . with_body_from_file ( format ! ( "{asset_path}push_comments_{SHA}.json" ) )
@@ -134,7 +134,7 @@ async fn setup(lib_root: &Path, test_params: &TestParams) {
134134 server
135135 . mock ( "GET" , pr_endpoint. as_str ( ) )
136136 . match_header ( "Accept" , "application/vnd.github.raw+json" )
137- . match_header ( "Authorization" , TOKEN )
137+ . match_header ( "Authorization" , format ! ( "token { TOKEN}" ) . as_str ( ) )
138138 . match_body ( Matcher :: Any )
139139 . match_query ( Matcher :: UrlEncoded ( "page" . to_string ( ) , pg. to_string ( ) ) )
140140 . with_body_from_file ( format ! ( "{asset_path}pr_comments_pg{pg}.json" ) )
@@ -153,6 +153,7 @@ async fn setup(lib_root: &Path, test_params: &TestParams) {
153153 server
154154 . mock ( "DELETE" , comment_url. as_str ( ) )
155155 . match_body ( Matcher :: Any )
156+ . match_header ( "Authorization" , format ! ( "token {TOKEN}" ) . as_str ( ) )
156157 . with_status ( if test_params. fail_dismissal { 403 } else { 200 } )
157158 . with_header ( REMAINING_RATE_LIMIT_HEADER , "50" )
158159 . with_header ( RESET_RATE_LIMIT_HEADER , reset_timestamp. as_str ( ) )
@@ -177,6 +178,7 @@ async fn setup(lib_root: &Path, test_params: &TestParams) {
177178 server
178179 . mock ( "PATCH" , comment_url. as_str ( ) )
179180 . match_body ( new_comment_match. clone ( ) )
181+ . match_header ( "Authorization" , format ! ( "token {TOKEN}" ) . as_str ( ) )
180182 . with_status ( if test_params. fail_posting { 403 } else { 200 } )
181183 . with_header ( REMAINING_RATE_LIMIT_HEADER , "50" )
182184 . with_header ( RESET_RATE_LIMIT_HEADER , reset_timestamp. as_str ( ) )
@@ -200,6 +202,7 @@ async fn setup(lib_root: &Path, test_params: &TestParams) {
200202 . as_str ( ) ,
201203 )
202204 . match_body ( new_comment_match)
205+ . match_header ( "Authorization" , format ! ( "token {TOKEN}" ) . as_str ( ) )
203206 . with_header ( REMAINING_RATE_LIMIT_HEADER , "50" )
204207 . with_header ( RESET_RATE_LIMIT_HEADER , reset_timestamp. as_str ( ) )
205208 . with_status ( if test_params. fail_posting { 403 } else { 200 } )
0 commit comments