@@ -47,7 +47,7 @@ pub async fn get_error(user: &mut GooseUser) -> TransactionResult {
4747
4848// Set up mock server with different endpoints that return different status codes.
4949fn setup_mock_server_endpoints ( server : & MockServer ) -> Vec < Mock < ' _ > > {
50- let mut mocks = vec ! [
50+ let mocks = vec ! [
5151 // SUCCESS_PATH always returns 200
5252 server. mock( |when, then| {
5353 when. method( GET ) . path( SUCCESS_PATH ) ;
@@ -65,15 +65,6 @@ fn setup_mock_server_endpoints(server: &MockServer) -> Vec<Mock<'_>> {
6565 } ) ,
6666 ] ;
6767
68- // Add a separate mock for MIXED_PATH that returns 400 occasionally
69- // This will be handled randomly by httpmock
70- for _ in 0 ..2 {
71- mocks. push ( server. mock ( |when, then| {
72- when. method ( GET ) . path ( MIXED_PATH ) ;
73- then. status ( 400 ) ;
74- } ) ) ;
75- }
76-
7768 mocks
7869}
7970
@@ -95,7 +86,7 @@ fn validate_status_code_response_times(goose_metrics: &GooseMetrics, mock_endpoi
9586 // Test the /success endpoint - should only have 200 status codes
9687 let success_request = goose_metrics
9788 . requests
98- . get ( & format ! ( "GET {}" , SUCCESS_PATH ) )
89+ . get ( & format ! ( "GET {SUCCESS_PATH}" ) )
9990 . expect ( "Success request should exist" ) ;
10091
10192 // Should have status code counts
@@ -129,7 +120,7 @@ fn validate_status_code_response_times(goose_metrics: &GooseMetrics, mock_endpoi
129120 // Test the /mixed endpoint - should have both 200 and 400 status codes
130121 let mixed_request = goose_metrics
131122 . requests
132- . get ( & format ! ( "GET {}" , MIXED_PATH ) )
123+ . get ( & format ! ( "GET {MIXED_PATH}" ) )
133124 . expect ( "Mixed request should exist" ) ;
134125
135126 // Should have status code counts for both 200 and 400
@@ -151,7 +142,7 @@ fn validate_status_code_response_times(goose_metrics: &GooseMetrics, mock_endpoi
151142 // Test the /error endpoint - should only have 400 status codes
152143 let error_request = goose_metrics
153144 . requests
154- . get ( & format ! ( "GET {}" , ERROR_PATH ) )
145+ . get ( & format ! ( "GET {ERROR_PATH}" ) )
155146 . expect ( "Error request should exist" ) ;
156147
157148 // Should have status code counts
0 commit comments