Client Test

Client Test

rev. ce76c569583a3fdee1e9d39e082a8d5efd7b13b7 (ignoring whitespace)

Files changed:

tmp-codegen-diff/codegen-client-test/rest_json_extras/rust-client-codegen/src/operation/primitive_int_op.rs

@@ -191,191 +279,280 @@
  211    211   
        let params = crate::config::endpoint::Params::builder().build().map_err(|err| {
  212    212   
            ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
  213    213   
        })?;
  214    214   
        cfg.interceptor_state()
  215    215   
            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
  216    216   
        ::std::result::Result::Ok(())
  217    217   
    }
  218    218   
}
  219    219   
#[allow(unreachable_code, unused_variables)]
  220    220   
#[cfg(test)]
  221         -
mod primitive_int_op_request_test {
         221  +
mod primitive_int_op_test {
         222  +
  222    223   
    /// Primitive ints should not be serialized when they are unset
  223    224   
    /// Test ID: SerPrimitiveInt
  224    225   
    #[::tokio::test]
  225         -
    #[allow(unused_mut)]
         226  +
    #[::tracing_test::traced_test]
  226    227   
    async fn ser_primitive_int_request() {
  227    228   
        let (http_client, request_receiver) = ::aws_smithy_runtime::client::http::test_util::capture_request(None);
  228    229   
        let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
  229    230   
  230    231   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  231    232   
        let result = client.primitive_int_op().send().await;
  232    233   
        let _ = dbg!(result);
  233    234   
        let http_request = request_receiver.expect_request();
  234    235   
        let expected_headers = [("Content-Type", "application/json")];
  235    236   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
  236    237   
        let body = http_request.body().bytes().expect("body should be strict");
  237    238   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
  238    239   
            body,
  239    240   
            "{}",
  240    241   
            ::aws_smithy_protocol_test::MediaType::from("unknown"),
  241    242   
        ));
  242    243   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  243    244   
        ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
  244    245   
        ::pretty_assertions::assert_eq!(uri.path(), "/primitive-document", "path was incorrect");
  245    246   
    }
  246    247   
    /// Upper case error modeled lower case
  247    248   
    /// Test ID: ServiceLevelErrorClient
  248    249   
    #[::tokio::test]
  249         -
    #[allow(unused_mut)]
         250  +
    #[::tracing_test::traced_test]
  250    251   
    async fn service_level_error_client_response() {
  251    252   
        let expected_output = crate::types::error::ExtraError::builder().build();
  252    253   
        let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
  253    254   
            ::http::response::Builder::new()
  254    255   
                .header("X-Amzn-Errortype", "ExtraError")
  255    256   
                .status(500)
  256    257   
                .body(::aws_smithy_types::body::SdkBody::from(""))
  257    258   
                .unwrap(),
  258    259   
        )
  259    260   
        .unwrap();

tmp-codegen-diff/codegen-client-test/rest_json_extras/rust-client-codegen/src/operation/query_precedence.rs

@@ -210,210 +373,374 @@
  230    230   
        let params = crate::config::endpoint::Params::builder().build().map_err(|err| {
  231    231   
            ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
  232    232   
        })?;
  233    233   
        cfg.interceptor_state()
  234    234   
            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
  235    235   
        ::std::result::Result::Ok(())
  236    236   
    }
  237    237   
}
  238    238   
#[allow(unreachable_code, unused_variables)]
  239    239   
#[cfg(test)]
  240         -
mod query_precedence_request_test {
         240  +
mod query_precedence_test {
         241  +
  241    242   
    /// Keys and values must be url encoded
  242    243   
    /// Test ID: UrlParamsKeyEncoding
  243    244   
    #[::tokio::test]
  244         -
    #[allow(unused_mut)]
         245  +
    #[::tracing_test::traced_test]
  245    246   
    async fn url_params_key_encoding_request() {
  246    247   
        let (http_client, request_receiver) = ::aws_smithy_runtime::client::http::test_util::capture_request(None);
  247    248   
        let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
  248    249   
  249    250   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  250    251   
        let result = client
  251    252   
            .query_precedence()
  252    253   
            .set_foo(::std::option::Option::Some("&🐱".to_owned()))
  253    254   
            .set_baz(::std::option::Option::Some({
  254    255   
                let mut ret = ::std::collections::HashMap::new();
  255    256   
                ret.insert("hello there".to_owned(), "how's your encoding?".to_owned());
  256    257   
                ret.insert("a & b & c".to_owned(), "better encode = this".to_owned());
  257    258   
                ret
  258    259   
            }))
  259    260   
            .send()
  260    261   
            .await;
  261    262   
        let _ = dbg!(result);
  262    263   
        let http_request = request_receiver.expect_request();
  263    264   
        let expected_query_params = &[
  264    265   
            "bar=%26%F0%9F%90%B1",
  265    266   
            "hello%20there=how%27s%20your%20encoding%3F",
  266    267   
            "a%20%26%20b%20%26%20c=better%20encode%20%3D%20this",
  267    268   
        ];
  268    269   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_query_string(&http_request, expected_query_params));
  269    270   
        let body = http_request.body().bytes().expect("body should be strict");
  270    271   
        // No body
  271    272   
        ::pretty_assertions::assert_eq!(::std::str::from_utf8(body).unwrap(), "");
  272    273   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  273    274   
        ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
  274    275   
        ::pretty_assertions::assert_eq!(uri.path(), "/Precedence", "path was incorrect");
  275    276   
    }
  276    277   
    /// Prefer named query parameters when serializing
  277    278   
    /// Test ID: RestJsonQueryPrecedenceForbid
  278    279   
    #[::tokio::test]
  279         -
    #[allow(unused_mut)]
         280  +
    #[::tracing_test::traced_test]
  280    281   
    async fn rest_json_query_precedence_forbid_request() {
  281    282   
        let (http_client, request_receiver) = ::aws_smithy_runtime::client::http::test_util::capture_request(None);
  282    283   
        let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
  283    284   
  284    285   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  285    286   
        let result = client
  286    287   
            .query_precedence()
  287    288   
            .set_foo(::std::option::Option::Some("named".to_owned()))
  288    289   
            .set_baz(::std::option::Option::Some({
  289    290   
                let mut ret = ::std::collections::HashMap::new();
  290    291   
                ret.insert("bar".to_owned(), "fromMap".to_owned());
  291    292   
                ret.insert("qux".to_owned(), "alsoFromMap".to_owned());
  292    293   
                ret
  293    294   
            }))
  294    295   
            .send()
  295    296   
            .await;
  296    297   
        let _ = dbg!(result);
  297    298   
        let http_request = request_receiver.expect_request();
  298    299   
        let expected_query_params = &["bar=named", "qux=alsoFromMap"];
  299    300   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_query_string(&http_request, expected_query_params));
  300    301   
        let forbid_params = &["bar=fromMap"];
  301    302   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::forbid_query_params(&http_request, forbid_params));
  302    303   
        let body = http_request.body().bytes().expect("body should be strict");
  303    304   
        // No body
  304    305   
        ::pretty_assertions::assert_eq!(::std::str::from_utf8(body).unwrap(), "");
  305    306   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  306    307   
        ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
  307    308   
        ::pretty_assertions::assert_eq!(uri.path(), "/Precedence", "path was incorrect");
  308    309   
    }
  309    310   
    /// Prefer named query parameters when serializing
  310    311   
    /// Test ID: RestJsonQueryPrecedence
  311    312   
    #[::tokio::test]
  312         -
    #[allow(unused_mut)]
         313  +
    #[::tracing_test::traced_test]
  313    314   
    async fn rest_json_query_precedence_request() {
  314    315   
        let (http_client, request_receiver) = ::aws_smithy_runtime::client::http::test_util::capture_request(None);
  315    316   
        let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
  316    317   
  317    318   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  318    319   
        let result = client
  319    320   
            .query_precedence()
  320    321   
            .set_foo(::std::option::Option::Some("named".to_owned()))
  321    322   
            .set_baz(::std::option::Option::Some({
  322    323   
                let mut ret = ::std::collections::HashMap::new();
  323    324   
                ret.insert("bar".to_owned(), "fromMap".to_owned());
  324    325   
                ret.insert("qux".to_owned(), "alsoFromMap".to_owned());
  325    326   
                ret
  326    327   
            }))
  327    328   
            .send()
  328    329   
            .await;
  329    330   
        let _ = dbg!(result);
  330    331   
        let http_request = request_receiver.expect_request();
  331    332   
        let expected_query_params = &["bar=named", "qux=alsoFromMap"];
  332    333   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_query_string(&http_request, expected_query_params));
  333    334   
        let body = http_request.body().bytes().expect("body should be strict");
  334    335   
        // No body
  335    336   
        ::pretty_assertions::assert_eq!(::std::str::from_utf8(body).unwrap(), "");
  336    337   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  337    338   
        ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
  338    339   
        ::pretty_assertions::assert_eq!(uri.path(), "/Precedence", "path was incorrect");
  339    340   
    }
  340    341   
    /// Upper case error modeled lower case
  341    342   
    /// Test ID: ServiceLevelErrorClient
  342    343   
    #[::tokio::test]
  343         -
    #[allow(unused_mut)]
         344  +
    #[::tracing_test::traced_test]
  344    345   
    async fn service_level_error_client_response() {
  345    346   
        let expected_output = crate::types::error::ExtraError::builder().build();
  346    347   
        let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
  347    348   
            ::http::response::Builder::new()
  348    349   
                .header("X-Amzn-Errortype", "ExtraError")
  349    350   
                .status(500)
  350    351   
                .body(::aws_smithy_types::body::SdkBody::from(""))
  351    352   
                .unwrap(),
  352    353   
        )
  353    354   
        .unwrap();

tmp-codegen-diff/codegen-client-test/rest_json_extras/rust-client-codegen/src/operation/status_response.rs

@@ -187,187 +251,252 @@
  207    207   
        let params = crate::config::endpoint::Params::builder().build().map_err(|err| {
  208    208   
            ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
  209    209   
        })?;
  210    210   
        cfg.interceptor_state()
  211    211   
            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
  212    212   
        ::std::result::Result::Ok(())
  213    213   
    }
  214    214   
}
  215    215   
#[allow(unreachable_code, unused_variables)]
  216    216   
#[cfg(test)]
  217         -
mod status_response_request_test {
         217  +
mod status_response_test {
         218  +
  218    219   
    /// Upper case error modeled lower case
  219    220   
    /// Test ID: ServiceLevelErrorClient
  220    221   
    #[::tokio::test]
  221         -
    #[allow(unused_mut)]
         222  +
    #[::tracing_test::traced_test]
  222    223   
    async fn service_level_error_client_response() {
  223    224   
        let expected_output = crate::types::error::ExtraError::builder().build();
  224    225   
        let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
  225    226   
            ::http::response::Builder::new()
  226    227   
                .header("X-Amzn-Errortype", "ExtraError")
  227    228   
                .status(500)
  228    229   
                .body(::aws_smithy_types::body::SdkBody::from(""))
  229    230   
                .unwrap(),
  230    231   
        )
  231    232   
        .unwrap();

tmp-codegen-diff/codegen-client-test/rest_json_extras/rust-client-codegen/src/operation/string_payload.rs

@@ -193,193 +284,285 @@
  213    213   
        let params = crate::config::endpoint::Params::builder().build().map_err(|err| {
  214    214   
            ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
  215    215   
        })?;
  216    216   
        cfg.interceptor_state()
  217    217   
            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
  218    218   
        ::std::result::Result::Ok(())
  219    219   
    }
  220    220   
}
  221    221   
#[allow(unreachable_code, unused_variables)]
  222    222   
#[cfg(test)]
  223         -
mod string_payload_request_test {
         223  +
mod string_payload_test {
         224  +
  224    225   
    /// Test ID: StringPayload
  225    226   
    #[::tokio::test]
  226         -
    #[allow(unused_mut)]
         227  +
    #[::tracing_test::traced_test]
  227    228   
    async fn string_payload_request() {
  228    229   
        let (http_client, request_receiver) = ::aws_smithy_runtime::client::http::test_util::capture_request(None);
  229    230   
        let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
  230    231   
  231    232   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  232    233   
        let result = client
  233    234   
            .string_payload()
  234    235   
            .set_payload(::std::option::Option::Some("rawstring".to_owned()))
  235    236   
            .send()
  236    237   
            .await;
  237    238   
        let _ = dbg!(result);
  238    239   
        let http_request = request_receiver.expect_request();
  239    240   
        let expected_headers = [("Content-Type", "text/plain")];
  240    241   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
  241    242   
        let body = http_request.body().bytes().expect("body should be strict");
  242    243   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
  243    244   
            body,
  244    245   
            "rawstring",
  245    246   
            ::aws_smithy_protocol_test::MediaType::from("unknown"),
  246    247   
        ));
  247    248   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  248    249   
        ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
  249    250   
        ::pretty_assertions::assert_eq!(uri.path(), "/StringPayload", "path was incorrect");
  250    251   
    }
  251    252   
    /// Upper case error modeled lower case
  252    253   
    /// Test ID: ServiceLevelErrorClient
  253    254   
    #[::tokio::test]
  254         -
    #[allow(unused_mut)]
         255  +
    #[::tracing_test::traced_test]
  255    256   
    async fn service_level_error_client_response() {
  256    257   
        let expected_output = crate::types::error::ExtraError::builder().build();
  257    258   
        let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
  258    259   
            ::http::response::Builder::new()
  259    260   
                .header("X-Amzn-Errortype", "ExtraError")
  260    261   
                .status(500)
  261    262   
                .body(::aws_smithy_types::body::SdkBody::from(""))
  262    263   
                .unwrap(),
  263    264   
        )
  264    265   
        .unwrap();

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/Cargo.toml

@@ -23,23 +60,63 @@
   43     43   
features = ["client", "test-util"]
   44     44   
[dev-dependencies.aws-smithy-types]
   45     45   
path = "/home/build/workspace/smithy-rs/rust-runtime/aws-smithy-types"
   46     46   
[dev-dependencies.bytes]
   47     47   
version = "1.4.0"
   48     48   
[dev-dependencies.pretty_assertions]
   49     49   
version = "1.3.0"
   50     50   
[dev-dependencies.tokio]
   51     51   
version = "1.23.1"
   52     52   
features = ["macros", "test-util", "rt-multi-thread"]
          53  +
[dev-dependencies.tracing-test]
          54  +
version = "0.2.5"
          55  +
features = ["no-env-filter"]
   53     56   
[features]
   54     57   
test-util = ["aws-smithy-runtime/test-util"]
   55     58   
rt-tokio = ["aws-smithy-async/rt-tokio", "aws-smithy-types/rt-tokio"]
   56     59   
behavior-version-latest = []
   57     60   
rustls = ["aws-smithy-runtime/tls-rustls"]
   58     61   
default = ["rt-tokio", "rustls"]
   59     62   
   60     63   

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/operation/all_query_string_types.rs

@@ -356,356 +420,421 @@
  376    376   
        let params = crate::config::endpoint::Params::builder().build().map_err(|err| {
  377    377   
            ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
  378    378   
        })?;
  379    379   
        cfg.interceptor_state()
  380    380   
            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
  381    381   
        ::std::result::Result::Ok(())
  382    382   
    }
  383    383   
}
  384    384   
#[allow(unreachable_code, unused_variables)]
  385    385   
#[cfg(test)]
  386         -
mod all_query_string_types_request_test {
         386  +
mod all_query_string_types_test {
         387  +
  387    388   
    /// Serializes query string parameters with all supported types
  388    389   
    /// Test ID: AllQueryStringTypes
  389    390   
    #[::tokio::test]
  390         -
    #[allow(unused_mut)]
         391  +
    #[::tracing_test::traced_test]
  391    392   
    async fn all_query_string_types_request() {
  392    393   
        let (http_client, request_receiver) = ::aws_smithy_runtime::client::http::test_util::capture_request(None);
  393    394   
        let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
  394    395   
  395    396   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  396    397   
        let result = client
  397    398   
            .all_query_string_types()
  398    399   
            .set_query_string(::std::option::Option::Some("Hello there".to_owned()))
  399    400   
            .set_query_string_list(::std::option::Option::Some(vec!["a".to_owned(), "b".to_owned(), "c".to_owned()]))
  400    401   
            .set_query_string_set(::std::option::Option::Some(vec!["a".to_owned(), "b".to_owned(), "c".to_owned()]))
@@ -452,453 +657,658 @@
  472    473   
        let body = http_request.body().bytes().expect("body should be strict");
  473    474   
        // No body
  474    475   
        ::pretty_assertions::assert_eq!(::std::str::from_utf8(body).unwrap(), "");
  475    476   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  476    477   
        ::pretty_assertions::assert_eq!(http_request.method(), "GET", "method was incorrect");
  477    478   
        ::pretty_assertions::assert_eq!(uri.path(), "/AllQueryStringTypesInput", "path was incorrect");
  478    479   
    }
  479    480   
    /// Handles query string maps
  480    481   
    /// Test ID: RestXmlQueryStringMap
  481    482   
    #[::tokio::test]
  482         -
    #[allow(unused_mut)]
         483  +
    #[::tracing_test::traced_test]
  483    484   
    async fn rest_xml_query_string_map_request() {
  484    485   
        let (http_client, request_receiver) = ::aws_smithy_runtime::client::http::test_util::capture_request(None);
  485    486   
        let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
  486    487   
  487    488   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  488    489   
        let result = client
  489    490   
            .all_query_string_types()
  490    491   
            .set_query_params_map_of_strings(::std::option::Option::Some({
  491    492   
                let mut ret = ::std::collections::HashMap::new();
  492    493   
                ret.insert("QueryParamsStringKeyA".to_owned(), "Foo".to_owned());
  493    494   
                ret.insert("QueryParamsStringKeyB".to_owned(), "Bar".to_owned());
  494    495   
                ret
  495    496   
            }))
  496    497   
            .send()
  497    498   
            .await;
  498    499   
        let _ = dbg!(result);
  499    500   
        let http_request = request_receiver.expect_request();
  500    501   
        let expected_query_params = &["QueryParamsStringKeyA=Foo", "QueryParamsStringKeyB=Bar"];
  501    502   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_query_string(&http_request, expected_query_params));
  502    503   
        let body = http_request.body().bytes().expect("body should be strict");
  503    504   
        // No body
  504    505   
        ::pretty_assertions::assert_eq!(::std::str::from_utf8(body).unwrap(), "");
  505    506   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  506    507   
        ::pretty_assertions::assert_eq!(http_request.method(), "GET", "method was incorrect");
  507    508   
        ::pretty_assertions::assert_eq!(uri.path(), "/AllQueryStringTypesInput", "path was incorrect");
  508    509   
    }
  509    510   
    /// Handles escaping all required characters in the query string.
  510    511   
    /// Test ID: RestXmlQueryStringEscaping
  511    512   
    #[::tokio::test]
  512         -
    #[allow(unused_mut)]
         513  +
    #[::tracing_test::traced_test]
  513    514   
    async fn rest_xml_query_string_escaping_request() {
  514    515   
        let (http_client, request_receiver) = ::aws_smithy_runtime::client::http::test_util::capture_request(None);
  515    516   
        let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
  516    517   
  517    518   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  518    519   
        let result = client
  519    520   
            .all_query_string_types()
  520    521   
            .set_query_string(::std::option::Option::Some(" %:/?#[]@!$&'()*+,;=😹".to_owned()))
  521    522   
            .send()
  522    523   
            .await;
  523    524   
        let _ = dbg!(result);
  524    525   
        let http_request = request_receiver.expect_request();
  525    526   
        let expected_query_params = &["String=%20%25%3A%2F%3F%23%5B%5D%40%21%24%26%27%28%29%2A%2B%2C%3B%3D%F0%9F%98%B9"];
  526    527   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_query_string(&http_request, expected_query_params));
  527    528   
        let body = http_request.body().bytes().expect("body should be strict");
  528    529   
        // No body
  529    530   
        ::pretty_assertions::assert_eq!(::std::str::from_utf8(body).unwrap(), "");
  530    531   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  531    532   
        ::pretty_assertions::assert_eq!(http_request.method(), "GET", "method was incorrect");
  532    533   
        ::pretty_assertions::assert_eq!(uri.path(), "/AllQueryStringTypesInput", "path was incorrect");
  533    534   
    }
  534    535   
    /// Supports handling NaN float query values.
  535    536   
    /// Test ID: RestXmlSupportsNaNFloatQueryValues
  536    537   
    #[::tokio::test]
  537         -
    #[allow(unused_mut)]
         538  +
    #[::tracing_test::traced_test]
  538    539   
    async fn rest_xml_supports_na_n_float_query_values_request() {
  539    540   
        let (http_client, request_receiver) = ::aws_smithy_runtime::client::http::test_util::capture_request(None);
  540    541   
        let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
  541    542   
  542    543   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  543    544   
        let result = client
  544    545   
            .all_query_string_types()
  545    546   
            .set_query_float(::std::option::Option::Some(
  546    547   
                <f32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("NaN").expect("invalid string for number"),
  547    548   
            ))
  548    549   
            .set_query_double(::std::option::Option::Some(
  549    550   
                <f64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("NaN").expect("invalid string for number"),
  550    551   
            ))
  551    552   
            .send()
  552    553   
            .await;
  553    554   
        let _ = dbg!(result);
  554    555   
        let http_request = request_receiver.expect_request();
  555    556   
        let expected_query_params = &["Float=NaN", "Double=NaN"];
  556    557   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_query_string(&http_request, expected_query_params));
  557    558   
        let body = http_request.body().bytes().expect("body should be strict");
  558    559   
        // No body
  559    560   
        ::pretty_assertions::assert_eq!(::std::str::from_utf8(body).unwrap(), "");
  560    561   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  561    562   
        ::pretty_assertions::assert_eq!(http_request.method(), "GET", "method was incorrect");
  562    563   
        ::pretty_assertions::assert_eq!(uri.path(), "/AllQueryStringTypesInput", "path was incorrect");
  563    564   
    }
  564    565   
    /// Supports handling Infinity float query values.
  565    566   
    /// Test ID: RestXmlSupportsInfinityFloatQueryValues
  566    567   
    #[::tokio::test]
  567         -
    #[allow(unused_mut)]
         568  +
    #[::tracing_test::traced_test]
  568    569   
    async fn rest_xml_supports_infinity_float_query_values_request() {
  569    570   
        let (http_client, request_receiver) = ::aws_smithy_runtime::client::http::test_util::capture_request(None);
  570    571   
        let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
  571    572   
  572    573   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  573    574   
        let result = client
  574    575   
            .all_query_string_types()
  575    576   
            .set_query_float(::std::option::Option::Some(
  576    577   
                <f32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("Infinity").expect("invalid string for number"),
  577    578   
            ))
  578    579   
            .set_query_double(::std::option::Option::Some(
  579    580   
                <f64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("Infinity").expect("invalid string for number"),
  580    581   
            ))
  581    582   
            .send()
  582    583   
            .await;
  583    584   
        let _ = dbg!(result);
  584    585   
        let http_request = request_receiver.expect_request();
  585    586   
        let expected_query_params = &["Float=Infinity", "Double=Infinity"];
  586    587   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_query_string(&http_request, expected_query_params));
  587    588   
        let body = http_request.body().bytes().expect("body should be strict");
  588    589   
        // No body
  589    590   
        ::pretty_assertions::assert_eq!(::std::str::from_utf8(body).unwrap(), "");
  590    591   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  591    592   
        ::pretty_assertions::assert_eq!(http_request.method(), "GET", "method was incorrect");
  592    593   
        ::pretty_assertions::assert_eq!(uri.path(), "/AllQueryStringTypesInput", "path was incorrect");
  593    594   
    }
  594    595   
    /// Supports handling -Infinity float query values.
  595    596   
    /// Test ID: RestXmlSupportsNegativeInfinityFloatQueryValues
  596    597   
    #[::tokio::test]
  597         -
    #[allow(unused_mut)]
         598  +
    #[::tracing_test::traced_test]
  598    599   
    async fn rest_xml_supports_negative_infinity_float_query_values_request() {
  599    600   
        let (http_client, request_receiver) = ::aws_smithy_runtime::client::http::test_util::capture_request(None);
  600    601   
        let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
  601    602   
  602    603   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  603    604   
        let result = client
  604    605   
            .all_query_string_types()
  605    606   
            .set_query_float(::std::option::Option::Some(
  606    607   
                <f32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("-Infinity").expect("invalid string for number"),
  607    608   
            ))
  608    609   
            .set_query_double(::std::option::Option::Some(
  609    610   
                <f64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("-Infinity").expect("invalid string for number"),
  610    611   
            ))
  611    612   
            .send()
  612    613   
            .await;
  613    614   
        let _ = dbg!(result);
  614    615   
        let http_request = request_receiver.expect_request();
  615    616   
        let expected_query_params = &["Float=-Infinity", "Double=-Infinity"];
  616    617   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_query_string(&http_request, expected_query_params));
  617    618   
        let body = http_request.body().bytes().expect("body should be strict");
  618    619   
        // No body
  619    620   
        ::pretty_assertions::assert_eq!(::std::str::from_utf8(body).unwrap(), "");
  620    621   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  621    622   
        ::pretty_assertions::assert_eq!(http_request.method(), "GET", "method was incorrect");
  622    623   
        ::pretty_assertions::assert_eq!(uri.path(), "/AllQueryStringTypesInput", "path was incorrect");
  623    624   
    }
  624    625   
    /// Query values of 0 and false are serialized
  625    626   
    /// Test ID: RestXmlZeroAndFalseQueryValues
  626    627   
    #[::tokio::test]
  627         -
    #[allow(unused_mut)]
         628  +
    #[::tracing_test::traced_test]
  628    629   
    async fn rest_xml_zero_and_false_query_values_request() {
  629    630   
        let (http_client, request_receiver) = ::aws_smithy_runtime::client::http::test_util::capture_request(None);
  630    631   
        let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
  631    632   
  632    633   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  633    634   
        let result = client
  634    635   
            .all_query_string_types()
  635    636   
            .set_query_integer(::std::option::Option::Some(0))
  636    637   
            .set_query_boolean(::std::option::Option::Some(false))
  637    638   
            .send()

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/operation/body_with_xml_name.rs

@@ -191,191 +289,290 @@
  211    211   
        let params = crate::config::endpoint::Params::builder().build().map_err(|err| {
  212    212   
            ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
  213    213   
        })?;
  214    214   
        cfg.interceptor_state()
  215    215   
            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
  216    216   
        ::std::result::Result::Ok(())
  217    217   
    }
  218    218   
}
  219    219   
#[allow(unreachable_code, unused_variables)]
  220    220   
#[cfg(test)]
  221         -
mod body_with_xml_name_request_test {
         221  +
mod body_with_xml_name_test {
         222  +
  222    223   
    /// Serializes a payload using a wrapper name based on the xmlName
  223    224   
    /// Test ID: BodyWithXmlName
  224    225   
    #[::tokio::test]
  225         -
    #[allow(unused_mut)]
         226  +
    #[::tracing_test::traced_test]
  226    227   
    async fn body_with_xml_name_request() {
  227    228   
        let (http_client, request_receiver) = ::aws_smithy_runtime::client::http::test_util::capture_request(None);
  228    229   
        let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
  229    230   
  230    231   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  231    232   
        let result = client
  232    233   
            .body_with_xml_name()
  233    234   
            .set_nested(::std::option::Option::Some(
  234    235   
                crate::types::PayloadWithXmlName::builder()
  235    236   
                    .set_name(::std::option::Option::Some("Phreddy".to_owned()))
  236    237   
                    .build(),
  237    238   
            ))
  238    239   
            .send()
  239    240   
            .await;
  240    241   
        let _ = dbg!(result);
  241    242   
        let http_request = request_receiver.expect_request();
  242    243   
        let expected_headers = [("Content-Type", "application/xml")];
  243    244   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
  244    245   
        let required_headers = &["Content-Length"];
  245    246   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::require_headers(http_request.headers(), required_headers));
  246    247   
        let body = http_request.body().bytes().expect("body should be strict");
  247    248   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
  248    249   
            body,
  249    250   
            "<Ahoy><nested><name>Phreddy</name></nested></Ahoy>",
  250    251   
            ::aws_smithy_protocol_test::MediaType::from("application/xml"),
  251    252   
        ));
  252    253   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  253    254   
        ::pretty_assertions::assert_eq!(http_request.method(), "PUT", "method was incorrect");
  254    255   
        ::pretty_assertions::assert_eq!(uri.path(), "/BodyWithXmlName", "path was incorrect");
  255    256   
    }
  256    257   
    /// Serializes a payload using a wrapper name based on the xmlName
  257    258   
    /// Test ID: BodyWithXmlName
  258    259   
    #[::tokio::test]
  259         -
    #[allow(unused_mut)]
         260  +
    #[::tracing_test::traced_test]
  260    261   
    async fn body_with_xml_name_response() {
  261    262   
        let expected_output = crate::operation::body_with_xml_name::BodyWithXmlNameOutput::builder()
  262    263   
            .set_nested(::std::option::Option::Some(
  263    264   
                crate::types::PayloadWithXmlName::builder()
  264    265   
                    .set_name(::std::option::Option::Some("Phreddy".to_owned()))
  265    266   
                    .build(),
  266    267   
            ))
  267    268   
            .build();
  268    269   
        let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
  269    270   
            ::http::response::Builder::new()

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/operation/constant_and_variable_query_string.rs

@@ -214,214 +305,306 @@
  234    234   
        let params = crate::config::endpoint::Params::builder().build().map_err(|err| {
  235    235   
            ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
  236    236   
        })?;
  237    237   
        cfg.interceptor_state()
  238    238   
            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
  239    239   
        ::std::result::Result::Ok(())
  240    240   
    }
  241    241   
}
  242    242   
#[allow(unreachable_code, unused_variables)]
  243    243   
#[cfg(test)]
  244         -
mod constant_and_variable_query_string_request_test {
         244  +
mod constant_and_variable_query_string_test {
         245  +
  245    246   
    /// Mixes constant and variable query string parameters
  246    247   
    /// Test ID: ConstantAndVariableQueryStringMissingOneValue
  247    248   
    #[::tokio::test]
  248         -
    #[allow(unused_mut)]
         249  +
    #[::tracing_test::traced_test]
  249    250   
    async fn constant_and_variable_query_string_missing_one_value_request() {
  250    251   
        let (http_client, request_receiver) = ::aws_smithy_runtime::client::http::test_util::capture_request(None);
  251    252   
        let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
  252    253   
  253    254   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  254    255   
        let result = client
  255    256   
            .constant_and_variable_query_string()
  256    257   
            .set_baz(::std::option::Option::Some("bam".to_owned()))
  257    258   
            .send()
  258    259   
            .await;
  259    260   
        let _ = dbg!(result);
  260    261   
        let http_request = request_receiver.expect_request();
  261    262   
        let expected_query_params = &["foo=bar", "baz=bam"];
  262    263   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_query_string(&http_request, expected_query_params));
  263    264   
        let forbid_params = &["maybeSet"];
  264    265   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::forbid_query_params(&http_request, forbid_params));
  265    266   
        let body = http_request.body().bytes().expect("body should be strict");
  266    267   
        // No body
  267    268   
        ::pretty_assertions::assert_eq!(::std::str::from_utf8(body).unwrap(), "");
  268    269   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  269    270   
        ::pretty_assertions::assert_eq!(http_request.method(), "GET", "method was incorrect");
  270    271   
        ::pretty_assertions::assert_eq!(uri.path(), "/ConstantAndVariableQueryString", "path was incorrect");
  271    272   
    }
  272    273   
    /// Mixes constant and variable query string parameters
  273    274   
    /// Test ID: ConstantAndVariableQueryStringAllValues
  274    275   
    #[::tokio::test]
  275         -
    #[allow(unused_mut)]
         276  +
    #[::tracing_test::traced_test]
  276    277   
    async fn constant_and_variable_query_string_all_values_request() {
  277    278   
        let (http_client, request_receiver) = ::aws_smithy_runtime::client::http::test_util::capture_request(None);
  278    279   
        let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
  279    280   
  280    281   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  281    282   
        let result = client
  282    283   
            .constant_and_variable_query_string()
  283    284   
            .set_baz(::std::option::Option::Some("bam".to_owned()))
  284    285   
            .set_maybe_set(::std::option::Option::Some("yes".to_owned()))
  285    286   
            .send()

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/operation/constant_query_string.rs

@@ -214,214 +278,279 @@
  234    234   
        let params = crate::config::endpoint::Params::builder().build().map_err(|err| {
  235    235   
            ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
  236    236   
        })?;
  237    237   
        cfg.interceptor_state()
  238    238   
            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
  239    239   
        ::std::result::Result::Ok(())
  240    240   
    }
  241    241   
}
  242    242   
#[allow(unreachable_code, unused_variables)]
  243    243   
#[cfg(test)]
  244         -
mod constant_query_string_request_test {
         244  +
mod constant_query_string_test {
         245  +
  245    246   
    /// Includes constant query string parameters
  246    247   
    /// Test ID: ConstantQueryString
  247    248   
    #[::tokio::test]
  248         -
    #[allow(unused_mut)]
         249  +
    #[::tracing_test::traced_test]
  249    250   
    async fn constant_query_string_request() {
  250    251   
        let (http_client, request_receiver) = ::aws_smithy_runtime::client::http::test_util::capture_request(None);
  251    252   
        let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
  252    253   
  253    254   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  254    255   
        let result = client
  255    256   
            .constant_query_string()
  256    257   
            .set_hello(::std::option::Option::Some("hi".to_owned()))
  257    258   
            .send()
  258    259   
            .await;

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/operation/datetime_offsets.rs

@@ -187,187 +292,293 @@
  207    207   
        let params = crate::config::endpoint::Params::builder().build().map_err(|err| {
  208    208   
            ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
  209    209   
        })?;
  210    210   
        cfg.interceptor_state()
  211    211   
            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
  212    212   
        ::std::result::Result::Ok(())
  213    213   
    }
  214    214   
}
  215    215   
#[allow(unreachable_code, unused_variables)]
  216    216   
#[cfg(test)]
  217         -
mod datetime_offsets_request_test {
         217  +
mod datetime_offsets_test {
         218  +
  218    219   
    /// Ensures that clients can correctly parse datetime (timestamps) with offsets
  219    220   
    /// Test ID: RestXmlDateTimeWithNegativeOffset
  220    221   
    #[::tokio::test]
  221         -
    #[allow(unused_mut)]
         222  +
    #[::tracing_test::traced_test]
  222    223   
    async fn rest_xml_date_time_with_negative_offset_response() {
  223    224   
        let expected_output = crate::operation::datetime_offsets::DatetimeOffsetsOutput::builder()
  224    225   
            .set_datetime(::std::option::Option::Some(::aws_smithy_types::DateTime::from_fractional_secs(
  225    226   
                1576540098, 0_f64,
  226    227   
            )))
  227    228   
            .build();
  228    229   
        let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
  229    230   
            ::http::response::Builder::new()
  230    231   
                .header("Content-Type", "application/xml")
  231    232   
                .status(200)
  232    233   
                .body(::aws_smithy_types::body::SdkBody::from(
  233    234   
                    "<DatetimeOffsetsOutput>\n    <datetime>2019-12-16T22:48:18-01:00</datetime>\n</DatetimeOffsetsOutput>\n",
  234    235   
                ))
  235    236   
                .unwrap(),
  236    237   
        )
  237    238   
        .unwrap();
  238    239   
        use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
  239    240   
        use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
  240    241   
  241    242   
        let op = crate::operation::datetime_offsets::DatetimeOffsets::new();
  242    243   
        let config = op.config().expect("the operation has config");
  243    244   
        let de = config
  244    245   
            .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
  245    246   
            .expect("the config must have a deserializer");
  246    247   
  247    248   
        let parsed = de.deserialize_streaming(&mut http_response);
  248    249   
        let parsed = parsed.unwrap_or_else(|| {
  249    250   
            let http_response =
  250    251   
                http_response.map(|body| ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(body.bytes().unwrap())));
  251    252   
            de.deserialize_nonstreaming(&http_response)
  252    253   
        });
  253    254   
        let parsed = parsed
  254    255   
            .expect("should be successful response")
  255    256   
            .downcast::<crate::operation::datetime_offsets::DatetimeOffsetsOutput>()
  256    257   
            .unwrap();
  257    258   
        ::pretty_assertions::assert_eq!(parsed.datetime, expected_output.datetime, "Unexpected value for `datetime`");
  258    259   
    }
  259    260   
    /// Ensures that clients can correctly parse datetime (timestamps) with offsets
  260    261   
    /// Test ID: RestXmlDateTimeWithPositiveOffset
  261    262   
    #[::tokio::test]
  262         -
    #[allow(unused_mut)]
         263  +
    #[::tracing_test::traced_test]
  263    264   
    async fn rest_xml_date_time_with_positive_offset_response() {
  264    265   
        let expected_output = crate::operation::datetime_offsets::DatetimeOffsetsOutput::builder()
  265    266   
            .set_datetime(::std::option::Option::Some(::aws_smithy_types::DateTime::from_fractional_secs(
  266    267   
                1576540098, 0_f64,
  267    268   
            )))
  268    269   
            .build();
  269    270   
        let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
  270    271   
            ::http::response::Builder::new()
  271    272   
                .header("Content-Type", "application/xml")
  272    273   
                .status(200)

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/operation/empty_input_and_empty_output.rs

@@ -193,193 +276,277 @@
  213    213   
        let params = crate::config::endpoint::Params::builder().build().map_err(|err| {
  214    214   
            ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
  215    215   
        })?;
  216    216   
        cfg.interceptor_state()
  217    217   
            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
  218    218   
        ::std::result::Result::Ok(())
  219    219   
    }
  220    220   
}
  221    221   
#[allow(unreachable_code, unused_variables)]
  222    222   
#[cfg(test)]
  223         -
mod empty_input_and_empty_output_request_test {
         223  +
mod empty_input_and_empty_output_test {
         224  +
  224    225   
    /// Empty input serializes no payload
  225    226   
    /// Test ID: EmptyInputAndEmptyOutput
  226    227   
    #[::tokio::test]
  227         -
    #[allow(unused_mut)]
         228  +
    #[::tracing_test::traced_test]
  228    229   
    async fn empty_input_and_empty_output_request() {
  229    230   
        let (http_client, request_receiver) = ::aws_smithy_runtime::client::http::test_util::capture_request(None);
  230    231   
        let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
  231    232   
  232    233   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  233    234   
        let result = client.empty_input_and_empty_output().send().await;
  234    235   
        let _ = dbg!(result);
  235    236   
        let http_request = request_receiver.expect_request();
  236    237   
        let body = http_request.body().bytes().expect("body should be strict");
  237    238   
        // No body
  238    239   
        ::pretty_assertions::assert_eq!(::std::str::from_utf8(body).unwrap(), "");
  239    240   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  240    241   
        ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
  241    242   
        ::pretty_assertions::assert_eq!(uri.path(), "/EmptyInputAndEmptyOutput", "path was incorrect");
  242    243   
    }
  243    244   
    /// Empty output serializes no payload
  244    245   
    /// Test ID: EmptyInputAndEmptyOutput
  245    246   
    #[::tokio::test]
  246         -
    #[allow(unused_mut)]
         247  +
    #[::tracing_test::traced_test]
  247    248   
    async fn empty_input_and_empty_output_response() {
  248    249   
        let expected_output = crate::operation::empty_input_and_empty_output::EmptyInputAndEmptyOutputOutput::builder().build();
  249    250   
        let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
  250    251   
            ::http::response::Builder::new()
  251    252   
                .status(200)
  252    253   
                .body(::aws_smithy_types::body::SdkBody::from(""))
  253    254   
                .unwrap(),
  254    255   
        )
  255    256   
        .unwrap();
  256    257   
        use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/operation/endpoint_operation.rs

@@ -192,192 +257,258 @@
  212    212   
        let params = crate::config::endpoint::Params::builder().build().map_err(|err| {
  213    213   
            ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
  214    214   
        })?;
  215    215   
        cfg.interceptor_state()
  216    216   
            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
  217    217   
        ::std::result::Result::Ok(())
  218    218   
    }
  219    219   
}
  220    220   
#[allow(unreachable_code, unused_variables)]
  221    221   
#[cfg(test)]
  222         -
mod endpoint_operation_request_test {
         222  +
mod endpoint_operation_test {
         223  +
  223    224   
    /// Operations can prepend to the given host if they define the
  224    225   
    /// endpoint trait.
  225    226   
    /// Test ID: RestXmlEndpointTrait
  226    227   
    #[::tokio::test]
  227         -
    #[allow(unused_mut)]
         228  +
    #[::tracing_test::traced_test]
  228    229   
    async fn rest_xml_endpoint_trait_request() {
  229    230   
        let (http_client, request_receiver) = ::aws_smithy_runtime::client::http::test_util::capture_request(None);
  230    231   
        let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
  231    232   
  232    233   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  233    234   
        let result = client.endpoint_operation().send().await;
  234    235   
        let _ = dbg!(result);
  235    236   
        let http_request = request_receiver.expect_request();
  236    237   
        let body = http_request.body().bytes().expect("body should be strict");
  237    238   
        // No body

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/operation/endpoint_with_host_label_header_operation.rs

@@ -216,216 +284,285 @@
  236    236   
        let params = crate::config::endpoint::Params::builder().build().map_err(|err| {
  237    237   
            ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
  238    238   
        })?;
  239    239   
        cfg.interceptor_state()
  240    240   
            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
  241    241   
        ::std::result::Result::Ok(())
  242    242   
    }
  243    243   
}
  244    244   
#[allow(unreachable_code, unused_variables)]
  245    245   
#[cfg(test)]
  246         -
mod endpoint_with_host_label_header_operation_request_test {
         246  +
mod endpoint_with_host_label_header_operation_test {
         247  +
  247    248   
    /// Operations can prepend to the given host if they define the
  248    249   
    /// endpoint trait, and can use the host label trait to define
  249    250   
    /// further customization based on user input. The label must also
  250    251   
    /// be serialized in into any other location it is bound to, such
  251    252   
    /// as the body or in this case an http header.
  252    253   
    /// Test ID: RestXmlEndpointTraitWithHostLabelAndHttpBinding
  253    254   
    #[::tokio::test]
  254         -
    #[allow(unused_mut)]
         255  +
    #[::tracing_test::traced_test]
  255    256   
    async fn rest_xml_endpoint_trait_with_host_label_and_http_binding_request() {
  256    257   
        let (http_client, request_receiver) = ::aws_smithy_runtime::client::http::test_util::capture_request(None);
  257    258   
        let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
  258    259   
  259    260   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  260    261   
        let result = client
  261    262   
            .endpoint_with_host_label_header_operation()
  262    263   
            .set_account_id(::std::option::Option::Some("bar".to_owned()))
  263    264   
            .send()
  264    265   
            .await;

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/operation/endpoint_with_host_label_operation.rs

@@ -216,216 +282,283 @@
  236    236   
        let params = crate::config::endpoint::Params::builder().build().map_err(|err| {
  237    237   
            ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
  238    238   
        })?;
  239    239   
        cfg.interceptor_state()
  240    240   
            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
  241    241   
        ::std::result::Result::Ok(())
  242    242   
    }
  243    243   
}
  244    244   
#[allow(unreachable_code, unused_variables)]
  245    245   
#[cfg(test)]
  246         -
mod endpoint_with_host_label_operation_request_test {
         246  +
mod endpoint_with_host_label_operation_test {
         247  +
  247    248   
    /// Operations can prepend to the given host if they define the
  248    249   
    /// endpoint trait, and can use the host label trait to define
  249    250   
    /// further customization based on user input.
  250    251   
    /// Test ID: RestXmlEndpointTraitWithHostLabel
  251    252   
    #[::tokio::test]
  252         -
    #[allow(unused_mut)]
         253  +
    #[::tracing_test::traced_test]
  253    254   
    async fn rest_xml_endpoint_trait_with_host_label_request() {
  254    255   
        let (http_client, request_receiver) = ::aws_smithy_runtime::client::http::test_util::capture_request(None);
  255    256   
        let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
  256    257   
  257    258   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  258    259   
        let result = client
  259    260   
            .endpoint_with_host_label_operation()
  260    261   
            .set_label(::std::option::Option::Some("bar".to_owned()))
  261    262   
            .send()
  262    263   
            .await;

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/operation/flattened_xml_map.rs

@@ -191,191 +292,293 @@
  211    211   
        let params = crate::config::endpoint::Params::builder().build().map_err(|err| {
  212    212   
            ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
  213    213   
        })?;
  214    214   
        cfg.interceptor_state()
  215    215   
            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
  216    216   
        ::std::result::Result::Ok(())
  217    217   
    }
  218    218   
}
  219    219   
#[allow(unreachable_code, unused_variables)]
  220    220   
#[cfg(test)]
  221         -
mod flattened_xml_map_request_test {
         221  +
mod flattened_xml_map_test {
         222  +
  222    223   
    /// Serializes flattened XML maps in requests
  223    224   
    /// Test ID: FlattenedXmlMap
  224    225   
    #[::tokio::test]
  225         -
    #[allow(unused_mut)]
         226  +
    #[::tracing_test::traced_test]
  226    227   
    async fn flattened_xml_map_request() {
  227    228   
        let (http_client, request_receiver) = ::aws_smithy_runtime::client::http::test_util::capture_request(None);
  228    229   
        let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
  229    230   
  230    231   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  231    232   
        let result = client
  232    233   
            .flattened_xml_map()
  233    234   
            .set_my_map(::std::option::Option::Some({
  234    235   
                let mut ret = ::std::collections::HashMap::new();
  235    236   
                ret.insert(
  236    237   
                    "foo".to_owned(),
  237    238   
                    "Foo".parse::<crate::types::FooEnum>().expect("static value validated to member"),
  238    239   
                );
  239    240   
                ret.insert(
  240    241   
                    "baz".to_owned(),
  241    242   
                    "Baz".parse::<crate::types::FooEnum>().expect("static value validated to member"),
  242    243   
                );
  243    244   
                ret
  244    245   
            }))
  245    246   
            .send()
  246    247   
            .await;
  247    248   
        let _ = dbg!(result);
  248    249   
        let http_request = request_receiver.expect_request();
  249    250   
        let expected_headers = [("Content-Type", "application/xml")];
  250    251   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
  251    252   
        let body = http_request.body().bytes().expect("body should be strict");
  252    253   
        ::aws_smithy_protocol_test::assert_ok(
  253    254   
        ::aws_smithy_protocol_test::validate_body(body, "<FlattenedXmlMapRequest>\n    <myMap>\n        <key>foo</key>\n        <value>Foo</value>\n    </myMap>\n    <myMap>\n        <key>baz</key>\n        <value>Baz</value>\n    </myMap>\n</FlattenedXmlMapRequest>", ::aws_smithy_protocol_test::MediaType::from("application/xml"))
  254    255   
        );
  255    256   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  256    257   
        ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
  257    258   
        ::pretty_assertions::assert_eq!(uri.path(), "/FlattenedXmlMap", "path was incorrect");
  258    259   
    }
  259    260   
    /// Serializes flattened XML maps in responses
  260    261   
    /// Test ID: FlattenedXmlMap
  261    262   
    #[::tokio::test]
  262         -
    #[allow(unused_mut)]
         263  +
    #[::tracing_test::traced_test]
  263    264   
    async fn flattened_xml_map_response() {
  264    265   
        let expected_output = crate::operation::flattened_xml_map::FlattenedXmlMapOutput::builder()
  265    266   
            .set_my_map(::std::option::Option::Some({
  266    267   
                let mut ret = ::std::collections::HashMap::new();
  267    268   
                ret.insert(
  268    269   
                    "foo".to_owned(),
  269    270   
                    "Foo".parse::<crate::types::FooEnum>().expect("static value validated to member"),
  270    271   
                );
  271    272   
                ret.insert(
  272    273   
                    "baz".to_owned(),

tmp-codegen-diff/codegen-client-test/rest_xml/rust-client-codegen/src/operation/flattened_xml_map_with_xml_name.rs

@@ -199,199 +294,295 @@
  219    219   
        let params = crate::config::endpoint::Params::builder().build().map_err(|err| {
  220    220   
            ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
  221    221   
        })?;
  222    222   
        cfg.interceptor_state()
  223    223   
            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
  224    224   
        ::std::result::Result::Ok(())
  225    225   
    }
  226    226   
}
  227    227   
#[allow(unreachable_code, unused_variables)]
  228    228   
#[cfg(test)]
  229         -
mod flattened_xml_map_with_xml_name_request_test {
         229  +
mod flattened_xml_map_with_xml_name_test {
         230  +
  230    231   
    /// Serializes flattened XML maps in requests that have xmlName on members
  231    232   
    /// Test ID: FlattenedXmlMapWithXmlName
  232    233   
    #[::tokio::test]
  233         -
    #[allow(unused_mut)]
         234  +
    #[::tracing_test::traced_test]
  234    235   
    async fn flattened_xml_map_with_xml_name_request() {
  235    236   
        let (http_client, request_receiver) = ::aws_smithy_runtime::client::http::test_util::capture_request(None);
  236    237   
        let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
  237    238   
  238    239   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  239    240   
        let result = client
  240    241   
            .flattened_xml_map_with_xml_name()
  241    242   
            .set_my_map(::std::option::Option::Some({
  242    243   
                let mut ret = ::std::collections::HashMap::new();
  243    244   
                ret.insert("a".to_owned(), "A".to_owned());
  244    245   
                ret.insert("b".to_owned(), "B".to_owned());
  245    246   
                ret
  246    247   
            }))
  247    248   
            .send()
  248    249   
            .await;
  249    250   
        let _ = dbg!(result);
  250    251   
        let http_request = request_receiver.expect_request();
  251    252   
        let expected_headers = [("Content-Type", "application/xml")];
  252    253   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
  253    254   
        let body = http_request.body().bytes().expect("body should be strict");
  254    255   
        ::aws_smithy_protocol_test::assert_ok(
  255    256   
        ::aws_smithy_protocol_test::validate_body(body, "<FlattenedXmlMapWithXmlNameRequest>\n    <KVP>\n        <K>a</K>\n        <V>A</V>\n    </KVP>\n    <KVP>\n        <K>b</K>\n        <V>B</V>\n    </KVP>\n</FlattenedXmlMapWithXmlNameRequest>", ::aws_smithy_protocol_test::MediaType::from("application/xml"))
  256    257   
        );
  257    258   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  258    259   
        ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
  259    260   
        ::pretty_assertions::assert_eq!(uri.path(), "/FlattenedXmlMapWithXmlName", "path was incorrect");
  260    261   
    }
  261    262   
    /// Serializes flattened XML maps in responses that have xmlName on members
  262    263   
    /// Test ID: FlattenedXmlMapWithXmlName
  263    264   
    #[::tokio::test]
  264         -
    #[allow(unused_mut)]
         265  +
    #[::tracing_test::traced_test]
  265    266   
    async fn flattened_xml_map_with_xml_name_response() {
  266    267   
        let expected_output = crate::operation::flattened_xml_map_with_xml_name::FlattenedXmlMapWithXmlNameOutput::builder()
  267    268   
            .set_my_map(::std::option::Option::Some({
  268    269   
                let mut ret = ::std::collections::HashMap::new();
  269    270   
                ret.insert("a".to_owned(), "A".to_owned());
  270    271   
                ret.insert("b".to_owned(), "B".to_owned());
  271    272   
                ret
  272    273   
            }))
  273    274   
            .build();
  274    275   
        let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(::http::response::Builder::new()