531 533 | }
|
532 534 |
|
533 535 | /// Handles query string maps
|
534 536 | /// Test ID: RestJsonQueryStringMap
|
535 537 | #[::tokio::test]
|
536 538 | #[::tracing_test::traced_test]
|
537 539 | async fn rest_json_query_string_map_request() {
|
538 540 | let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
|
539 541 | let config_builder = crate::config::Config::builder()
|
540 542 | .with_test_defaults()
|
541 - | .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
|
543 + | // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
|
544 + | // Until the incorrect separation is addressed, we need to rely on this workaround.
|
545 + | .allow_no_auth()
|
542 546 | .endpoint_url("https://example.com");
|
543 547 |
|
544 548 | let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
|
545 549 | let result = client
|
546 550 | .all_query_string_types()
|
547 551 | .set_query_params_map_of_string_list(::std::option::Option::Some({
|
548 552 | let mut ret = ::std::collections::HashMap::new();
|
549 553 | ret.insert("QueryParamsStringKeyA".to_owned(), vec!["Foo".to_owned()]);
|
550 554 | ret.insert("QueryParamsStringKeyB".to_owned(), vec!["Bar".to_owned()]);
|
551 555 | ret
|
552 556 | }))
|
553 557 | .send()
|
554 558 | .await;
|
555 559 | let _ = dbg!(result);
|
556 560 | let http_request = request_receiver.expect_request();
|
557 561 | let expected_query_params = &["QueryParamsStringKeyA=Foo", "QueryParamsStringKeyB=Bar"];
|
558 562 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_query_string(&http_request, expected_query_params));
|
559 563 | let body = http_request.body().bytes().expect("body should be strict");
|
560 564 | // No body.
|
561 565 | ::pretty_assertions::assert_eq!(&body, &::bytes::Bytes::new());
|
562 566 | let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
|
563 567 | ::pretty_assertions::assert_eq!(http_request.method(), "GET", "method was incorrect");
|
564 568 | ::pretty_assertions::assert_eq!(uri.path(), "/AllQueryStringTypesInput", "path was incorrect");
|
565 569 | }
|
566 570 |
|
567 571 | /// Handles escaping all required characters in the query string.
|
568 572 | /// Test ID: RestJsonQueryStringEscaping
|
569 573 | #[::tokio::test]
|
570 574 | #[::tracing_test::traced_test]
|
571 575 | async fn rest_json_query_string_escaping_request() {
|
572 576 | let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
|
573 577 | let config_builder = crate::config::Config::builder()
|
574 578 | .with_test_defaults()
|
575 - | .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
|
579 + | // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
|
580 + | // Until the incorrect separation is addressed, we need to rely on this workaround.
|
581 + | .allow_no_auth()
|
576 582 | .endpoint_url("https://example.com");
|
577 583 |
|
578 584 | let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
|
579 585 | let result = client
|
580 586 | .all_query_string_types()
|
581 587 | .set_query_string(::std::option::Option::Some(" %:/?#[]@!$&'()*+,;=😹".to_owned()))
|
582 588 | .set_query_params_map_of_string_list(::std::option::Option::Some({
|
583 589 | let mut ret = ::std::collections::HashMap::new();
|
584 590 | ret.insert("String".to_owned(), vec![" %:/?#[]@!$&'()*+,;=😹".to_owned()]);
|
585 591 | ret
|
586 592 | }))
|
587 593 | .send()
|
588 594 | .await;
|
589 595 | let _ = dbg!(result);
|
590 596 | let http_request = request_receiver.expect_request();
|
591 597 | 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"];
|
592 598 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_query_string(&http_request, expected_query_params));
|
593 599 | let body = http_request.body().bytes().expect("body should be strict");
|
594 600 | // No body.
|
595 601 | ::pretty_assertions::assert_eq!(&body, &::bytes::Bytes::new());
|
596 602 | let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
|
597 603 | ::pretty_assertions::assert_eq!(http_request.method(), "GET", "method was incorrect");
|
598 604 | ::pretty_assertions::assert_eq!(uri.path(), "/AllQueryStringTypesInput", "path was incorrect");
|
599 605 | }
|
600 606 |
|
601 607 | /// Supports handling NaN float query values.
|
602 608 | /// Test ID: RestJsonSupportsNaNFloatQueryValues
|
603 609 | #[::tokio::test]
|
604 610 | #[::tracing_test::traced_test]
|
605 611 | async fn rest_json_supports_na_n_float_query_values_request() {
|
606 612 | let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
|
607 613 | let config_builder = crate::config::Config::builder()
|
608 614 | .with_test_defaults()
|
609 - | .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
|
615 + | // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
|
616 + | // Until the incorrect separation is addressed, we need to rely on this workaround.
|
617 + | .allow_no_auth()
|
610 618 | .endpoint_url("https://example.com");
|
611 619 |
|
612 620 | let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
|
613 621 | let result = client
|
614 622 | .all_query_string_types()
|
615 623 | .set_query_float(::std::option::Option::Some(
|
616 624 | <f32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("NaN").expect("invalid string for number"),
|
617 625 | ))
|
618 626 | .set_query_double(::std::option::Option::Some(
|
619 627 | <f64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("NaN").expect("invalid string for number"),
|
620 628 | ))
|
621 629 | .set_query_params_map_of_string_list(::std::option::Option::Some({
|
622 630 | let mut ret = ::std::collections::HashMap::new();
|
623 631 | ret.insert("Float".to_owned(), vec!["NaN".to_owned()]);
|
624 632 | ret.insert("Double".to_owned(), vec!["NaN".to_owned()]);
|
625 633 | ret
|
626 634 | }))
|
627 635 | .send()
|
628 636 | .await;
|
629 637 | let _ = dbg!(result);
|
630 638 | let http_request = request_receiver.expect_request();
|
631 639 | let expected_query_params = &["Float=NaN", "Double=NaN"];
|
632 640 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_query_string(&http_request, expected_query_params));
|
633 641 | let body = http_request.body().bytes().expect("body should be strict");
|
634 642 | // No body.
|
635 643 | ::pretty_assertions::assert_eq!(&body, &::bytes::Bytes::new());
|
636 644 | let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
|
637 645 | ::pretty_assertions::assert_eq!(http_request.method(), "GET", "method was incorrect");
|
638 646 | ::pretty_assertions::assert_eq!(uri.path(), "/AllQueryStringTypesInput", "path was incorrect");
|
639 647 | }
|
640 648 |
|
641 649 | /// Supports handling Infinity float query values.
|
642 650 | /// Test ID: RestJsonSupportsInfinityFloatQueryValues
|
643 651 | #[::tokio::test]
|
644 652 | #[::tracing_test::traced_test]
|
645 653 | async fn rest_json_supports_infinity_float_query_values_request() {
|
646 654 | let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
|
647 655 | let config_builder = crate::config::Config::builder()
|
648 656 | .with_test_defaults()
|
649 - | .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
|
657 + | // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
|
658 + | // Until the incorrect separation is addressed, we need to rely on this workaround.
|
659 + | .allow_no_auth()
|
650 660 | .endpoint_url("https://example.com");
|
651 661 |
|
652 662 | let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
|
653 663 | let result = client
|
654 664 | .all_query_string_types()
|
655 665 | .set_query_float(::std::option::Option::Some(
|
656 666 | <f32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("Infinity").expect("invalid string for number"),
|
657 667 | ))
|
658 668 | .set_query_double(::std::option::Option::Some(
|
659 669 | <f64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("Infinity").expect("invalid string for number"),
|
660 670 | ))
|
661 671 | .set_query_params_map_of_string_list(::std::option::Option::Some({
|
662 672 | let mut ret = ::std::collections::HashMap::new();
|
663 673 | ret.insert("Float".to_owned(), vec!["Infinity".to_owned()]);
|
664 674 | ret.insert("Double".to_owned(), vec!["Infinity".to_owned()]);
|
665 675 | ret
|
666 676 | }))
|
667 677 | .send()
|
668 678 | .await;
|
669 679 | let _ = dbg!(result);
|
670 680 | let http_request = request_receiver.expect_request();
|
671 681 | let expected_query_params = &["Float=Infinity", "Double=Infinity"];
|
672 682 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_query_string(&http_request, expected_query_params));
|
673 683 | let body = http_request.body().bytes().expect("body should be strict");
|
674 684 | // No body.
|
675 685 | ::pretty_assertions::assert_eq!(&body, &::bytes::Bytes::new());
|
676 686 | let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
|
677 687 | ::pretty_assertions::assert_eq!(http_request.method(), "GET", "method was incorrect");
|
678 688 | ::pretty_assertions::assert_eq!(uri.path(), "/AllQueryStringTypesInput", "path was incorrect");
|
679 689 | }
|
680 690 |
|
681 691 | /// Supports handling -Infinity float query values.
|
682 692 | /// Test ID: RestJsonSupportsNegativeInfinityFloatQueryValues
|
683 693 | #[::tokio::test]
|
684 694 | #[::tracing_test::traced_test]
|
685 695 | async fn rest_json_supports_negative_infinity_float_query_values_request() {
|
686 696 | let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
|
687 697 | let config_builder = crate::config::Config::builder()
|
688 698 | .with_test_defaults()
|
689 - | .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
|
699 + | // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
|
700 + | // Until the incorrect separation is addressed, we need to rely on this workaround.
|
701 + | .allow_no_auth()
|
690 702 | .endpoint_url("https://example.com");
|
691 703 |
|
692 704 | let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
|
693 705 | let result = client
|
694 706 | .all_query_string_types()
|
695 707 | .set_query_float(::std::option::Option::Some(
|
696 708 | <f32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("-Infinity").expect("invalid string for number"),
|
697 709 | ))
|
698 710 | .set_query_double(::std::option::Option::Some(
|
699 711 | <f64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("-Infinity").expect("invalid string for number"),
|
700 712 | ))
|
701 713 | .set_query_params_map_of_string_list(::std::option::Option::Some({
|
702 714 | let mut ret = ::std::collections::HashMap::new();
|
703 715 | ret.insert("Float".to_owned(), vec!["-Infinity".to_owned()]);
|
704 716 | ret.insert("Double".to_owned(), vec!["-Infinity".to_owned()]);
|
705 717 | ret
|
706 718 | }))
|
707 719 | .send()
|
708 720 | .await;
|
709 721 | let _ = dbg!(result);
|
710 722 | let http_request = request_receiver.expect_request();
|
711 723 | let expected_query_params = &["Float=-Infinity", "Double=-Infinity"];
|
712 724 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_query_string(&http_request, expected_query_params));
|
713 725 | let body = http_request.body().bytes().expect("body should be strict");
|
714 726 | // No body.
|
715 727 | ::pretty_assertions::assert_eq!(&body, &::bytes::Bytes::new());
|
716 728 | let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
|
717 729 | ::pretty_assertions::assert_eq!(http_request.method(), "GET", "method was incorrect");
|
718 730 | ::pretty_assertions::assert_eq!(uri.path(), "/AllQueryStringTypesInput", "path was incorrect");
|
719 731 | }
|
720 732 |
|
721 733 | /// Query values of 0 and false are serialized
|
722 734 | /// Test ID: RestJsonZeroAndFalseQueryValues
|
723 735 | #[::tokio::test]
|
724 736 | #[::tracing_test::traced_test]
|
725 737 | async fn rest_json_zero_and_false_query_values_request() {
|
726 738 | let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
|
727 739 | let config_builder = crate::config::Config::builder()
|
728 740 | .with_test_defaults()
|
729 - | .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
|
741 + | // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
|
742 + | // Until the incorrect separation is addressed, we need to rely on this workaround.
|
743 + | .allow_no_auth()
|
730 744 | .endpoint_url("https://example.com");
|
731 745 |
|
732 746 | let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
|
733 747 | let result = client
|
734 748 | .all_query_string_types()
|
735 749 | .set_query_integer(::std::option::Option::Some(0))
|
736 750 | .set_query_boolean(::std::option::Option::Some(false))
|
737 751 | .set_query_params_map_of_string_list(::std::option::Option::Some({
|
738 752 | let mut ret = ::std::collections::HashMap::new();
|
739 753 | ret.insert("Integer".to_owned(), vec!["0".to_owned()]);
|