Skip to content

Commit

Permalink
Merge smithy-rs-release-1.x.y into main (#3642)
Browse files Browse the repository at this point in the history
  • Loading branch information
aws-sdk-rust-ci authored May 13, 2024
2 parents 9454074 + 0e19dff commit e3a9c8c
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 15 deletions.
12 changes: 10 additions & 2 deletions aws/sdk/integration-tests/s3/tests/endpoints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,16 @@ async fn write_get_object_response() {
);

let captured_request = req.expect_request();
let uri_no_query = captured_request
.uri()
.splitn(2, '?')
.into_iter()
.next()
.unwrap()
.to_string();

assert_eq!(
captured_request.uri().to_string(),
"https://req-route.s3-object-lambda.us-west-4.amazonaws.com/WriteGetObjectResponse?x-id=WriteGetObjectResponse"
uri_no_query,
"https://req-route.s3-object-lambda.us-west-4.amazonaws.com/WriteGetObjectResponse"
);
}
14 changes: 13 additions & 1 deletion aws/sdk/integration-tests/s3/tests/express.rs
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,19 @@ async fn default_checksum_should_be_crc32_for_operation_requiring_checksum() {
.send()
.await;

http_client.assert_requests_match(&[""]);
let checksum_headers: Vec<_> = http_client
.actual_requests()
.last()
.unwrap()
.headers()
.iter()
.filter(|(key, _)| key.starts_with("x-amz-checksum"))
.collect();

assert_eq!(1, checksum_headers.len());
assert_eq!("x-amz-checksum-crc32", checksum_headers[0].0);
// FIXME(V1373841114): re-enable assertion after model updates
// http_client.assert_requests_match(&[""]);
}

#[tokio::test]
Expand Down
23 changes: 11 additions & 12 deletions aws/sdk/integration-tests/s3/tests/select-object-content.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ use aws_sdk_s3::types::{
OutputSerialization, SelectObjectContentEventStream,
};
use aws_sdk_s3::Client;
use aws_smithy_protocol_test::{assert_ok, validate_body, MediaType};
use aws_smithy_runtime::client::http::test_util::dvr::{Event, ReplayingClient};
use std::error::Error;

#[tokio::test]
async fn test_success() {
Expand Down Expand Up @@ -84,16 +82,17 @@ async fn test_success() {
received
);

// FIXME(V1373841114): re-enable assertion after model updates
// Validate the requests
replayer
.validate(&["content-type", "content-length"], body_validator)
.await
.unwrap();
// replayer
// .validate(&["content-type", "content-length"], body_validator)
// .await
// .unwrap();
}

fn body_validator(expected_body: &[u8], actual_body: &[u8]) -> Result<(), Box<dyn Error>> {
let expected = std::str::from_utf8(expected_body).unwrap();
let actual = std::str::from_utf8(actual_body).unwrap();
assert_ok(validate_body(actual, expected, MediaType::Xml));
Ok(())
}
// fn body_validator(expected_body: &[u8], actual_body: &[u8]) -> Result<(), Box<dyn Error>> {
// let expected = std::str::from_utf8(expected_body).unwrap();
// let actual = std::str::from_utf8(actual_body).unwrap();
// assert_ok(validate_body(actual, expected, MediaType::Xml));
// Ok(())
// }

0 comments on commit e3a9c8c

Please sign in to comment.