238 238 | mod simple_input_params_test {
|
239 239 |
|
240 240 | /// Serializes strings
|
241 241 | /// Test ID: Ec2SimpleInputParamsStrings
|
242 242 | #[::tokio::test]
|
243 243 | #[::tracing_test::traced_test]
|
244 244 | async fn ec2_simple_input_params_strings_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");
|
250 252 |
|
251 253 | let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
|
252 254 | let result = client
|
253 255 | .simple_input_params()
|
254 256 | .set_foo(::std::option::Option::Some("val1".to_owned()))
|
255 257 | .set_bar(::std::option::Option::Some("val2".to_owned()))
|
256 258 | .send()
|
257 259 | .await;
|
258 260 | let _ = dbg!(result);
|
259 261 | let http_request = request_receiver.expect_request();
|
260 262 | let expected_headers = [("Content-Type", "application/x-www-form-urlencoded")];
|
261 263 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
|
262 264 | let required_headers = &["Content-Length"];
|
263 265 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::require_headers(http_request.headers(), required_headers));
|
264 266 | let body = http_request.body().bytes().expect("body should be strict");
|
265 267 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
|
266 268 | body,
|
267 269 | "Action=SimpleInputParams&Version=2020-01-08&Foo=val1&Bar=val2",
|
268 270 | ::aws_smithy_protocol_test::MediaType::from("application/x-www-form-urlencoded"),
|
269 271 | ));
|
270 272 | let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
|
271 273 | ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
|
272 274 | ::pretty_assertions::assert_eq!(uri.path(), "/", "path was incorrect");
|
273 275 | }
|
274 276 |
|
275 277 | /// Serializes booleans that are true
|
276 278 | /// Test ID: Ec2SimpleInputParamsStringAndBooleanTrue
|
277 279 | #[::tokio::test]
|
278 280 | #[::tracing_test::traced_test]
|
279 281 | async fn ec2_simple_input_params_string_and_boolean_true_request() {
|
280 282 | let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
|
281 283 | let config_builder = crate::config::Config::builder()
|
282 284 | .with_test_defaults()
|
283 - | .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
|
285 + | // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
|
286 + | // Until the incorrect separation is addressed, we need to rely on this workaround.
|
287 + | .allow_no_auth()
|
284 288 | .endpoint_url("https://example.com");
|
285 289 |
|
286 290 | let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
|
287 291 | let result = client
|
288 292 | .simple_input_params()
|
289 293 | .set_foo(::std::option::Option::Some("val1".to_owned()))
|
290 294 | .set_baz(::std::option::Option::Some(true))
|
291 295 | .send()
|
292 296 | .await;
|
293 297 | let _ = dbg!(result);
|
294 298 | let http_request = request_receiver.expect_request();
|
295 299 | let expected_headers = [("Content-Type", "application/x-www-form-urlencoded")];
|
296 300 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
|
297 301 | let required_headers = &["Content-Length"];
|
298 302 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::require_headers(http_request.headers(), required_headers));
|
299 303 | let body = http_request.body().bytes().expect("body should be strict");
|
300 304 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
|
301 305 | body,
|
302 306 | "Action=SimpleInputParams&Version=2020-01-08&Foo=val1&Baz=true",
|
303 307 | ::aws_smithy_protocol_test::MediaType::from("application/x-www-form-urlencoded"),
|
304 308 | ));
|
305 309 | let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
|
306 310 | ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
|
307 311 | ::pretty_assertions::assert_eq!(uri.path(), "/", "path was incorrect");
|
308 312 | }
|
309 313 |
|
310 314 | /// Serializes booleans that are false
|
311 315 | /// Test ID: Ec2SimpleInputParamsStringsAndBooleanFalse
|
312 316 | #[::tokio::test]
|
313 317 | #[::tracing_test::traced_test]
|
314 318 | async fn ec2_simple_input_params_strings_and_boolean_false_request() {
|
315 319 | let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
|
316 320 | let config_builder = crate::config::Config::builder()
|
317 321 | .with_test_defaults()
|
318 - | .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
|
322 + | // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
|
323 + | // Until the incorrect separation is addressed, we need to rely on this workaround.
|
324 + | .allow_no_auth()
|
319 325 | .endpoint_url("https://example.com");
|
320 326 |
|
321 327 | let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
|
322 328 | let result = client.simple_input_params().set_baz(::std::option::Option::Some(false)).send().await;
|
323 329 | let _ = dbg!(result);
|
324 330 | let http_request = request_receiver.expect_request();
|
325 331 | let expected_headers = [("Content-Type", "application/x-www-form-urlencoded")];
|
326 332 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
|
327 333 | let required_headers = &["Content-Length"];
|
328 334 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::require_headers(http_request.headers(), required_headers));
|
329 335 | let body = http_request.body().bytes().expect("body should be strict");
|
330 336 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
|
331 337 | body,
|
332 338 | "Action=SimpleInputParams&Version=2020-01-08&Baz=false",
|
333 339 | ::aws_smithy_protocol_test::MediaType::from("application/x-www-form-urlencoded"),
|
334 340 | ));
|
335 341 | let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
|
336 342 | ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
|
337 343 | ::pretty_assertions::assert_eq!(uri.path(), "/", "path was incorrect");
|
338 344 | }
|
339 345 |
|
340 346 | /// Serializes integers
|
341 347 | /// Test ID: Ec2SimpleInputParamsInteger
|
342 348 | #[::tokio::test]
|
343 349 | #[::tracing_test::traced_test]
|
344 350 | async fn ec2_simple_input_params_integer_request() {
|
345 351 | let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
|
346 352 | let config_builder = crate::config::Config::builder()
|
347 353 | .with_test_defaults()
|
348 - | .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
|
354 + | // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
|
355 + | // Until the incorrect separation is addressed, we need to rely on this workaround.
|
356 + | .allow_no_auth()
|
349 357 | .endpoint_url("https://example.com");
|
350 358 |
|
351 359 | let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
|
352 360 | let result = client.simple_input_params().set_bam(::std::option::Option::Some(10)).send().await;
|
353 361 | let _ = dbg!(result);
|
354 362 | let http_request = request_receiver.expect_request();
|
355 363 | let expected_headers = [("Content-Type", "application/x-www-form-urlencoded")];
|
356 364 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
|
357 365 | let required_headers = &["Content-Length"];
|
358 366 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::require_headers(http_request.headers(), required_headers));
|
359 367 | let body = http_request.body().bytes().expect("body should be strict");
|
360 368 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
|
361 369 | body,
|
362 370 | "Action=SimpleInputParams&Version=2020-01-08&Bam=10",
|
363 371 | ::aws_smithy_protocol_test::MediaType::from("application/x-www-form-urlencoded"),
|
364 372 | ));
|
365 373 | let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
|
366 374 | ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
|
367 375 | ::pretty_assertions::assert_eq!(uri.path(), "/", "path was incorrect");
|
368 376 | }
|
369 377 |
|
370 378 | /// Serializes floats
|
371 379 | /// Test ID: Ec2SimpleInputParamsFloat
|
372 380 | #[::tokio::test]
|
373 381 | #[::tracing_test::traced_test]
|
374 382 | async fn ec2_simple_input_params_float_request() {
|
375 383 | let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
|
376 384 | let config_builder = crate::config::Config::builder()
|
377 385 | .with_test_defaults()
|
378 - | .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
|
386 + | // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
|
387 + | // Until the incorrect separation is addressed, we need to rely on this workaround.
|
388 + | .allow_no_auth()
|
379 389 | .endpoint_url("https://example.com");
|
380 390 |
|
381 391 | let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
|
382 392 | let result = client.simple_input_params().set_boo(::std::option::Option::Some(10.8_f64)).send().await;
|
383 393 | let _ = dbg!(result);
|
384 394 | let http_request = request_receiver.expect_request();
|
385 395 | let expected_headers = [("Content-Type", "application/x-www-form-urlencoded")];
|
386 396 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
|
387 397 | let required_headers = &["Content-Length"];
|
388 398 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::require_headers(http_request.headers(), required_headers));
|
389 399 | let body = http_request.body().bytes().expect("body should be strict");
|
390 400 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
|
391 401 | body,
|
392 402 | "Action=SimpleInputParams&Version=2020-01-08&Boo=10.8",
|
393 403 | ::aws_smithy_protocol_test::MediaType::from("application/x-www-form-urlencoded"),
|
394 404 | ));
|
395 405 | let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
|
396 406 | ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
|
397 407 | ::pretty_assertions::assert_eq!(uri.path(), "/", "path was incorrect");
|
398 408 | }
|
399 409 |
|
400 410 | /// Blobs are base64 encoded in the query string
|
401 411 | /// Test ID: Ec2SimpleInputParamsBlob
|
402 412 | #[::tokio::test]
|
403 413 | #[::tracing_test::traced_test]
|
404 414 | async fn ec2_simple_input_params_blob_request() {
|
405 415 | let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
|
406 416 | let config_builder = crate::config::Config::builder()
|
407 417 | .with_test_defaults()
|
408 - | .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
|
418 + | // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
|
419 + | // Until the incorrect separation is addressed, we need to rely on this workaround.
|
420 + | .allow_no_auth()
|
409 421 | .endpoint_url("https://example.com");
|
410 422 |
|
411 423 | let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
|
412 424 | let result = client
|
413 425 | .simple_input_params()
|
414 426 | .set_qux(::std::option::Option::Some(::aws_smithy_types::Blob::new("value")))
|
415 427 | .send()
|
416 428 | .await;
|
417 429 | let _ = dbg!(result);
|
418 430 | let http_request = request_receiver.expect_request();
|
419 431 | let expected_headers = [("Content-Type", "application/x-www-form-urlencoded")];
|
420 432 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
|
421 433 | let required_headers = &["Content-Length"];
|
422 434 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::require_headers(http_request.headers(), required_headers));
|
423 435 | let body = http_request.body().bytes().expect("body should be strict");
|
424 436 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
|
425 437 | body,
|
426 438 | "Action=SimpleInputParams&Version=2020-01-08&Qux=dmFsdWU%3D",
|
427 439 | ::aws_smithy_protocol_test::MediaType::from("application/x-www-form-urlencoded"),
|
428 440 | ));
|
429 441 | let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
|
430 442 | ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
|
431 443 | ::pretty_assertions::assert_eq!(uri.path(), "/", "path was incorrect");
|
432 444 | }
|
433 445 |
|
434 446 | /// Serializes enums in the query string
|
435 447 | /// Test ID: Ec2Enums
|
436 448 | #[::tokio::test]
|
437 449 | #[::tracing_test::traced_test]
|
438 450 | async fn ec2_enums_request() {
|
439 451 | let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
|
440 452 | let config_builder = crate::config::Config::builder()
|
441 453 | .with_test_defaults()
|
442 - | .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
|
454 + | // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
|
455 + | // Until the incorrect separation is addressed, we need to rely on this workaround.
|
456 + | .allow_no_auth()
|
443 457 | .endpoint_url("https://example.com");
|
444 458 |
|
445 459 | let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
|
446 460 | let result = client
|
447 461 | .simple_input_params()
|
448 462 | .set_foo_enum(::std::option::Option::Some(
|
449 463 | "Foo".parse::<crate::types::FooEnum>().expect("static value validated to member"),
|
450 464 | ))
|
451 465 | .send()
|
452 466 | .await;
|
453 467 | let _ = dbg!(result);
|
454 468 | let http_request = request_receiver.expect_request();
|
455 469 | let expected_headers = [("Content-Type", "application/x-www-form-urlencoded")];
|
456 470 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
|
457 471 | let required_headers = &["Content-Length"];
|
458 472 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::require_headers(http_request.headers(), required_headers));
|
459 473 | let body = http_request.body().bytes().expect("body should be strict");
|
460 474 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
|
461 475 | body,
|
462 476 | "Action=SimpleInputParams&Version=2020-01-08&FooEnum=Foo",
|
463 477 | ::aws_smithy_protocol_test::MediaType::from("application/x-www-form-urlencoded"),
|
464 478 | ));
|
465 479 | let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
|
466 480 | ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
|
467 481 | ::pretty_assertions::assert_eq!(uri.path(), "/", "path was incorrect");
|
468 482 | }
|
469 483 |
|
470 484 | /// Serializes query using ec2QueryName trait.
|
471 485 | /// Test ID: Ec2Query
|
472 486 | #[::tokio::test]
|
473 487 | #[::tracing_test::traced_test]
|
474 488 | async fn ec2_query_request() {
|
475 489 | let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
|
476 490 | let config_builder = crate::config::Config::builder()
|
477 491 | .with_test_defaults()
|
478 - | .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
|
492 + | // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
|
493 + | // Until the incorrect separation is addressed, we need to rely on this workaround.
|
494 + | .allow_no_auth()
|
479 495 | .endpoint_url("https://example.com");
|
480 496 |
|
481 497 | let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
|
482 498 | let result = client
|
483 499 | .simple_input_params()
|
484 500 | .set_has_query_name(::std::option::Option::Some("Hi".to_owned()))
|
485 501 | .send()
|
486 502 | .await;
|
487 503 | let _ = dbg!(result);
|
488 504 | let http_request = request_receiver.expect_request();
|
489 505 | let expected_headers = [("Content-Type", "application/x-www-form-urlencoded")];
|
490 506 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
|
491 507 | let required_headers = &["Content-Length"];
|
492 508 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::require_headers(http_request.headers(), required_headers));
|
493 509 | let body = http_request.body().bytes().expect("body should be strict");
|
494 510 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
|
495 511 | body,
|
496 512 | "Action=SimpleInputParams&Version=2020-01-08&HasQueryName=Hi",
|
497 513 | ::aws_smithy_protocol_test::MediaType::from("application/x-www-form-urlencoded"),
|
498 514 | ));
|
499 515 | let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
|
500 516 | ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
|
501 517 | ::pretty_assertions::assert_eq!(uri.path(), "/", "path was incorrect");
|
502 518 | }
|
503 519 |
|
504 520 | /// ec2QueryName trait is preferred over xmlName.
|
505 521 | /// Test ID: Ec2QueryIsPreferred
|
506 522 | #[::tokio::test]
|
507 523 | #[::tracing_test::traced_test]
|
508 524 | async fn ec2_query_is_preferred_request() {
|
509 525 | let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
|
510 526 | let config_builder = crate::config::Config::builder()
|
511 527 | .with_test_defaults()
|
512 - | .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
|
528 + | // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
|
529 + | // Until the incorrect separation is addressed, we need to rely on this workaround.
|
530 + | .allow_no_auth()
|
513 531 | .endpoint_url("https://example.com");
|
514 532 |
|
515 533 | let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
|
516 534 | let result = client
|
517 535 | .simple_input_params()
|
518 536 | .set_has_query_and_xml_name(::std::option::Option::Some("Hi".to_owned()))
|
519 537 | .send()
|
520 538 | .await;
|
521 539 | let _ = dbg!(result);
|
522 540 | let http_request = request_receiver.expect_request();
|
523 541 | let expected_headers = [("Content-Type", "application/x-www-form-urlencoded")];
|
524 542 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
|
525 543 | let required_headers = &["Content-Length"];
|
526 544 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::require_headers(http_request.headers(), required_headers));
|
527 545 | let body = http_request.body().bytes().expect("body should be strict");
|
528 546 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
|
529 547 | body,
|
530 548 | "Action=SimpleInputParams&Version=2020-01-08&HasQueryAndXmlName=Hi",
|
531 549 | ::aws_smithy_protocol_test::MediaType::from("application/x-www-form-urlencoded"),
|
532 550 | ));
|
533 551 | let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
|
534 552 | ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
|
535 553 | ::pretty_assertions::assert_eq!(uri.path(), "/", "path was incorrect");
|
536 554 | }
|
537 555 |
|
538 556 | /// xmlName is used with the ec2 protocol, but the first character is uppercased
|
539 557 | /// Test ID: Ec2XmlNameIsUppercased
|
540 558 | #[::tokio::test]
|
541 559 | #[::tracing_test::traced_test]
|
542 560 | async fn ec2_xml_name_is_uppercased_request() {
|
543 561 | let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
|
544 562 | let config_builder = crate::config::Config::builder()
|
545 563 | .with_test_defaults()
|
546 - | .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
|
564 + | // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
|
565 + | // Until the incorrect separation is addressed, we need to rely on this workaround.
|
566 + | .allow_no_auth()
|
547 567 | .endpoint_url("https://example.com");
|
548 568 |
|
549 569 | let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
|
550 570 | let result = client
|
551 571 | .simple_input_params()
|
552 572 | .set_uses_xml_name(::std::option::Option::Some("Hi".to_owned()))
|
553 573 | .send()
|
554 574 | .await;
|
555 575 | let _ = dbg!(result);
|
556 576 | let http_request = request_receiver.expect_request();
|
557 577 | let expected_headers = [("Content-Type", "application/x-www-form-urlencoded")];
|
558 578 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
|
559 579 | let required_headers = &["Content-Length"];
|
560 580 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::require_headers(http_request.headers(), required_headers));
|
561 581 | let body = http_request.body().bytes().expect("body should be strict");
|
562 582 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
|
563 583 | body,
|
564 584 | "Action=SimpleInputParams&Version=2020-01-08&UsesXmlName=Hi",
|
565 585 | ::aws_smithy_protocol_test::MediaType::from("application/x-www-form-urlencoded"),
|
566 586 | ));
|
567 587 | let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
|
568 588 | ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
|
569 589 | ::pretty_assertions::assert_eq!(uri.path(), "/", "path was incorrect");
|
570 590 | }
|
571 591 |
|
572 592 | /// Supports handling NaN float values.
|
573 593 | /// Test ID: Ec2QuerySupportsNaNFloatInputs
|
574 594 | #[::tokio::test]
|
575 595 | #[::tracing_test::traced_test]
|
576 596 | async fn ec2_query_supports_na_n_float_inputs_request() {
|
577 597 | let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
|
578 598 | let config_builder = crate::config::Config::builder()
|
579 599 | .with_test_defaults()
|
580 - | .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
|
600 + | // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
|
601 + | // Until the incorrect separation is addressed, we need to rely on this workaround.
|
602 + | .allow_no_auth()
|
581 603 | .endpoint_url("https://example.com");
|
582 604 |
|
583 605 | let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
|
584 606 | let result = client
|
585 607 | .simple_input_params()
|
586 608 | .set_float_value(::std::option::Option::Some(
|
587 609 | <f32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("NaN").expect("invalid string for number"),
|
588 610 | ))
|
589 611 | .set_boo(::std::option::Option::Some(
|
590 612 | <f64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("NaN").expect("invalid string for number"),
|
591 613 | ))
|
592 614 | .send()
|
593 615 | .await;
|
594 616 | let _ = dbg!(result);
|
595 617 | let http_request = request_receiver.expect_request();
|
596 618 | let expected_headers = [("Content-Type", "application/x-www-form-urlencoded")];
|
597 619 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
|
598 620 | let required_headers = &["Content-Length"];
|
599 621 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::require_headers(http_request.headers(), required_headers));
|
600 622 | let body = http_request.body().bytes().expect("body should be strict");
|
601 623 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
|
602 624 | body,
|
603 625 | "Action=SimpleInputParams&Version=2020-01-08&FloatValue=NaN&Boo=NaN",
|
604 626 | ::aws_smithy_protocol_test::MediaType::from("application/x-www-form-urlencoded"),
|
605 627 | ));
|
606 628 | let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
|
607 629 | ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
|
608 630 | ::pretty_assertions::assert_eq!(uri.path(), "/", "path was incorrect");
|
609 631 | }
|
610 632 |
|
611 633 | /// Supports handling Infinity float values.
|
612 634 | /// Test ID: Ec2QuerySupportsInfinityFloatInputs
|
613 635 | #[::tokio::test]
|
614 636 | #[::tracing_test::traced_test]
|
615 637 | async fn ec2_query_supports_infinity_float_inputs_request() {
|
616 638 | let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
|
617 639 | let config_builder = crate::config::Config::builder()
|
618 640 | .with_test_defaults()
|
619 - | .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
|
641 + | // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
|
642 + | // Until the incorrect separation is addressed, we need to rely on this workaround.
|
643 + | .allow_no_auth()
|
620 644 | .endpoint_url("https://example.com");
|
621 645 |
|
622 646 | let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
|
623 647 | let result = client
|
624 648 | .simple_input_params()
|
625 649 | .set_float_value(::std::option::Option::Some(
|
626 650 | <f32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("Infinity").expect("invalid string for number"),
|
627 651 | ))
|
628 652 | .set_boo(::std::option::Option::Some(
|
629 653 | <f64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("Infinity").expect("invalid string for number"),
|
630 654 | ))
|
631 655 | .send()
|
632 656 | .await;
|
633 657 | let _ = dbg!(result);
|
634 658 | let http_request = request_receiver.expect_request();
|
635 659 | let expected_headers = [("Content-Type", "application/x-www-form-urlencoded")];
|
636 660 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
|
637 661 | let required_headers = &["Content-Length"];
|
638 662 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::require_headers(http_request.headers(), required_headers));
|
639 663 | let body = http_request.body().bytes().expect("body should be strict");
|
640 664 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
|
641 665 | body,
|
642 666 | "Action=SimpleInputParams&Version=2020-01-08&FloatValue=Infinity&Boo=Infinity",
|
643 667 | ::aws_smithy_protocol_test::MediaType::from("application/x-www-form-urlencoded"),
|
644 668 | ));
|
645 669 | let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
|
646 670 | ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
|
647 671 | ::pretty_assertions::assert_eq!(uri.path(), "/", "path was incorrect");
|
648 672 | }
|
649 673 |
|
650 674 | /// Supports handling -Infinity float values.
|
651 675 | /// Test ID: Ec2QuerySupportsNegativeInfinityFloatInputs
|
652 676 | #[::tokio::test]
|
653 677 | #[::tracing_test::traced_test]
|
654 678 | async fn ec2_query_supports_negative_infinity_float_inputs_request() {
|
655 679 | let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
|
656 680 | let config_builder = crate::config::Config::builder()
|
657 681 | .with_test_defaults()
|
658 - | .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
|
682 + | // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
|
683 + | // Until the incorrect separation is addressed, we need to rely on this workaround.
|
684 + | .allow_no_auth()
|
659 685 | .endpoint_url("https://example.com");
|
660 686 |
|
661 687 | let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
|
662 688 | let result = client
|
663 689 | .simple_input_params()
|
664 690 | .set_float_value(::std::option::Option::Some(
|
665 691 | <f32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("-Infinity").expect("invalid string for number"),
|
666 692 | ))
|
667 693 | .set_boo(::std::option::Option::Some(
|
668 694 | <f64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("-Infinity").expect("invalid string for number"),
|