Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
aajtodd committed Jan 17, 2025
1 parent 590dc25 commit 26348e8
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
1 change: 1 addition & 0 deletions aws/rust-runtime/aws-config/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -891,6 +891,7 @@ mod loader {

let identity_cache = match self.identity_cache {
None => match self.behavior_version {
#[allow(deprecated)]
Some(bv) if bv.is_at_least(BehaviorVersion::v2024_03_28()) => {
Some(IdentityCache::lazy().build())
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,15 @@ internal class HttpChecksumTest {
// Note about the `//#{PresigningMarker}` below. The `RequestChecksumInterceptor` relies on the `PresigningMarker` type from
// the presigning inlineable. The decorator for that inlineable doesn't play nicely with the test model from the SEP, so we
// use this as a kind of blunt way to include the presigning inlineable without actually wiring it up with the model.
// We also have to ensure the `http-1x` feature the presigning inlineable expects is present on the generated crate.
rustCrate.mergeFeature(
Feature(
"http-1x",
default = false,
listOf("dep:http-body-1x", "aws-smithy-runtime-api/http-1x"),
),
)

val testBase =
writable {
rustTemplate(
Expand Down Expand Up @@ -290,6 +299,7 @@ internal class HttpChecksumTest {
*preludeScope,
"tokio" to CargoDependency.Tokio.toType(),
"capture_request" to RuntimeType.captureRequest(rc),
"http_1x" to CargoDependency.Http1x.toType(),
)
}
}
Expand Down Expand Up @@ -368,6 +378,7 @@ internal class HttpChecksumTest {
*preludeScope,
"tokio" to CargoDependency.Tokio.toType(),
"capture_request" to RuntimeType.captureRequest(rc),
"http_1x" to CargoDependency.Http1x.toType(),
)
}
}
Expand All @@ -389,7 +400,7 @@ internal class HttpChecksumTest {
##[::tokio::test]
async fn ${algoLower}_response_checksums_works() {
let (http_client, _rx) = #{capture_request}(Some(
http::Response::builder()
#{http_1x}::Response::builder()
.header("x-amz-checksum-$algoLower", "${testDef.checksumHeaderValue}")
.body(SdkBody::from("${testDef.responsePayload}"))
.unwrap(),
Expand All @@ -414,6 +425,7 @@ internal class HttpChecksumTest {
*preludeScope,
"tokio" to CargoDependency.Tokio.toType(),
"capture_request" to RuntimeType.captureRequest(rc),
"http_1x" to CargoDependency.Http1x.toType(),
)
}
}
Expand All @@ -435,7 +447,7 @@ internal class HttpChecksumTest {
##[::tokio::test]
async fn ${algoLower}_response_checksums_fail_correctly() {
let (http_client, _rx) = #{capture_request}(Some(
http::Response::builder()
#{http_1x}::Response::builder()
.header("x-amz-checksum-$algoLower", "${testDef.checksumHeaderValue}")
.body(SdkBody::from("${testDef.responsePayload}"))
.unwrap(),
Expand Down Expand Up @@ -476,6 +488,7 @@ internal class HttpChecksumTest {
*preludeScope,
"tokio" to CargoDependency.Tokio.toType(),
"capture_request" to RuntimeType.captureRequest(rc),
"http_1x" to CargoDependency.Http1x.toType(),
)
}
}
Expand Down Expand Up @@ -537,6 +550,7 @@ internal class HttpChecksumTest {
*preludeScope,
"tokio" to CargoDependency.Tokio.toType(),
"capture_request" to RuntimeType.captureRequest(rc),
"http_1x" to CargoDependency.Http1x.toType(),
)
}
}
Expand Down Expand Up @@ -613,7 +627,7 @@ internal class HttpChecksumTest {
##[::tokio::test]
async fn response_config_ua_supported() {
let (http_client, rx) = #{capture_request}(Some(
http::Response::builder()
#{http_1x}::Response::builder()
.header("x-amz-checksum-crc32", "i9aeUg==")
.body(SdkBody::from("Hello world"))
.unwrap(),
Expand Down Expand Up @@ -645,7 +659,7 @@ internal class HttpChecksumTest {
##[::tokio::test]
async fn response_config_ua_required() {
let (http_client, rx) = #{capture_request}(Some(
http::Response::builder()
#{http_1x}::Response::builder()
.header("x-amz-checksum-crc32", "i9aeUg==")
.body(SdkBody::from("Hello world"))
.unwrap(),
Expand Down Expand Up @@ -680,6 +694,7 @@ internal class HttpChecksumTest {
*preludeScope,
"tokio" to CargoDependency.Tokio.toType(),
"capture_request" to RuntimeType.captureRequest(rc),
"http_1x" to CargoDependency.Http1x.toType(),
)
}
}
Expand Down

0 comments on commit 26348e8

Please sign in to comment.