diff --git a/src/dynamodb_local/mod.rs b/src/dynamodb_local/mod.rs index 0dab94b..f53925e 100644 --- a/src/dynamodb_local/mod.rs +++ b/src/dynamodb_local/mod.rs @@ -30,7 +30,7 @@ impl Image for DynamoDb { #[cfg(test)] mod tests { - use aws_config::meta::region::RegionProviderChain; + use aws_config::{meta::region::RegionProviderChain, BehaviorVersion}; use aws_sdk_dynamodb::{ config::Credentials, types::{ @@ -55,17 +55,20 @@ mod tests { let key_schema = KeySchemaElement::builder() .attribute_name("title".to_string()) .key_type(KeyType::Hash) - .build(); + .build() + .unwrap(); let attribute_def = AttributeDefinition::builder() .attribute_name("title".to_string()) .attribute_type(ScalarAttributeType::S) - .build(); + .build() + .unwrap(); let provisioned_throughput = ProvisionedThroughput::builder() .read_capacity_units(10) .write_capacity_units(5) - .build(); + .build() + .unwrap(); let dynamodb = build_dynamodb_client(host_port).await; let create_table_result = dynamodb @@ -81,7 +84,7 @@ mod tests { let req = dynamodb.list_tables().limit(10); let list_tables_result = req.send().await.unwrap(); - assert_eq!(list_tables_result.table_names().unwrap().len(), 1); + assert_eq!(list_tables_result.table_names().len(), 1); } async fn build_dynamodb_client(host_port: u16) -> Client { @@ -89,7 +92,7 @@ mod tests { let region_provider = RegionProviderChain::default_provider().or_else("us-east-1"); let creds = Credentials::new("fakeKey", "fakeSecret", None, None, "test"); - let shared_config = aws_config::from_env() + let shared_config = aws_config::defaults(BehaviorVersion::latest()) .region(region_provider) .endpoint_url(endpoint_uri) .credentials_provider(creds) diff --git a/src/elasticmq/mod.rs b/src/elasticmq/mod.rs index 4528020..85e0a94 100644 --- a/src/elasticmq/mod.rs +++ b/src/elasticmq/mod.rs @@ -24,7 +24,7 @@ impl Image for ElasticMq { #[cfg(test)] mod tests { - use aws_config::meta::region::RegionProviderChain; + use aws_config::{meta::region::RegionProviderChain, BehaviorVersion}; use aws_sdk_sqs::{config::Credentials, Client}; use testcontainers::clients; @@ -46,7 +46,7 @@ mod tests { let region_provider = RegionProviderChain::default_provider().or_else("us-east-1"); let creds = Credentials::new("fakeKey", "fakeSecret", None, None, "test"); - let shared_config = aws_config::from_env() + let shared_config = aws_config::defaults(BehaviorVersion::latest()) .region(region_provider) .endpoint_url(endpoint_uri) .credentials_provider(creds) diff --git a/src/minio/mod.rs b/src/minio/mod.rs index 6f36132..3a32af5 100644 --- a/src/minio/mod.rs +++ b/src/minio/mod.rs @@ -81,7 +81,7 @@ impl Image for MinIO { #[cfg(test)] mod tests { - use aws_config::meta::region::RegionProviderChain; + use aws_config::{meta::region::RegionProviderChain, BehaviorVersion}; use aws_sdk_s3::{config::Credentials, Client}; use testcontainers::clients; @@ -123,7 +123,7 @@ mod tests { let creds = Credentials::new("minioadmin", "minioadmin", None, None, "test"); // Default MinIO credentials (Can be overridden by ENV container variables) - let shared_config = aws_config::from_env() + let shared_config = aws_config::defaults(BehaviorVersion::latest()) .region(region_provider) .endpoint_url(endpoint_uri) .credentials_provider(creds)