---
applies_to:
- client
- aws-sdk-rust
authors:
- aajtodd
references:
  - smithy-rs#4074
  - smithy-rs#3926
breaking: false
new_feature: true
bug_fix: true
---
Promote `aws-smithy-mocks-experimental` to `aws-smithy-mocks`. This crate is now a recommended tool for testing
generated SDK clients. This release includes several fixes as well as a new sequence builder API that can be
used to test more complex scenarios such as retries.

```rust
use aws_sdk_s3::operation::get_object::GetObjectOutput;
use aws_sdk_s3::config::retry::RetryConfig;
use aws_smithy_types::byte_stream::ByteStream;
use aws_smithy_mocks::{mock, mock_client, RuleMode};

#[tokio::test]
async fn test_retry_behavior() {
    // Create a rule that returns 503 twice, then succeeds
    let retry_rule = mock!(aws_sdk_s3::Client::get_object)
        .sequence()
        .http_status(503, None)
        .times(2)                                            // Return 503 HTTP status twice
        .output(|| GetObjectOutput::builder()                // Finally return a successful output
            .body(ByteStream::from_static(b"success"))
            .build())
        .build();

    // Create a mocked client with the rule
    let s3 = mock_client!(
        aws_sdk_s3,
        RuleMode::Sequential,
        [&retry_rule],
        |client_builder| {
            client_builder.retry_config(RetryConfig::standard().with_max_attempts(3))
        }
    );

    // This should succeed after two retries
    let result = s3
        .get_object()
        .bucket("test-bucket")
        .key("test-key")
        .send()
        .await
        .expect("success after retries");

    // Verify the response
    let data = result.body.collect().await.expect("successful read").to_vec();
    assert_eq!(data, b"success");

    // Verify all responses were used
    assert_eq!(retry_rule.num_calls(), 3);
}
```
