Skip to content

Commit

Permalink
fix: breaking changes
Browse files Browse the repository at this point in the history
  • Loading branch information
DDtKey committed Nov 23, 2023
1 parent 4b68367 commit 8161cc8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
15 changes: 9 additions & 6 deletions src/dynamodb_local/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::{
Expand All @@ -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
Expand All @@ -81,15 +84,15 @@ 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 {
let endpoint_uri = format!("http://127.0.0.1:{host_port}");
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)
Expand Down
4 changes: 2 additions & 2 deletions src/elasticmq/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions src/minio/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 8161cc8

Please sign in to comment.