AWS SDK

AWS SDK

rev. 94f0eaf10b3c815f4addb1b170a9f93d7a15c7b3

Files changed:

tmp-codegen-diff/aws-sdk/sdk/aws-smithy-mocks/Cargo.toml

@@ -1,1 +34,34 @@
    1      1   
# Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
[package]
    3      3   
name = "aws-smithy-mocks"
    4         -
version = "0.1.2"
           4  +
version = "0.2.0"
    5      5   
authors = ["AWS Rust SDK Team <aws-sdk-rust@amazon.com>"]
    6      6   
description = "Testing utilities for smithy-rs generated clients"
    7      7   
edition = "2021"
    8      8   
license = "Apache-2.0"
    9      9   
repository = "https://github.com/smithy-lang/smithy-rs"
   10     10   
[package.metadata.docs.rs]
   11     11   
all-features = true
   12     12   
targets = ["x86_64-unknown-linux-gnu"]
   13     13   
cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"]
   14     14   
rustdoc-args = ["--cfg", "docsrs"]

tmp-codegen-diff/aws-sdk/sdk/aws-smithy-mocks/README.md

@@ -1,1 +46,70 @@
    7      7   
without mocking the entire client or using traits.
    8      8   
    9      9   
## Key Features
   10     10   
   11     11   
- **Simple API**: Create mock rules with a fluent API using the [`mock!`] macro
   12     12   
- **Flexible Response Types**: Return modeled outputs, errors, or raw HTTP responses
   13     13   
- **Request Matching**: Match requests based on their properties
   14     14   
- **Response Sequencing**: Define sequences of responses for testing retry behavior
   15     15   
- **Rule Modes**: Control how rules are matched and applied
   16     16   
          17  +
## Prerequisites
          18  +
          19  +
<div class="warning">
          20  +
You must enable the `test-util` feature of the service client crate in order to use the `mock_client` macro.
          21  +
</div>
          22  +
          23  +
If the feature is not enabled a compilation error similar to the following will occur:
          24  +
          25  +
```
          26  +
no method named with_test_defaults found for struct <service-client-crate>::config::Builder in the current scope
          27  +
method not found in Builder
          28  +
```
          29  +
          30  +
Example `Cargo.toml` using the `aws-sdk-s3` crate as the service client crate under test:
          31  +
          32  +
```toml
          33  +
[dependencies]
          34  +
aws-sdk-s3 = "1"
          35  +
          36  +
[test-dependencies]
          37  +
aws-smithy-mocks = "0.2"
          38  +
aws-sdk-s3 = { version = "1", features = ["test-util"] }
          39  +
```
          40  +
   17     41   
## Basic Usage
   18     42   
   19     43   
```rust,ignore
   20     44   
use aws_sdk_s3::operation::get_object::GetObjectOutput;
   21     45   
use aws_sdk_s3::Client;
   22     46   
use aws_smithy_types::byte_stream::ByteStream;
   23     47   
use aws_smithy_mocks::{mock, mock_client};
   24     48   
   25     49   
#[tokio::test]
   26     50   
async fn test_s3_get_object() {

tmp-codegen-diff/aws-sdk/sdk/aws-smithy-mocks/src/lib.rs

@@ -50,50 +109,112 @@
   70     70   
                || $operation(todo!()).send(),
   71     71   
            )
   72     72   
        }
   73     73   
    };
   74     74   
}
   75     75   
   76     76   
// This could be obviated by a reasonable trait, since you can express it with SdkConfig if clients implement From<&SdkConfig>.
   77     77   
   78     78   
/// `mock_client!` macro produces a Client configured with a number of Rules and appropriate test default configuration.
   79     79   
///
          80  +
/// ## Prerequisites
          81  +
/// You must enable the `test-util` feature of the service client crate in order to use the `mock_client` macro.
          82  +
///
   80     83   
/// # Examples
   81     84   
///
   82     85   
/// **Create a client that uses a mock failure and then a success**:
   83     86   
///
   84     87   
/// ```rust,ignore
   85     88   
/// use aws_sdk_s3::operation::get_object::{GetObjectOutput, GetObjectError};
   86     89   
/// use aws_sdk_s3::types::error::NoSuchKey;
   87     90   
/// use aws_sdk_s3::Client;
   88     91   
/// use aws_smithy_types::byte_stream::ByteStream;
   89     92   
/// use aws_smithy_mocks::{mock_client, mock, RuleMode};
@@ -116,119 +153,155 @@
  136    139   
  137    140   
        // Allow callers to avoid explicitly specifying the type
  138    141   
        fn coerce<T: Fn($aws_crate::config::Builder) -> $aws_crate::config::Builder>(f: T) -> T {
  139    142   
            f
  140    143   
        }
  141    144   
  142    145   
        $aws_crate::client::Client::from_conf(
  143    146   
            coerce($additional_configuration)(
  144    147   
                $aws_crate::config::Config::builder()
  145    148   
                    .with_test_defaults()
  146         -
                    .region($aws_crate::config::Region::from_static("us-east-1"))
  147    149   
                    .http_client(mock_http_client)
  148    150   
                    .interceptor(mock_response_interceptor),
  149    151   
            )
  150    152   
            .build(),
  151    153   
        )
  152    154   
    }};
  153    155   
}

tmp-codegen-diff/aws-sdk/sdk/bedrockruntime/src/config.rs

@@ -1252,1252 +1311,1314 @@
 1272   1272   
    #[cfg(any(feature = "test-util", test))]
 1273   1273   
    #[allow(unused_mut)]
 1274   1274   
    /// Apply test defaults to the builder
 1275   1275   
    pub fn apply_test_defaults(&mut self) -> &mut Self {
 1276   1276   
        self.set_idempotency_token_provider(Some("00000000-0000-4000-8000-000000000000".into()));
 1277   1277   
        self.set_time_source(::std::option::Option::Some(::aws_smithy_async::time::SharedTimeSource::new(
 1278   1278   
            ::aws_smithy_async::time::StaticTimeSource::new(::std::time::UNIX_EPOCH + ::std::time::Duration::from_secs(1234567890)),
 1279   1279   
        )));
 1280   1280   
        self.config.store_put(::aws_runtime::user_agent::AwsUserAgent::for_tests());
 1281   1281   
        self.set_token_provider(Some(crate::config::SharedTokenProvider::new(::aws_credential_types::Token::for_tests())));
        1282  +
        if self.config.load::<crate::config::Region>().is_none() {
        1283  +
            self.set_region(::std::option::Option::Some(crate::config::Region::new("us-east-1")));
        1284  +
        }
 1282   1285   
        self.set_credentials_provider(Some(crate::config::SharedCredentialsProvider::new(
 1283   1286   
            ::aws_credential_types::Credentials::for_tests(),
 1284   1287   
        )));
 1285   1288   
        self.behavior_version = ::std::option::Option::Some(crate::config::BehaviorVersion::latest());
 1286   1289   
        self
 1287   1290   
    }
 1288   1291   
    #[cfg(any(feature = "test-util", test))]
 1289   1292   
    #[allow(unused_mut)]
 1290   1293   
    /// Apply test defaults to the builder
 1291   1294   
    pub fn with_test_defaults(mut self) -> Self {

tmp-codegen-diff/aws-sdk/sdk/cloudwatchlogs/src/config.rs

@@ -1206,1206 +1265,1268 @@
 1226   1226   
    }
 1227   1227   
    #[cfg(any(feature = "test-util", test))]
 1228   1228   
    #[allow(unused_mut)]
 1229   1229   
    /// Apply test defaults to the builder
 1230   1230   
    pub fn apply_test_defaults(&mut self) -> &mut Self {
 1231   1231   
        self.set_idempotency_token_provider(Some("00000000-0000-4000-8000-000000000000".into()));
 1232   1232   
        self.set_time_source(::std::option::Option::Some(::aws_smithy_async::time::SharedTimeSource::new(
 1233   1233   
            ::aws_smithy_async::time::StaticTimeSource::new(::std::time::UNIX_EPOCH + ::std::time::Duration::from_secs(1234567890)),
 1234   1234   
        )));
 1235   1235   
        self.config.store_put(::aws_runtime::user_agent::AwsUserAgent::for_tests());
        1236  +
        if self.config.load::<crate::config::Region>().is_none() {
        1237  +
            self.set_region(::std::option::Option::Some(crate::config::Region::new("us-east-1")));
        1238  +
        }
 1236   1239   
        self.set_credentials_provider(Some(crate::config::SharedCredentialsProvider::new(
 1237   1240   
            ::aws_credential_types::Credentials::for_tests(),
 1238   1241   
        )));
 1239   1242   
        self.behavior_version = ::std::option::Option::Some(crate::config::BehaviorVersion::latest());
 1240   1243   
        self
 1241   1244   
    }
 1242   1245   
    #[cfg(any(feature = "test-util", test))]
 1243   1246   
    #[allow(unused_mut)]
 1244   1247   
    /// Apply test defaults to the builder
 1245   1248   
    pub fn with_test_defaults(mut self) -> Self {

tmp-codegen-diff/aws-sdk/sdk/codecatalyst/src/config.rs

@@ -1212,1212 +1271,1274 @@
 1232   1232   
    #[cfg(any(feature = "test-util", test))]
 1233   1233   
    #[allow(unused_mut)]
 1234   1234   
    /// Apply test defaults to the builder
 1235   1235   
    pub fn apply_test_defaults(&mut self) -> &mut Self {
 1236   1236   
        self.set_idempotency_token_provider(Some("00000000-0000-4000-8000-000000000000".into()));
 1237   1237   
        self.set_time_source(::std::option::Option::Some(::aws_smithy_async::time::SharedTimeSource::new(
 1238   1238   
            ::aws_smithy_async::time::StaticTimeSource::new(::std::time::UNIX_EPOCH + ::std::time::Duration::from_secs(1234567890)),
 1239   1239   
        )));
 1240   1240   
        self.config.store_put(::aws_runtime::user_agent::AwsUserAgent::for_tests());
 1241   1241   
        self.set_token_provider(Some(crate::config::SharedTokenProvider::new(::aws_credential_types::Token::for_tests())));
        1242  +
        if self.config.load::<crate::config::Region>().is_none() {
        1243  +
            self.set_region(::std::option::Option::Some(crate::config::Region::new("us-east-1")));
        1244  +
        }
 1242   1245   
        self.behavior_version = ::std::option::Option::Some(crate::config::BehaviorVersion::latest());
 1243   1246   
        self
 1244   1247   
    }
 1245   1248   
    #[cfg(any(feature = "test-util", test))]
 1246   1249   
    #[allow(unused_mut)]
 1247   1250   
    /// Apply test defaults to the builder
 1248   1251   
    pub fn with_test_defaults(mut self) -> Self {
 1249   1252   
        self.apply_test_defaults();
 1250   1253   
        self
 1251   1254   
    }

tmp-codegen-diff/aws-sdk/sdk/config/src/config.rs

@@ -1189,1189 +1248,1251 @@
 1209   1209   
        self
 1210   1210   
    }
 1211   1211   
    #[cfg(any(feature = "test-util", test))]
 1212   1212   
    #[allow(unused_mut)]
 1213   1213   
    /// Apply test defaults to the builder
 1214   1214   
    pub fn apply_test_defaults(&mut self) -> &mut Self {
 1215   1215   
        self.set_time_source(::std::option::Option::Some(::aws_smithy_async::time::SharedTimeSource::new(
 1216   1216   
            ::aws_smithy_async::time::StaticTimeSource::new(::std::time::UNIX_EPOCH + ::std::time::Duration::from_secs(1234567890)),
 1217   1217   
        )));
 1218   1218   
        self.config.store_put(::aws_runtime::user_agent::AwsUserAgent::for_tests());
        1219  +
        if self.config.load::<crate::config::Region>().is_none() {
        1220  +
            self.set_region(::std::option::Option::Some(crate::config::Region::new("us-east-1")));
        1221  +
        }
 1219   1222   
        self.set_credentials_provider(Some(crate::config::SharedCredentialsProvider::new(
 1220   1223   
            ::aws_credential_types::Credentials::for_tests(),
 1221   1224   
        )));
 1222   1225   
        self.behavior_version = ::std::option::Option::Some(crate::config::BehaviorVersion::latest());
 1223   1226   
        self
 1224   1227   
    }
 1225   1228   
    #[cfg(any(feature = "test-util", test))]
 1226   1229   
    #[allow(unused_mut)]
 1227   1230   
    /// Apply test defaults to the builder
 1228   1231   
    pub fn with_test_defaults(mut self) -> Self {

tmp-codegen-diff/aws-sdk/sdk/dynamodb/src/config.rs

@@ -1220,1220 +1279,1282 @@
 1240   1240   
    }
 1241   1241   
    #[cfg(any(feature = "test-util", test))]
 1242   1242   
    #[allow(unused_mut)]
 1243   1243   
    /// Apply test defaults to the builder
 1244   1244   
    pub fn apply_test_defaults(&mut self) -> &mut Self {
 1245   1245   
        self.set_idempotency_token_provider(Some("00000000-0000-4000-8000-000000000000".into()));
 1246   1246   
        self.set_time_source(::std::option::Option::Some(::aws_smithy_async::time::SharedTimeSource::new(
 1247   1247   
            ::aws_smithy_async::time::StaticTimeSource::new(::std::time::UNIX_EPOCH + ::std::time::Duration::from_secs(1234567890)),
 1248   1248   
        )));
 1249   1249   
        self.config.store_put(::aws_runtime::user_agent::AwsUserAgent::for_tests());
        1250  +
        if self.config.load::<crate::config::Region>().is_none() {
        1251  +
            self.set_region(::std::option::Option::Some(crate::config::Region::new("us-east-1")));
        1252  +
        }
 1250   1253   
        self.set_credentials_provider(Some(crate::config::SharedCredentialsProvider::new(
 1251   1254   
            ::aws_credential_types::Credentials::for_tests(),
 1252   1255   
        )));
 1253   1256   
        self.behavior_version = ::std::option::Option::Some(crate::config::BehaviorVersion::latest());
 1254   1257   
        self
 1255   1258   
    }
 1256   1259   
    #[cfg(any(feature = "test-util", test))]
 1257   1260   
    #[allow(unused_mut)]
 1258   1261   
    /// Apply test defaults to the builder
 1259   1262   
    pub fn with_test_defaults(mut self) -> Self {

tmp-codegen-diff/aws-sdk/sdk/ec2/src/config.rs

@@ -1206,1206 +1265,1268 @@
 1226   1226   
    }
 1227   1227   
    #[cfg(any(feature = "test-util", test))]
 1228   1228   
    #[allow(unused_mut)]
 1229   1229   
    /// Apply test defaults to the builder
 1230   1230   
    pub fn apply_test_defaults(&mut self) -> &mut Self {
 1231   1231   
        self.set_idempotency_token_provider(Some("00000000-0000-4000-8000-000000000000".into()));
 1232   1232   
        self.set_time_source(::std::option::Option::Some(::aws_smithy_async::time::SharedTimeSource::new(
 1233   1233   
            ::aws_smithy_async::time::StaticTimeSource::new(::std::time::UNIX_EPOCH + ::std::time::Duration::from_secs(1234567890)),
 1234   1234   
        )));
 1235   1235   
        self.config.store_put(::aws_runtime::user_agent::AwsUserAgent::for_tests());
        1236  +
        if self.config.load::<crate::config::Region>().is_none() {
        1237  +
            self.set_region(::std::option::Option::Some(crate::config::Region::new("us-east-1")));
        1238  +
        }
 1236   1239   
        self.set_credentials_provider(Some(crate::config::SharedCredentialsProvider::new(
 1237   1240   
            ::aws_credential_types::Credentials::for_tests(),
 1238   1241   
        )));
 1239   1242   
        self.behavior_version = ::std::option::Option::Some(crate::config::BehaviorVersion::latest());
 1240   1243   
        self
 1241   1244   
    }
 1242   1245   
    #[cfg(any(feature = "test-util", test))]
 1243   1246   
    #[allow(unused_mut)]
 1244   1247   
    /// Apply test defaults to the builder
 1245   1248   
    pub fn with_test_defaults(mut self) -> Self {

tmp-codegen-diff/aws-sdk/sdk/ecs/src/config.rs

@@ -1206,1206 +1265,1268 @@
 1226   1226   
    }
 1227   1227   
    #[cfg(any(feature = "test-util", test))]
 1228   1228   
    #[allow(unused_mut)]
 1229   1229   
    /// Apply test defaults to the builder
 1230   1230   
    pub fn apply_test_defaults(&mut self) -> &mut Self {
 1231   1231   
        self.set_idempotency_token_provider(Some("00000000-0000-4000-8000-000000000000".into()));
 1232   1232   
        self.set_time_source(::std::option::Option::Some(::aws_smithy_async::time::SharedTimeSource::new(
 1233   1233   
            ::aws_smithy_async::time::StaticTimeSource::new(::std::time::UNIX_EPOCH + ::std::time::Duration::from_secs(1234567890)),
 1234   1234   
        )));
 1235   1235   
        self.config.store_put(::aws_runtime::user_agent::AwsUserAgent::for_tests());
        1236  +
        if self.config.load::<crate::config::Region>().is_none() {
        1237  +
            self.set_region(::std::option::Option::Some(crate::config::Region::new("us-east-1")));
        1238  +
        }
 1236   1239   
        self.set_credentials_provider(Some(crate::config::SharedCredentialsProvider::new(
 1237   1240   
            ::aws_credential_types::Credentials::for_tests(),
 1238   1241   
        )));
 1239   1242   
        self.behavior_version = ::std::option::Option::Some(crate::config::BehaviorVersion::latest());
 1240   1243   
        self
 1241   1244   
    }
 1242   1245   
    #[cfg(any(feature = "test-util", test))]
 1243   1246   
    #[allow(unused_mut)]
 1244   1247   
    /// Apply test defaults to the builder
 1245   1248   
    pub fn with_test_defaults(mut self) -> Self {

tmp-codegen-diff/aws-sdk/sdk/glacier/src/config.rs

@@ -1189,1189 +1248,1251 @@
 1209   1209   
        self
 1210   1210   
    }
 1211   1211   
    #[cfg(any(feature = "test-util", test))]
 1212   1212   
    #[allow(unused_mut)]
 1213   1213   
    /// Apply test defaults to the builder
 1214   1214   
    pub fn apply_test_defaults(&mut self) -> &mut Self {
 1215   1215   
        self.set_time_source(::std::option::Option::Some(::aws_smithy_async::time::SharedTimeSource::new(
 1216   1216   
            ::aws_smithy_async::time::StaticTimeSource::new(::std::time::UNIX_EPOCH + ::std::time::Duration::from_secs(1234567890)),
 1217   1217   
        )));
 1218   1218   
        self.config.store_put(::aws_runtime::user_agent::AwsUserAgent::for_tests());
        1219  +
        if self.config.load::<crate::config::Region>().is_none() {
        1220  +
            self.set_region(::std::option::Option::Some(crate::config::Region::new("us-east-1")));
        1221  +
        }
 1219   1222   
        self.set_credentials_provider(Some(crate::config::SharedCredentialsProvider::new(
 1220   1223   
            ::aws_credential_types::Credentials::for_tests(),
 1221   1224   
        )));
 1222   1225   
        self.behavior_version = ::std::option::Option::Some(crate::config::BehaviorVersion::latest());
 1223   1226   
        self
 1224   1227   
    }
 1225   1228   
    #[cfg(any(feature = "test-util", test))]
 1226   1229   
    #[allow(unused_mut)]
 1227   1230   
    /// Apply test defaults to the builder
 1228   1231   
    pub fn with_test_defaults(mut self) -> Self {

tmp-codegen-diff/aws-sdk/sdk/iam/src/config.rs

@@ -1189,1189 +1248,1251 @@
 1209   1209   
        self
 1210   1210   
    }
 1211   1211   
    #[cfg(any(feature = "test-util", test))]
 1212   1212   
    #[allow(unused_mut)]
 1213   1213   
    /// Apply test defaults to the builder
 1214   1214   
    pub fn apply_test_defaults(&mut self) -> &mut Self {
 1215   1215   
        self.set_time_source(::std::option::Option::Some(::aws_smithy_async::time::SharedTimeSource::new(
 1216   1216   
            ::aws_smithy_async::time::StaticTimeSource::new(::std::time::UNIX_EPOCH + ::std::time::Duration::from_secs(1234567890)),
 1217   1217   
        )));
 1218   1218   
        self.config.store_put(::aws_runtime::user_agent::AwsUserAgent::for_tests());
        1219  +
        if self.config.load::<crate::config::Region>().is_none() {
        1220  +
            self.set_region(::std::option::Option::Some(crate::config::Region::new("us-east-1")));
        1221  +
        }
 1219   1222   
        self.set_credentials_provider(Some(crate::config::SharedCredentialsProvider::new(
 1220   1223   
            ::aws_credential_types::Credentials::for_tests(),
 1221   1224   
        )));
 1222   1225   
        self.behavior_version = ::std::option::Option::Some(crate::config::BehaviorVersion::latest());
 1223   1226   
        self
 1224   1227   
    }
 1225   1228   
    #[cfg(any(feature = "test-util", test))]
 1226   1229   
    #[allow(unused_mut)]
 1227   1230   
    /// Apply test defaults to the builder
 1228   1231   
    pub fn with_test_defaults(mut self) -> Self {

tmp-codegen-diff/aws-sdk/sdk/kms/src/config.rs

@@ -1189,1189 +1248,1251 @@
 1209   1209   
        self
 1210   1210   
    }
 1211   1211   
    #[cfg(any(feature = "test-util", test))]
 1212   1212   
    #[allow(unused_mut)]
 1213   1213   
    /// Apply test defaults to the builder
 1214   1214   
    pub fn apply_test_defaults(&mut self) -> &mut Self {
 1215   1215   
        self.set_time_source(::std::option::Option::Some(::aws_smithy_async::time::SharedTimeSource::new(
 1216   1216   
            ::aws_smithy_async::time::StaticTimeSource::new(::std::time::UNIX_EPOCH + ::std::time::Duration::from_secs(1234567890)),
 1217   1217   
        )));
 1218   1218   
        self.config.store_put(::aws_runtime::user_agent::AwsUserAgent::for_tests());
        1219  +
        if self.config.load::<crate::config::Region>().is_none() {
        1220  +
            self.set_region(::std::option::Option::Some(crate::config::Region::new("us-east-1")));
        1221  +
        }
 1219   1222   
        self.set_credentials_provider(Some(crate::config::SharedCredentialsProvider::new(
 1220   1223   
            ::aws_credential_types::Credentials::for_tests(),
 1221   1224   
        )));
 1222   1225   
        self.behavior_version = ::std::option::Option::Some(crate::config::BehaviorVersion::latest());
 1223   1226   
        self
 1224   1227   
    }
 1225   1228   
    #[cfg(any(feature = "test-util", test))]
 1226   1229   
    #[allow(unused_mut)]
 1227   1230   
    /// Apply test defaults to the builder
 1228   1231   
    pub fn with_test_defaults(mut self) -> Self {

tmp-codegen-diff/aws-sdk/sdk/lambda/src/config.rs

@@ -1189,1189 +1248,1251 @@
 1209   1209   
        self
 1210   1210   
    }
 1211   1211   
    #[cfg(any(feature = "test-util", test))]
 1212   1212   
    #[allow(unused_mut)]
 1213   1213   
    /// Apply test defaults to the builder
 1214   1214   
    pub fn apply_test_defaults(&mut self) -> &mut Self {
 1215   1215   
        self.set_time_source(::std::option::Option::Some(::aws_smithy_async::time::SharedTimeSource::new(
 1216   1216   
            ::aws_smithy_async::time::StaticTimeSource::new(::std::time::UNIX_EPOCH + ::std::time::Duration::from_secs(1234567890)),
 1217   1217   
        )));
 1218   1218   
        self.config.store_put(::aws_runtime::user_agent::AwsUserAgent::for_tests());
        1219  +
        if self.config.load::<crate::config::Region>().is_none() {
        1220  +
            self.set_region(::std::option::Option::Some(crate::config::Region::new("us-east-1")));
        1221  +
        }
 1219   1222   
        self.set_credentials_provider(Some(crate::config::SharedCredentialsProvider::new(
 1220   1223   
            ::aws_credential_types::Credentials::for_tests(),
 1221   1224   
        )));
 1222   1225   
        self.behavior_version = ::std::option::Option::Some(crate::config::BehaviorVersion::latest());
 1223   1226   
        self
 1224   1227   
    }
 1225   1228   
    #[cfg(any(feature = "test-util", test))]
 1226   1229   
    #[allow(unused_mut)]
 1227   1230   
    /// Apply test defaults to the builder
 1228   1231   
    pub fn with_test_defaults(mut self) -> Self {

tmp-codegen-diff/aws-sdk/sdk/polly/src/config.rs

@@ -1189,1189 +1248,1251 @@
 1209   1209   
        self
 1210   1210   
    }
 1211   1211   
    #[cfg(any(feature = "test-util", test))]
 1212   1212   
    #[allow(unused_mut)]
 1213   1213   
    /// Apply test defaults to the builder
 1214   1214   
    pub fn apply_test_defaults(&mut self) -> &mut Self {
 1215   1215   
        self.set_time_source(::std::option::Option::Some(::aws_smithy_async::time::SharedTimeSource::new(
 1216   1216   
            ::aws_smithy_async::time::StaticTimeSource::new(::std::time::UNIX_EPOCH + ::std::time::Duration::from_secs(1234567890)),
 1217   1217   
        )));
 1218   1218   
        self.config.store_put(::aws_runtime::user_agent::AwsUserAgent::for_tests());
        1219  +
        if self.config.load::<crate::config::Region>().is_none() {
        1220  +
            self.set_region(::std::option::Option::Some(crate::config::Region::new("us-east-1")));
        1221  +
        }
 1219   1222   
        self.set_credentials_provider(Some(crate::config::SharedCredentialsProvider::new(
 1220   1223   
            ::aws_credential_types::Credentials::for_tests(),
 1221   1224   
        )));
 1222   1225   
        self.behavior_version = ::std::option::Option::Some(crate::config::BehaviorVersion::latest());
 1223   1226   
        self
 1224   1227   
    }
 1225   1228   
    #[cfg(any(feature = "test-util", test))]
 1226   1229   
    #[allow(unused_mut)]
 1227   1230   
    /// Apply test defaults to the builder
 1228   1231   
    pub fn with_test_defaults(mut self) -> Self {