Client Test

Client Test

rev. 26e0a1e8aaec58e3c7fd18a79449d71bcadaf391 (ignoring whitespace)

Files changed:

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/document_type.rs

@@ -216,216 +426,436 @@
  236    236   
mod document_type_test {
  237    237   
  238    238   
    /// Serializes document types as part of the JSON request payload with no escaping.
  239    239   
    /// Test ID: DocumentTypeInputWithObject
  240    240   
    #[::tokio::test]
  241    241   
    #[::tracing_test::traced_test]
  242    242   
    async fn document_type_input_with_object_request() {
  243    243   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  244    244   
        let config_builder = crate::config::Config::builder()
  245    245   
            .with_test_defaults()
  246         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         246  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         247  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         248  +
            .allow_no_auth()
  247    249   
            .endpoint_url("https://example.com");
  248    250   
  249    251   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  250    252   
        let result = client
  251    253   
            .document_type()
  252    254   
            .set_string_value(::std::option::Option::Some("string".to_owned()))
  253    255   
            .set_document_value(::std::option::Option::Some({
  254    256   
                let json_bytes = br#"{
  255    257   
                        "foo": "bar"
  256    258   
                    }"#;
  257    259   
                let mut tokens = ::aws_smithy_json::deserialize::json_token_iter(json_bytes).peekable();
  258    260   
                ::aws_smithy_json::deserialize::token::expect_document(&mut tokens).expect("well formed json")
  259    261   
            }))
  260    262   
            .send()
  261    263   
            .await;
  262    264   
        let _ = dbg!(result);
  263    265   
        let http_request = request_receiver.expect_request();
  264    266   
        let expected_headers = [("Content-Type", "application/json")];
  265    267   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
  266    268   
        let body = http_request.body().bytes().expect("body should be strict");
  267    269   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
  268    270   
            body,
  269    271   
            "{\n    \"stringValue\": \"string\",\n    \"documentValue\": {\n        \"foo\": \"bar\"\n    }\n}",
  270    272   
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
  271    273   
        ));
  272    274   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  273    275   
        ::pretty_assertions::assert_eq!(http_request.method(), "PUT", "method was incorrect");
  274    276   
        ::pretty_assertions::assert_eq!(uri.path(), "/DocumentType", "path was incorrect");
  275    277   
    }
  276    278   
  277    279   
    /// Serializes document types using a string.
  278    280   
    /// Test ID: DocumentInputWithString
  279    281   
    #[::tokio::test]
  280    282   
    #[::tracing_test::traced_test]
  281    283   
    async fn document_input_with_string_request() {
  282    284   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  283    285   
        let config_builder = crate::config::Config::builder()
  284    286   
            .with_test_defaults()
  285         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         287  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         288  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         289  +
            .allow_no_auth()
  286    290   
            .endpoint_url("https://example.com");
  287    291   
  288    292   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  289    293   
        let result = client
  290    294   
            .document_type()
  291    295   
            .set_string_value(::std::option::Option::Some("string".to_owned()))
  292    296   
            .set_document_value(::std::option::Option::Some({
  293    297   
                let json_bytes = br#""hello""#;
  294    298   
                let mut tokens = ::aws_smithy_json::deserialize::json_token_iter(json_bytes).peekable();
  295    299   
                ::aws_smithy_json::deserialize::token::expect_document(&mut tokens).expect("well formed json")
  296    300   
            }))
  297    301   
            .send()
  298    302   
            .await;
  299    303   
        let _ = dbg!(result);
  300    304   
        let http_request = request_receiver.expect_request();
  301    305   
        let expected_headers = [("Content-Type", "application/json")];
  302    306   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
  303    307   
        let body = http_request.body().bytes().expect("body should be strict");
  304    308   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
  305    309   
            body,
  306    310   
            "{\n    \"stringValue\": \"string\",\n    \"documentValue\": \"hello\"\n}",
  307    311   
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
  308    312   
        ));
  309    313   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  310    314   
        ::pretty_assertions::assert_eq!(http_request.method(), "PUT", "method was incorrect");
  311    315   
        ::pretty_assertions::assert_eq!(uri.path(), "/DocumentType", "path was incorrect");
  312    316   
    }
  313    317   
  314    318   
    /// Serializes document types using a number.
  315    319   
    /// Test ID: DocumentInputWithNumber
  316    320   
    #[::tokio::test]
  317    321   
    #[::tracing_test::traced_test]
  318    322   
    async fn document_input_with_number_request() {
  319    323   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  320    324   
        let config_builder = crate::config::Config::builder()
  321    325   
            .with_test_defaults()
  322         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         326  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         327  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         328  +
            .allow_no_auth()
  323    329   
            .endpoint_url("https://example.com");
  324    330   
  325    331   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  326    332   
        let result = client
  327    333   
            .document_type()
  328    334   
            .set_string_value(::std::option::Option::Some("string".to_owned()))
  329    335   
            .set_document_value(::std::option::Option::Some({
  330    336   
                let json_bytes = br#"10"#;
  331    337   
                let mut tokens = ::aws_smithy_json::deserialize::json_token_iter(json_bytes).peekable();
  332    338   
                ::aws_smithy_json::deserialize::token::expect_document(&mut tokens).expect("well formed json")
  333    339   
            }))
  334    340   
            .send()
  335    341   
            .await;
  336    342   
        let _ = dbg!(result);
  337    343   
        let http_request = request_receiver.expect_request();
  338    344   
        let expected_headers = [("Content-Type", "application/json")];
  339    345   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
  340    346   
        let body = http_request.body().bytes().expect("body should be strict");
  341    347   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
  342    348   
            body,
  343    349   
            "{\n    \"stringValue\": \"string\",\n    \"documentValue\": 10\n}",
  344    350   
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
  345    351   
        ));
  346    352   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  347    353   
        ::pretty_assertions::assert_eq!(http_request.method(), "PUT", "method was incorrect");
  348    354   
        ::pretty_assertions::assert_eq!(uri.path(), "/DocumentType", "path was incorrect");
  349    355   
    }
  350    356   
  351    357   
    /// Serializes document types using a boolean.
  352    358   
    /// Test ID: DocumentInputWithBoolean
  353    359   
    #[::tokio::test]
  354    360   
    #[::tracing_test::traced_test]
  355    361   
    async fn document_input_with_boolean_request() {
  356    362   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  357    363   
        let config_builder = crate::config::Config::builder()
  358    364   
            .with_test_defaults()
  359         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         365  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         366  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         367  +
            .allow_no_auth()
  360    368   
            .endpoint_url("https://example.com");
  361    369   
  362    370   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  363    371   
        let result = client
  364    372   
            .document_type()
  365    373   
            .set_string_value(::std::option::Option::Some("string".to_owned()))
  366    374   
            .set_document_value(::std::option::Option::Some({
  367    375   
                let json_bytes = br#"true"#;
  368    376   
                let mut tokens = ::aws_smithy_json::deserialize::json_token_iter(json_bytes).peekable();
  369    377   
                ::aws_smithy_json::deserialize::token::expect_document(&mut tokens).expect("well formed json")
  370    378   
            }))
  371    379   
            .send()
  372    380   
            .await;
  373    381   
        let _ = dbg!(result);
  374    382   
        let http_request = request_receiver.expect_request();
  375    383   
        let expected_headers = [("Content-Type", "application/json")];
  376    384   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
  377    385   
        let body = http_request.body().bytes().expect("body should be strict");
  378    386   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
  379    387   
            body,
  380    388   
            "{\n    \"stringValue\": \"string\",\n    \"documentValue\": true\n}",
  381    389   
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
  382    390   
        ));
  383    391   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  384    392   
        ::pretty_assertions::assert_eq!(http_request.method(), "PUT", "method was incorrect");
  385    393   
        ::pretty_assertions::assert_eq!(uri.path(), "/DocumentType", "path was incorrect");
  386    394   
    }
  387    395   
  388    396   
    /// Serializes document types using a list.
  389    397   
    /// Test ID: DocumentInputWithList
  390    398   
    #[::tokio::test]
  391    399   
    #[::tracing_test::traced_test]
  392    400   
    async fn document_input_with_list_request() {
  393    401   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  394    402   
        let config_builder = crate::config::Config::builder()
  395    403   
            .with_test_defaults()
  396         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         404  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         405  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         406  +
            .allow_no_auth()
  397    407   
            .endpoint_url("https://example.com");
  398    408   
  399    409   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  400    410   
        let result = client
  401    411   
            .document_type()
  402    412   
            .set_string_value(::std::option::Option::Some("string".to_owned()))
  403    413   
            .set_document_value(::std::option::Option::Some({
  404    414   
                let json_bytes = br#"[
  405    415   
                        true,
  406    416   
                        "hi",

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/document_type_as_map_value.rs

@@ -224,224 +284,286 @@
  244    244   
mod document_type_as_map_value_test {
  245    245   
  246    246   
    /// Serializes a map that uses documents as the value.
  247    247   
    /// Test ID: DocumentTypeAsMapValueInput
  248    248   
    #[::tokio::test]
  249    249   
    #[::tracing_test::traced_test]
  250    250   
    async fn document_type_as_map_value_input_request() {
  251    251   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  252    252   
        let config_builder = crate::config::Config::builder()
  253    253   
            .with_test_defaults()
  254         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         254  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         255  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         256  +
            .allow_no_auth()
  255    257   
            .endpoint_url("https://example.com");
  256    258   
  257    259   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  258    260   
        let result = client
  259    261   
            .document_type_as_map_value()
  260    262   
            .set_doc_valued_map(::std::option::Option::Some({
  261    263   
                let mut ret = ::std::collections::HashMap::new();
  262    264   
                ret.insert("foo".to_owned(), {
  263    265   
                    let json_bytes = br#"{
  264    266   
                                "f": 1,

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/document_type_as_payload.rs

@@ -224,224 +322,326 @@
  244    244   
mod document_type_as_payload_test {
  245    245   
  246    246   
    /// Serializes a document as the target of the httpPayload trait.
  247    247   
    /// Test ID: DocumentTypeAsPayloadInput
  248    248   
    #[::tokio::test]
  249    249   
    #[::tracing_test::traced_test]
  250    250   
    async fn document_type_as_payload_input_request() {
  251    251   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  252    252   
        let config_builder = crate::config::Config::builder()
  253    253   
            .with_test_defaults()
  254         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         254  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         255  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         256  +
            .allow_no_auth()
  255    257   
            .endpoint_url("https://example.com");
  256    258   
  257    259   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  258    260   
        let result = client
  259    261   
            .document_type_as_payload()
  260    262   
            .set_document_value(::std::option::Option::Some({
  261    263   
                let json_bytes = br#"{
  262    264   
                        "foo": "bar"
  263    265   
                    }"#;
  264    266   
                let mut tokens = ::aws_smithy_json::deserialize::json_token_iter(json_bytes).peekable();
  265    267   
                ::aws_smithy_json::deserialize::token::expect_document(&mut tokens).expect("well formed json")
  266    268   
            }))
  267    269   
            .send()
  268    270   
            .await;
  269    271   
        let _ = dbg!(result);
  270    272   
        let http_request = request_receiver.expect_request();
  271    273   
        let expected_headers = [("Content-Type", "application/json")];
  272    274   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
  273    275   
        let body = http_request.body().bytes().expect("body should be strict");
  274    276   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
  275    277   
            body,
  276    278   
            "{\n    \"foo\": \"bar\"\n}",
  277    279   
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
  278    280   
        ));
  279    281   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  280    282   
        ::pretty_assertions::assert_eq!(http_request.method(), "PUT", "method was incorrect");
  281    283   
        ::pretty_assertions::assert_eq!(uri.path(), "/DocumentTypeAsPayload", "path was incorrect");
  282    284   
    }
  283    285   
  284    286   
    /// Serializes a document as the target of the httpPayload trait using a string.
  285    287   
    /// Test ID: DocumentTypeAsPayloadInputString
  286    288   
    #[::tokio::test]
  287    289   
    #[::tracing_test::traced_test]
  288    290   
    async fn document_type_as_payload_input_string_request() {
  289    291   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  290    292   
        let config_builder = crate::config::Config::builder()
  291    293   
            .with_test_defaults()
  292         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         294  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         295  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         296  +
            .allow_no_auth()
  293    297   
            .endpoint_url("https://example.com");
  294    298   
  295    299   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  296    300   
        let result = client
  297    301   
            .document_type_as_payload()
  298    302   
            .set_document_value(::std::option::Option::Some({
  299    303   
                let json_bytes = br#""hello""#;
  300    304   
                let mut tokens = ::aws_smithy_json::deserialize::json_token_iter(json_bytes).peekable();
  301    305   
                ::aws_smithy_json::deserialize::token::expect_document(&mut tokens).expect("well formed json")
  302    306   
            }))

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

@@ -220,220 +280,282 @@
  240    240   
    /// Clients should not serialize a JSON payload when no parameters
  241    241   
    /// are given that are sent in the body. A service will tolerate
  242    242   
    /// clients that omit a payload or that send a JSON object.
  243    243   
    /// Test ID: RestJsonEmptyInputAndEmptyOutput
  244    244   
    #[::tokio::test]
  245    245   
    #[::tracing_test::traced_test]
  246    246   
    async fn rest_json_empty_input_and_empty_output_request() {
  247    247   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  248    248   
        let config_builder = crate::config::Config::builder()
  249    249   
            .with_test_defaults()
  250         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         250  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         251  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         252  +
            .allow_no_auth()
  251    253   
            .endpoint_url("https://example.com");
  252    254   
  253    255   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  254    256   
        let result = client.empty_input_and_empty_output().send().await;
  255    257   
        let _ = dbg!(result);
  256    258   
        let http_request = request_receiver.expect_request();
  257    259   
        let body = http_request.body().bytes().expect("body should be strict");
  258    260   
        // No body.
  259    261   
        ::pretty_assertions::assert_eq!(&body, &::bytes::Bytes::new());
  260    262   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");

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

@@ -224,224 +284,286 @@
  244    244   
  245    245   
    /// Operations can prepend to the given host if they define the
  246    246   
    /// endpoint trait.
  247    247   
    /// Test ID: RestJsonEndpointTrait
  248    248   
    #[::tokio::test]
  249    249   
    #[::tracing_test::traced_test]
  250    250   
    async fn rest_json_endpoint_trait_request() {
  251    251   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  252    252   
        let config_builder = crate::config::Config::builder()
  253    253   
            .with_test_defaults()
  254         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         254  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         255  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         256  +
            .allow_no_auth()
  255    257   
            .endpoint_url("https://example.com");
  256    258   
  257    259   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  258    260   
        let result = client.endpoint_operation().send().await;
  259    261   
        let _ = dbg!(result);
  260    262   
        let http_request = request_receiver.expect_request();
  261    263   
        let body = http_request.body().bytes().expect("body should be strict");
  262    264   
        // No body.
  263    265   
        ::pretty_assertions::assert_eq!(&body, &::bytes::Bytes::new());
  264    266   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");

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

@@ -244,244 +304,306 @@
  264    264   
    /// Operations can prepend to the given host if they define the
  265    265   
    /// endpoint trait, and can use the host label trait to define
  266    266   
    /// further customization based on user input.
  267    267   
    /// Test ID: RestJsonEndpointTraitWithHostLabel
  268    268   
    #[::tokio::test]
  269    269   
    #[::tracing_test::traced_test]
  270    270   
    async fn rest_json_endpoint_trait_with_host_label_request() {
  271    271   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  272    272   
        let config_builder = crate::config::Config::builder()
  273    273   
            .with_test_defaults()
  274         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         274  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         275  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         276  +
            .allow_no_auth()
  275    277   
            .endpoint_url("https://example.com");
  276    278   
  277    279   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  278    280   
        let result = client
  279    281   
            .endpoint_with_host_label_operation()
  280    282   
            .set_label(::std::option::Option::Some("bar".to_owned()))
  281    283   
            .send()
  282    284   
            .await;
  283    285   
        let _ = dbg!(result);
  284    286   
        let http_request = request_receiver.expect_request();

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/host_with_path_operation.rs

@@ -218,218 +278,280 @@
  238    238   
mod host_with_path_operation_test {
  239    239   
  240    240   
    /// Custom endpoints supplied by users can have paths
  241    241   
    /// Test ID: RestJsonHostWithPath
  242    242   
    #[::tokio::test]
  243    243   
    #[::tracing_test::traced_test]
  244    244   
    async fn rest_json_host_with_path_request() {
  245    245   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  246    246   
        let config_builder = crate::config::Config::builder()
  247    247   
            .with_test_defaults()
  248         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         248  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         249  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         250  +
            .allow_no_auth()
  249    251   
            .endpoint_url("https://example.com/custom");
  250    252   
  251    253   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  252    254   
        let result = client.host_with_path_operation().send().await;
  253    255   
        let _ = dbg!(result);
  254    256   
        let http_request = request_receiver.expect_request();
  255    257   
        let body = http_request.body().bytes().expect("body should be strict");
  256    258   
        // No body.
  257    259   
        ::pretty_assertions::assert_eq!(&body, &::bytes::Bytes::new());
  258    260   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/http_checksum_required.rs

@@ -224,224 +284,286 @@
  244    244   
mod http_checksum_required_test {
  245    245   
  246    246   
    /// Adds Content-MD5 header
  247    247   
    /// Test ID: RestJsonHttpChecksumRequired
  248    248   
    #[::tokio::test]
  249    249   
    #[::tracing_test::traced_test]
  250    250   
    async fn rest_json_http_checksum_required_request() {
  251    251   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  252    252   
        let config_builder = crate::config::Config::builder()
  253    253   
            .with_test_defaults()
  254         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         254  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         255  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         256  +
            .allow_no_auth()
  255    257   
            .endpoint_url("https://example.com");
  256    258   
  257    259   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  258    260   
        let result = client
  259    261   
            .http_checksum_required()
  260    262   
            .set_foo(::std::option::Option::Some("base64 encoded md5 checksum".to_owned()))
  261    263   
            .send()
  262    264   
            .await;
  263    265   
        let _ = dbg!(result);
  264    266   
        let http_request = request_receiver.expect_request();

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/http_empty_prefix_headers.rs

@@ -220,220 +280,282 @@
  240    240   
  241    241   
    /// Serializes all request headers, using specific when present
  242    242   
    /// Test ID: RestJsonHttpEmptyPrefixHeadersRequestClient
  243    243   
    #[::tokio::test]
  244    244   
    #[::tracing_test::traced_test]
  245    245   
    #[should_panic]
  246    246   
    async fn rest_json_http_empty_prefix_headers_request_client_request() {
  247    247   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  248    248   
        let config_builder = crate::config::Config::builder()
  249    249   
            .with_test_defaults()
  250         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         250  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         251  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         252  +
            .allow_no_auth()
  251    253   
            .endpoint_url("https://example.com");
  252    254   
  253    255   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  254    256   
        let result = client
  255    257   
            .http_empty_prefix_headers()
  256    258   
            .set_prefix_headers(::std::option::Option::Some({
  257    259   
                let mut ret = ::std::collections::HashMap::new();
  258    260   
                ret.insert("x-foo".to_owned().to_ascii_lowercase(), "Foo".to_owned());
  259    261   
                ret.insert("hello".to_owned().to_ascii_lowercase(), "Hello".to_owned());
  260    262   
                ret

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/http_enum_payload.rs

@@ -223,223 +283,285 @@
  243    243   
#[cfg(test)]
  244    244   
mod http_enum_payload_test {
  245    245   
  246    246   
    /// Test ID: RestJsonEnumPayloadRequest
  247    247   
    #[::tokio::test]
  248    248   
    #[::tracing_test::traced_test]
  249    249   
    async fn rest_json_enum_payload_request_request() {
  250    250   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  251    251   
        let config_builder = crate::config::Config::builder()
  252    252   
            .with_test_defaults()
  253         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         253  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         254  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         255  +
            .allow_no_auth()
  254    256   
            .endpoint_url("https://example.com");
  255    257   
  256    258   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  257    259   
        let result = client
  258    260   
            .http_enum_payload()
  259    261   
            .set_payload(::std::option::Option::Some(
  260    262   
                "enumvalue".parse::<crate::types::StringEnum>().expect("static value validated to member"),
  261    263   
            ))
  262    264   
            .send()
  263    265   
            .await;

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/http_payload_traits.rs

@@ -224,224 +319,323 @@
  244    244   
mod http_payload_traits_test {
  245    245   
  246    246   
    /// Serializes a blob in the HTTP payload
  247    247   
    /// Test ID: RestJsonHttpPayloadTraitsWithBlob
  248    248   
    #[::tokio::test]
  249    249   
    #[::tracing_test::traced_test]
  250    250   
    async fn rest_json_http_payload_traits_with_blob_request() {
  251    251   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  252    252   
        let config_builder = crate::config::Config::builder()
  253    253   
            .with_test_defaults()
  254         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         254  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         255  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         256  +
            .allow_no_auth()
  255    257   
            .endpoint_url("https://example.com");
  256    258   
  257    259   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  258    260   
        let result = client
  259    261   
            .http_payload_traits()
  260    262   
            .set_foo(::std::option::Option::Some("Foo".to_owned()))
  261    263   
            .set_blob(::std::option::Option::Some(::aws_smithy_types::Blob::new("blobby blob blob")))
  262    264   
            .send()
  263    265   
            .await;
  264    266   
        let _ = dbg!(result);
  265    267   
        let http_request = request_receiver.expect_request();
  266    268   
        let expected_headers = [("Content-Type", "application/octet-stream"), ("X-Foo", "Foo")];
  267    269   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
  268    270   
        let required_headers = &["Content-Length"];
  269    271   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::require_headers(http_request.headers(), required_headers));
  270    272   
        let body = http_request.body().bytes().expect("body should be strict");
  271    273   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
  272    274   
            body,
  273    275   
            "blobby blob blob",
  274    276   
            ::aws_smithy_protocol_test::MediaType::from("application/octet-stream"),
  275    277   
        ));
  276    278   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  277    279   
        ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
  278    280   
        ::pretty_assertions::assert_eq!(uri.path(), "/HttpPayloadTraits", "path was incorrect");
  279    281   
    }
  280    282   
  281    283   
    /// Serializes an empty blob in the HTTP payload
  282    284   
    /// Test ID: RestJsonHttpPayloadTraitsWithNoBlobBody
  283    285   
    #[::tokio::test]
  284    286   
    #[::tracing_test::traced_test]
  285    287   
    async fn rest_json_http_payload_traits_with_no_blob_body_request() {
  286    288   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  287    289   
        let config_builder = crate::config::Config::builder()
  288    290   
            .with_test_defaults()
  289         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         291  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         292  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         293  +
            .allow_no_auth()
  290    294   
            .endpoint_url("https://example.com");
  291    295   
  292    296   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  293    297   
        let result = client
  294    298   
            .http_payload_traits()
  295    299   
            .set_foo(::std::option::Option::Some("Foo".to_owned()))
  296    300   
            .send()
  297    301   
            .await;
  298    302   
        let _ = dbg!(result);
  299    303   
        let http_request = request_receiver.expect_request();

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/http_payload_traits_with_media_type.rs

@@ -229,229 +289,291 @@
  249    249   
mod http_payload_traits_with_media_type_test {
  250    250   
  251    251   
    /// Serializes a blob in the HTTP payload with a content-type
  252    252   
    /// Test ID: RestJsonHttpPayloadTraitsWithMediaTypeWithBlob
  253    253   
    #[::tokio::test]
  254    254   
    #[::tracing_test::traced_test]
  255    255   
    async fn rest_json_http_payload_traits_with_media_type_with_blob_request() {
  256    256   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  257    257   
        let config_builder = crate::config::Config::builder()
  258    258   
            .with_test_defaults()
  259         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         259  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         260  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         261  +
            .allow_no_auth()
  260    262   
            .endpoint_url("https://example.com");
  261    263   
  262    264   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  263    265   
        let result = client
  264    266   
            .http_payload_traits_with_media_type()
  265    267   
            .set_foo(::std::option::Option::Some("Foo".to_owned()))
  266    268   
            .set_blob(::std::option::Option::Some(::aws_smithy_types::Blob::new("blobby blob blob")))
  267    269   
            .send()
  268    270   
            .await;
  269    271   
        let _ = dbg!(result);

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/http_payload_with_structure.rs

@@ -224,224 +284,286 @@
  244    244   
mod http_payload_with_structure_test {
  245    245   
  246    246   
    /// Serializes a structure in the payload
  247    247   
    /// Test ID: RestJsonHttpPayloadWithStructure
  248    248   
    #[::tokio::test]
  249    249   
    #[::tracing_test::traced_test]
  250    250   
    async fn rest_json_http_payload_with_structure_request() {
  251    251   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  252    252   
        let config_builder = crate::config::Config::builder()
  253    253   
            .with_test_defaults()
  254         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         254  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         255  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         256  +
            .allow_no_auth()
  255    257   
            .endpoint_url("https://example.com");
  256    258   
  257    259   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  258    260   
        let result = client
  259    261   
            .http_payload_with_structure()
  260    262   
            .set_nested(::std::option::Option::Some(
  261    263   
                crate::types::NestedPayload::builder()
  262    264   
                    .set_greeting(::std::option::Option::Some("hello".to_owned()))
  263    265   
                    .set_name(::std::option::Option::Some("Phreddy".to_owned()))
  264    266   
                    .build(),

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/http_payload_with_union.rs

@@ -224,224 +318,322 @@
  244    244   
mod http_payload_with_union_test {
  245    245   
  246    246   
    /// Serializes a union in the payload.
  247    247   
    /// Test ID: RestJsonHttpPayloadWithUnion
  248    248   
    #[::tokio::test]
  249    249   
    #[::tracing_test::traced_test]
  250    250   
    async fn rest_json_http_payload_with_union_request() {
  251    251   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  252    252   
        let config_builder = crate::config::Config::builder()
  253    253   
            .with_test_defaults()
  254         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         254  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         255  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         256  +
            .allow_no_auth()
  255    257   
            .endpoint_url("https://example.com");
  256    258   
  257    259   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  258    260   
        let result = client
  259    261   
            .http_payload_with_union()
  260    262   
            .set_nested(::std::option::Option::Some(crate::types::UnionPayload::Greeting("hello".to_owned())))
  261    263   
            .send()
  262    264   
            .await;
  263    265   
        let _ = dbg!(result);
  264    266   
        let http_request = request_receiver.expect_request();
  265    267   
        let expected_headers = [("Content-Type", "application/json")];
  266    268   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
  267    269   
        let required_headers = &["Content-Length"];
  268    270   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::require_headers(http_request.headers(), required_headers));
  269    271   
        let body = http_request.body().bytes().expect("body should be strict");
  270    272   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
  271    273   
            body,
  272    274   
            "{\n    \"greeting\": \"hello\"\n}",
  273    275   
            ::aws_smithy_protocol_test::MediaType::from("application/json"),
  274    276   
        ));
  275    277   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  276    278   
        ::pretty_assertions::assert_eq!(http_request.method(), "PUT", "method was incorrect");
  277    279   
        ::pretty_assertions::assert_eq!(uri.path(), "/HttpPayloadWithUnion", "path was incorrect");
  278    280   
    }
  279    281   
  280    282   
    /// No payload is sent if the union has no value.
  281    283   
    /// Test ID: RestJsonHttpPayloadWithUnsetUnion
  282    284   
    #[::tokio::test]
  283    285   
    #[::tracing_test::traced_test]
  284    286   
    async fn rest_json_http_payload_with_unset_union_request() {
  285    287   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  286    288   
        let config_builder = crate::config::Config::builder()
  287    289   
            .with_test_defaults()
  288         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         290  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         291  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         292  +
            .allow_no_auth()
  289    293   
            .endpoint_url("https://example.com");
  290    294   
  291    295   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  292    296   
        let result = client.http_payload_with_union().send().await;
  293    297   
        let _ = dbg!(result);
  294    298   
        let http_request = request_receiver.expect_request();
  295    299   
        let body = http_request.body().bytes().expect("body should be strict");
  296    300   
        // No body.
  297    301   
        ::pretty_assertions::assert_eq!(&body, &::bytes::Bytes::new());
  298    302   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/http_prefix_headers.rs

@@ -219,219 +344,350 @@
  239    239   
mod http_prefix_headers_test {
  240    240   
  241    241   
    /// Adds headers by prefix
  242    242   
    /// Test ID: RestJsonHttpPrefixHeadersArePresent
  243    243   
    #[::tokio::test]
  244    244   
    #[::tracing_test::traced_test]
  245    245   
    async fn rest_json_http_prefix_headers_are_present_request() {
  246    246   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  247    247   
        let config_builder = crate::config::Config::builder()
  248    248   
            .with_test_defaults()
  249         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         249  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         250  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         251  +
            .allow_no_auth()
  250    252   
            .endpoint_url("https://example.com");
  251    253   
  252    254   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  253    255   
        let result = client
  254    256   
            .http_prefix_headers()
  255    257   
            .set_foo(::std::option::Option::Some("Foo".to_owned()))
  256    258   
            .set_foo_map(::std::option::Option::Some({
  257    259   
                let mut ret = ::std::collections::HashMap::new();
  258    260   
                ret.insert("abc".to_owned().to_ascii_lowercase(), "Abc value".to_owned());
  259    261   
                ret.insert("def".to_owned().to_ascii_lowercase(), "Def value".to_owned());
  260    262   
                ret
  261    263   
            }))
  262    264   
            .send()
  263    265   
            .await;
  264    266   
        let _ = dbg!(result);
  265    267   
        let http_request = request_receiver.expect_request();
  266    268   
        let expected_headers = [("x-foo", "Foo"), ("x-foo-abc", "Abc value"), ("x-foo-def", "Def value")];
  267    269   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
  268    270   
        let body = http_request.body().bytes().expect("body should be strict");
  269    271   
        // No body.
  270    272   
        ::pretty_assertions::assert_eq!(&body, &::bytes::Bytes::new());
  271    273   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  272    274   
        ::pretty_assertions::assert_eq!(http_request.method(), "GET", "method was incorrect");
  273    275   
        ::pretty_assertions::assert_eq!(uri.path(), "/HttpPrefixHeaders", "path was incorrect");
  274    276   
    }
  275    277   
  276    278   
    /// No prefix headers are serialized because the value is not present
  277    279   
    /// Test ID: RestJsonHttpPrefixHeadersAreNotPresent
  278    280   
    #[::tokio::test]
  279    281   
    #[::tracing_test::traced_test]
  280    282   
    async fn rest_json_http_prefix_headers_are_not_present_request() {
  281    283   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  282    284   
        let config_builder = crate::config::Config::builder()
  283    285   
            .with_test_defaults()
  284         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         286  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         287  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         288  +
            .allow_no_auth()
  285    289   
            .endpoint_url("https://example.com");
  286    290   
  287    291   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  288    292   
        let result = client
  289    293   
            .http_prefix_headers()
  290    294   
            .set_foo(::std::option::Option::Some("Foo".to_owned()))
  291    295   
            .set_foo_map(::std::option::Option::Some(::std::collections::HashMap::new()))
  292    296   
            .send()
  293    297   
            .await;
  294    298   
        let _ = dbg!(result);
  295    299   
        let http_request = request_receiver.expect_request();
  296    300   
        let expected_headers = [("x-foo", "Foo")];
  297    301   
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
  298    302   
        let body = http_request.body().bytes().expect("body should be strict");
  299    303   
        // No body.
  300    304   
        ::pretty_assertions::assert_eq!(&body, &::bytes::Bytes::new());
  301    305   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  302    306   
        ::pretty_assertions::assert_eq!(http_request.method(), "GET", "method was incorrect");
  303    307   
        ::pretty_assertions::assert_eq!(uri.path(), "/HttpPrefixHeaders", "path was incorrect");
  304    308   
    }
  305    309   
  306    310   
    /// Serialize prefix headers were the value is present but empty
  307    311   
    /// Test ID: RestJsonHttpPrefixEmptyHeaders
  308    312   
    #[::tokio::test]
  309    313   
    #[::tracing_test::traced_test]
  310    314   
    async fn rest_json_http_prefix_empty_headers_request() {
  311    315   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  312    316   
        let config_builder = crate::config::Config::builder()
  313    317   
            .with_test_defaults()
  314         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         318  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         319  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         320  +
            .allow_no_auth()
  315    321   
            .endpoint_url("https://example.com");
  316    322   
  317    323   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  318    324   
        let result = client
  319    325   
            .http_prefix_headers()
  320    326   
            .set_foo_map(::std::option::Option::Some({
  321    327   
                let mut ret = ::std::collections::HashMap::new();
  322    328   
                ret.insert("abc".to_owned().to_ascii_lowercase(), "".to_owned());
  323    329   
                ret
  324    330   
            }))

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/http_request_with_float_labels.rs

@@ -242,242 +366,372 @@
  262    262   
mod http_request_with_float_labels_test {
  263    263   
  264    264   
    /// Supports handling NaN float label values.
  265    265   
    /// Test ID: RestJsonSupportsNaNFloatLabels
  266    266   
    #[::tokio::test]
  267    267   
    #[::tracing_test::traced_test]
  268    268   
    async fn rest_json_supports_na_n_float_labels_request() {
  269    269   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  270    270   
        let config_builder = crate::config::Config::builder()
  271    271   
            .with_test_defaults()
  272         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         272  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         273  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         274  +
            .allow_no_auth()
  273    275   
            .endpoint_url("https://example.com");
  274    276   
  275    277   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  276    278   
        let result = client
  277    279   
            .http_request_with_float_labels()
  278    280   
            .set_float(::std::option::Option::Some(
  279    281   
                <f32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("NaN").expect("invalid string for number"),
  280    282   
            ))
  281    283   
            .set_double(::std::option::Option::Some(
  282    284   
                <f64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("NaN").expect("invalid string for number"),
  283    285   
            ))
  284    286   
            .send()
  285    287   
            .await;
  286    288   
        let _ = dbg!(result);
  287    289   
        let http_request = request_receiver.expect_request();
  288    290   
        let body = http_request.body().bytes().expect("body should be strict");
  289    291   
        // No body.
  290    292   
        ::pretty_assertions::assert_eq!(&body, &::bytes::Bytes::new());
  291    293   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  292    294   
        ::pretty_assertions::assert_eq!(http_request.method(), "GET", "method was incorrect");
  293    295   
        ::pretty_assertions::assert_eq!(uri.path(), "/FloatHttpLabels/NaN/NaN", "path was incorrect");
  294    296   
    }
  295    297   
  296    298   
    /// Supports handling Infinity float label values.
  297    299   
    /// Test ID: RestJsonSupportsInfinityFloatLabels
  298    300   
    #[::tokio::test]
  299    301   
    #[::tracing_test::traced_test]
  300    302   
    async fn rest_json_supports_infinity_float_labels_request() {
  301    303   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  302    304   
        let config_builder = crate::config::Config::builder()
  303    305   
            .with_test_defaults()
  304         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         306  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         307  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         308  +
            .allow_no_auth()
  305    309   
            .endpoint_url("https://example.com");
  306    310   
  307    311   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  308    312   
        let result = client
  309    313   
            .http_request_with_float_labels()
  310    314   
            .set_float(::std::option::Option::Some(
  311    315   
                <f32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("Infinity").expect("invalid string for number"),
  312    316   
            ))
  313    317   
            .set_double(::std::option::Option::Some(
  314    318   
                <f64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("Infinity").expect("invalid string for number"),
  315    319   
            ))
  316    320   
            .send()
  317    321   
            .await;
  318    322   
        let _ = dbg!(result);
  319    323   
        let http_request = request_receiver.expect_request();
  320    324   
        let body = http_request.body().bytes().expect("body should be strict");
  321    325   
        // No body.
  322    326   
        ::pretty_assertions::assert_eq!(&body, &::bytes::Bytes::new());
  323    327   
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
  324    328   
        ::pretty_assertions::assert_eq!(http_request.method(), "GET", "method was incorrect");
  325    329   
        ::pretty_assertions::assert_eq!(uri.path(), "/FloatHttpLabels/Infinity/Infinity", "path was incorrect");
  326    330   
    }
  327    331   
  328    332   
    /// Supports handling -Infinity float label values.
  329    333   
    /// Test ID: RestJsonSupportsNegativeInfinityFloatLabels
  330    334   
    #[::tokio::test]
  331    335   
    #[::tracing_test::traced_test]
  332    336   
    async fn rest_json_supports_negative_infinity_float_labels_request() {
  333    337   
        let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
  334    338   
        let config_builder = crate::config::Config::builder()
  335    339   
            .with_test_defaults()
  336         -
            .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
         340  +
            // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
         341  +
            //  Until the incorrect separation is addressed, we need to rely on this workaround.
         342  +
            .allow_no_auth()
  337    343   
            .endpoint_url("https://example.com");
  338    344   
  339    345   
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
  340    346   
        let result = client
  341    347   
            .http_request_with_float_labels()
  342    348   
            .set_float(::std::option::Option::Some(
  343    349   
                <f32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("-Infinity").expect("invalid string for number"),
  344    350   
            ))
  345    351   
            .set_double(::std::option::Option::Some(
  346    352   
                <f64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("-Infinity").expect("invalid string for number"),