497 499 | }
|
498 500 |
|
499 501 | /// Handles query string maps
|
500 502 | /// Test ID: RestXmlQueryStringMap
|
501 503 | #[::tokio::test]
|
502 504 | #[::tracing_test::traced_test]
|
503 505 | async fn rest_xml_query_string_map_request() {
|
504 506 | let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
|
505 507 | let config_builder = crate::config::Config::builder()
|
506 508 | .with_test_defaults()
|
507 - | .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
|
509 + | // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
|
510 + | // Until the incorrect separation is addressed, we need to rely on this workaround.
|
511 + | .allow_no_auth()
|
508 512 | .endpoint_url("https://example.com");
|
509 513 |
|
510 514 | let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
|
511 515 | let result = client
|
512 516 | .all_query_string_types()
|
513 517 | .set_query_params_map_of_strings(::std::option::Option::Some({
|
514 518 | let mut ret = ::std::collections::HashMap::new();
|
515 519 | ret.insert("QueryParamsStringKeyA".to_owned(), "Foo".to_owned());
|
516 520 | ret.insert("QueryParamsStringKeyB".to_owned(), "Bar".to_owned());
|
517 521 | ret
|
518 522 | }))
|
519 523 | .send()
|
520 524 | .await;
|
521 525 | let _ = dbg!(result);
|
522 526 | let http_request = request_receiver.expect_request();
|
523 527 | let expected_query_params = &["QueryParamsStringKeyA=Foo", "QueryParamsStringKeyB=Bar"];
|
524 528 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_query_string(&http_request, expected_query_params));
|
525 529 | let body = http_request.body().bytes().expect("body should be strict");
|
526 530 | // No body.
|
527 531 | ::pretty_assertions::assert_eq!(&body, &::bytes::Bytes::new());
|
528 532 | let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
|
529 533 | ::pretty_assertions::assert_eq!(http_request.method(), "GET", "method was incorrect");
|
530 534 | ::pretty_assertions::assert_eq!(uri.path(), "/AllQueryStringTypesInput", "path was incorrect");
|
531 535 | }
|
532 536 |
|
533 537 | /// Handles escaping all required characters in the query string.
|
534 538 | /// Test ID: RestXmlQueryStringEscaping
|
535 539 | #[::tokio::test]
|
536 540 | #[::tracing_test::traced_test]
|
537 541 | async fn rest_xml_query_string_escaping_request() {
|
538 542 | let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
|
539 543 | let config_builder = crate::config::Config::builder()
|
540 544 | .with_test_defaults()
|
541 - | .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
|
545 + | // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
|
546 + | // Until the incorrect separation is addressed, we need to rely on this workaround.
|
547 + | .allow_no_auth()
|
542 548 | .endpoint_url("https://example.com");
|
543 549 |
|
544 550 | let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
|
545 551 | let result = client
|
546 552 | .all_query_string_types()
|
547 553 | .set_query_string(::std::option::Option::Some(" %:/?#[]@!$&'()*+,;=😹".to_owned()))
|
548 554 | .send()
|
549 555 | .await;
|
550 556 | let _ = dbg!(result);
|
551 557 | let http_request = request_receiver.expect_request();
|
552 558 | 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"];
|
553 559 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_query_string(&http_request, expected_query_params));
|
554 560 | let body = http_request.body().bytes().expect("body should be strict");
|
555 561 | // No body.
|
556 562 | ::pretty_assertions::assert_eq!(&body, &::bytes::Bytes::new());
|
557 563 | let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
|
558 564 | ::pretty_assertions::assert_eq!(http_request.method(), "GET", "method was incorrect");
|
559 565 | ::pretty_assertions::assert_eq!(uri.path(), "/AllQueryStringTypesInput", "path was incorrect");
|
560 566 | }
|
561 567 |
|
562 568 | /// Supports handling NaN float query values.
|
563 569 | /// Test ID: RestXmlSupportsNaNFloatQueryValues
|
564 570 | #[::tokio::test]
|
565 571 | #[::tracing_test::traced_test]
|
566 572 | async fn rest_xml_supports_na_n_float_query_values_request() {
|
567 573 | let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
|
568 574 | let config_builder = crate::config::Config::builder()
|
569 575 | .with_test_defaults()
|
570 - | .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
|
576 + | // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
|
577 + | // Until the incorrect separation is addressed, we need to rely on this workaround.
|
578 + | .allow_no_auth()
|
571 579 | .endpoint_url("https://example.com");
|
572 580 |
|
573 581 | let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
|
574 582 | let result = client
|
575 583 | .all_query_string_types()
|
576 584 | .set_query_float(::std::option::Option::Some(
|
577 585 | <f32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("NaN").expect("invalid string for number"),
|
578 586 | ))
|
579 587 | .set_query_double(::std::option::Option::Some(
|
580 588 | <f64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("NaN").expect("invalid string for number"),
|
581 589 | ))
|
582 590 | .send()
|
583 591 | .await;
|
584 592 | let _ = dbg!(result);
|
585 593 | let http_request = request_receiver.expect_request();
|
586 594 | let expected_query_params = &["Float=NaN", "Double=NaN"];
|
587 595 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_query_string(&http_request, expected_query_params));
|
588 596 | let body = http_request.body().bytes().expect("body should be strict");
|
589 597 | // No body.
|
590 598 | ::pretty_assertions::assert_eq!(&body, &::bytes::Bytes::new());
|
591 599 | let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
|
592 600 | ::pretty_assertions::assert_eq!(http_request.method(), "GET", "method was incorrect");
|
593 601 | ::pretty_assertions::assert_eq!(uri.path(), "/AllQueryStringTypesInput", "path was incorrect");
|
594 602 | }
|
595 603 |
|
596 604 | /// Supports handling Infinity float query values.
|
597 605 | /// Test ID: RestXmlSupportsInfinityFloatQueryValues
|
598 606 | #[::tokio::test]
|
599 607 | #[::tracing_test::traced_test]
|
600 608 | async fn rest_xml_supports_infinity_float_query_values_request() {
|
601 609 | let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
|
602 610 | let config_builder = crate::config::Config::builder()
|
603 611 | .with_test_defaults()
|
604 - | .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
|
612 + | // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
|
613 + | // Until the incorrect separation is addressed, we need to rely on this workaround.
|
614 + | .allow_no_auth()
|
605 615 | .endpoint_url("https://example.com");
|
606 616 |
|
607 617 | let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
|
608 618 | let result = client
|
609 619 | .all_query_string_types()
|
610 620 | .set_query_float(::std::option::Option::Some(
|
611 621 | <f32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("Infinity").expect("invalid string for number"),
|
612 622 | ))
|
613 623 | .set_query_double(::std::option::Option::Some(
|
614 624 | <f64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("Infinity").expect("invalid string for number"),
|
615 625 | ))
|
616 626 | .send()
|
617 627 | .await;
|
618 628 | let _ = dbg!(result);
|
619 629 | let http_request = request_receiver.expect_request();
|
620 630 | let expected_query_params = &["Float=Infinity", "Double=Infinity"];
|
621 631 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_query_string(&http_request, expected_query_params));
|
622 632 | let body = http_request.body().bytes().expect("body should be strict");
|
623 633 | // No body.
|
624 634 | ::pretty_assertions::assert_eq!(&body, &::bytes::Bytes::new());
|
625 635 | let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
|
626 636 | ::pretty_assertions::assert_eq!(http_request.method(), "GET", "method was incorrect");
|
627 637 | ::pretty_assertions::assert_eq!(uri.path(), "/AllQueryStringTypesInput", "path was incorrect");
|
628 638 | }
|
629 639 |
|
630 640 | /// Supports handling -Infinity float query values.
|
631 641 | /// Test ID: RestXmlSupportsNegativeInfinityFloatQueryValues
|
632 642 | #[::tokio::test]
|
633 643 | #[::tracing_test::traced_test]
|
634 644 | async fn rest_xml_supports_negative_infinity_float_query_values_request() {
|
635 645 | let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
|
636 646 | let config_builder = crate::config::Config::builder()
|
637 647 | .with_test_defaults()
|
638 - | .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
|
648 + | // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
|
649 + | // Until the incorrect separation is addressed, we need to rely on this workaround.
|
650 + | .allow_no_auth()
|
639 651 | .endpoint_url("https://example.com");
|
640 652 |
|
641 653 | let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
|
642 654 | let result = client
|
643 655 | .all_query_string_types()
|
644 656 | .set_query_float(::std::option::Option::Some(
|
645 657 | <f32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("-Infinity").expect("invalid string for number"),
|
646 658 | ))
|
647 659 | .set_query_double(::std::option::Option::Some(
|
648 660 | <f64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("-Infinity").expect("invalid string for number"),
|
649 661 | ))
|
650 662 | .send()
|
651 663 | .await;
|
652 664 | let _ = dbg!(result);
|
653 665 | let http_request = request_receiver.expect_request();
|
654 666 | let expected_query_params = &["Float=-Infinity", "Double=-Infinity"];
|
655 667 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_query_string(&http_request, expected_query_params));
|
656 668 | let body = http_request.body().bytes().expect("body should be strict");
|
657 669 | // No body.
|
658 670 | ::pretty_assertions::assert_eq!(&body, &::bytes::Bytes::new());
|
659 671 | let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
|
660 672 | ::pretty_assertions::assert_eq!(http_request.method(), "GET", "method was incorrect");
|
661 673 | ::pretty_assertions::assert_eq!(uri.path(), "/AllQueryStringTypesInput", "path was incorrect");
|
662 674 | }
|
663 675 |
|
664 676 | /// Query values of 0 and false are serialized
|
665 677 | /// Test ID: RestXmlZeroAndFalseQueryValues
|
666 678 | #[::tokio::test]
|
667 679 | #[::tracing_test::traced_test]
|
668 680 | async fn rest_xml_zero_and_false_query_values_request() {
|
669 681 | let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
|
670 682 | let config_builder = crate::config::Config::builder()
|
671 683 | .with_test_defaults()
|
672 - | .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
|
684 + | // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
|
685 + | // Until the incorrect separation is addressed, we need to rely on this workaround.
|
686 + | .allow_no_auth()
|
673 687 | .endpoint_url("https://example.com");
|
674 688 |
|
675 689 | let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
|
676 690 | let result = client
|
677 691 | .all_query_string_types()
|
678 692 | .set_query_integer(::std::option::Option::Some(0))
|
679 693 | .set_query_boolean(::std::option::Option::Some(false))
|
680 694 | .send()
|
681 695 | .await;
|
682 696 | let _ = dbg!(result);
|