Skip to content

Commit cc7b989

Browse files
committed
Update from TestConnector to StaticReplayClient
1 parent e48e2ae commit cc7b989

File tree

15 files changed

+54
-160
lines changed

15 files changed

+54
-160
lines changed

rust_dev_preview/cross_service/photo_asset_management/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ aws-smithy-client = { git = "https://github.com/awslabs/aws-sdk-rust", branch =
2323
"test-util",
2424
] }
2525
aws-smithy-http = { git = "https://github.com/awslabs/aws-sdk-rust", branch = "next" }
26+
aws-smithy-runtime = { git = "https://github.com/awslabs/aws-sdk-rust", branch = "next" }
2627
aws-smithy-types-convert ={ git = "https://github.com/awslabs/aws-sdk-rust", branch = "next", features = ["convert-chrono"] }
2728
aws_lambda_events = { version = "0.10.0", features = ["s3", "apigw"], default-features = false }
2829
bytes = "1.4.0"
@@ -35,6 +36,7 @@ lambda_runtime = "0.8.0"
3536
miniz_oxide = "0.7.1"
3637
pin-project = "1.0.12"
3738
pipe = "0.4.0"
39+
sdk-examples-test-utils = { path = "../../test-utils" }
3840
serde = { version = "1.0.159", features = ["derive"] }
3941
serde_json = "1.0.95"
4042
streaming-zip = "0.5.0"

rust_dev_preview/cross_service/photo_asset_management/src/handlers/labels.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,9 @@ pub async fn handler(
104104

105105
#[cfg(test)]
106106
mod test {
107+
use sdk_examples_test_utils::single_shot_client;
107108
use serde_json::json;
108109

109-
use crate::single_shot_client;
110-
111110
use super::{get_labels, Labels};
112111

113112
#[tokio::test]
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
pub mod chunked_uploader;
22
pub mod common;
33
pub mod handlers;
4-
pub mod test_utils;
54
pub mod uploader;

rust_dev_preview/cross_service/photo_asset_management/src/test_utils/macros.rs

Lines changed: 0 additions & 103 deletions
This file was deleted.

rust_dev_preview/cross_service/photo_asset_management/src/test_utils/mod.rs

Lines changed: 0 additions & 17 deletions
This file was deleted.

rust_dev_preview/cross_service/rest_ses/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ aws-config = { git = "https://github.com/awslabs/aws-sdk-rust", branch = "next"
1818
aws-sdk-cloudwatchlogs = { git = "https://github.com/awslabs/aws-sdk-rust", branch = "next" }
1919
aws-sdk-rdsdata = { git = "https://github.com/awslabs/aws-sdk-rust", branch = "next" }
2020
aws-sdk-ses = { git = "https://github.com/awslabs/aws-sdk-rust", branch = "next" }
21+
aws-smithy-runtime = { git = "https://github.com/awslabs/aws-sdk-rust", branch = "next" }
2122
chrono = { version = "0.4.22", default-features = false, features = [
2223
"clock",
2324
"serde",

rust_dev_preview/cross_service/rest_ses/src/client.rs

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -64,23 +64,20 @@ impl RdsClient {
6464

6565
#[cfg(test)]
6666
mod rds_client_for_test {
67-
use aws_smithy_http::body::SdkBody;
67+
use aws_smithy_runtime::client::http::test_util::ReplayEvent;
6868
use secrecy::Secret;
6969

7070
use super::RdsClient;
7171
impl RdsClient {
72-
pub fn for_test(
73-
pairs: Vec<(
74-
http::request::Request<SdkBody>,
75-
http::response::Response<SdkBody>,
76-
)>,
77-
) -> Self {
72+
pub fn for_test(pairs: Vec<ReplayEvent>) -> Self {
7873
RdsClient {
7974
client: aws_sdk_rdsdata::Client::from_conf(
8075
sdk_examples_test_utils::client_config!(aws_sdk_rdsdata)
81-
.http_connector(aws_smithy_client::test_connection::TestConnection::new(
82-
pairs,
83-
))
76+
.http_client(
77+
aws_smithy_runtime::client::http::test_util::StaticReplayClient::new(
78+
pairs,
79+
),
80+
)
8481
.build(),
8582
),
8683
secret_arn: Secret::from("secret".to_string()),

rust_dev_preview/examples/dynamodb/Cargo.toml

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,30 +12,25 @@ edition = "2021"
1212

1313
[dependencies]
1414
aws-config = { git = "https://github.com/awslabs/aws-sdk-rust", branch = "next" }
15-
aws-sdk-dynamodb = { git = "https://github.com/awslabs/aws-sdk-rust", branch = "next" }
1615
aws-http = { git = "https://github.com/awslabs/aws-sdk-rust", branch = "next" }
17-
aws-smithy-client = { git = "https://github.com/awslabs/aws-sdk-rust", branch = "next", features = [
18-
"client-hyper",
19-
"rustls",
20-
"rt-tokio",
21-
] }
22-
aws-smithy-http = { git = "https://github.com/awslabs/aws-sdk-rust", branch = "next", features = [
23-
"rt-tokio",
24-
] }
16+
aws-sdk-dynamodb = { git = "https://github.com/awslabs/aws-sdk-rust", branch = "next" }
17+
aws-smithy-client = { git = "https://github.com/awslabs/aws-sdk-rust", branch = "next", features = [ "client-hyper", "rustls", "rt-tokio", ] }
18+
aws-smithy-http = { git = "https://github.com/awslabs/aws-sdk-rust", branch = "next", features = [ "rt-tokio", ] }
19+
aws-smithy-runtime = { git = "https://github.com/awslabs/aws-sdk-rust", branch = "next", features = ["test-util"] }
2520
aws-smithy-types = { git = "https://github.com/awslabs/aws-sdk-rust", branch = "next" }
2621
axum = "0.5.16"
27-
http = "0.2.5"
22+
clap = { version = "~4.2", features = ["derive"] }
2823
futures = "0.3"
24+
http = "0.2.5"
2925
log = "0.4.17"
3026
rand = "0.8.3"
3127
sdk-examples-test-utils = { path = "../../test-utils" }
3228
serde = {version = "1.0", features = ["derive"]}
33-
serde_json = "1"
3429
serde_dynamo = { version = "4", features = ["aws-sdk-dynamodb+0_22"] }
35-
clap = { version = "~4.2", features = ["derive"] }
36-
tracing = "0.1"
30+
serde_json = "1"
3731
thiserror = "1.0"
3832
tokio = { version = "1.20.1", features = ["full"] }
3933
tokio-stream = "0.1.8"
4034
tower-http = { version = "0.3.0", features = ["cors"] }
41-
tracing-subscriber = { version = "0.3.15", features = ["env-filter"] }
35+
tracing = "0.1"
36+
tracing-subscriber = { version = "0.3.15", features = ["env-filter"] }

rust_dev_preview/examples/dynamodb/src/scenario/list.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,8 @@ mod test_list_more_tables {
119119
async fn test_list_tables_iterative() {
120120
let client = aws_sdk_dynamodb::Client::from_conf(
121121
sdk_examples_test_utils::client_config!(aws_sdk_dynamodb)
122-
.http_connector(aws_smithy_client::test_connection::TestConnection::new(
123-
vec![
122+
.http_client(
123+
aws_smithy_runtime::client::http::test_util::StaticReplayClient::new(vec![
124124
test_event!(
125125
"",
126126
(
@@ -136,8 +136,8 @@ mod test_list_more_tables {
136136
)
137137
),
138138
test_event!("", (200, r#"{"TableNames":["g","h"]}"#)),
139-
],
140-
))
139+
]),
140+
)
141141
.build(),
142142
);
143143

rust_dev_preview/examples/s3/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ aws-smithy-client = { git = "https://github.com/awslabs/aws-sdk-rust", branch =
3030
"test-util",
3131
] }
3232
aws-smithy-http = { git = "https://github.com/awslabs/aws-sdk-rust", branch = "next", features = ["rt-tokio"] }
33+
aws-smithy-runtime = { git = "https://github.com/awslabs/aws-sdk-rust", branch = "next" }
3334
aws-smithy-types = { git = "https://github.com/awslabs/aws-sdk-rust", branch = "next" }
3435
sdk-examples-test-utils = { path = "../../test-utils" }
3536
bytes = "1.4.0"

0 commit comments

Comments
 (0)