250 250 | use ::aws_smithy_protocol_test::FloatEquals;
|
251 251 |
|
252 252 | /// Serializes string shapes
|
253 253 | /// Test ID: serializes_string_shapes
|
254 254 | #[::tokio::test]
|
255 255 | #[::tracing_test::traced_test]
|
256 256 | async fn serializes_string_shapes_request() {
|
257 257 | let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
|
258 258 | let config_builder = crate::config::Config::builder()
|
259 259 | .with_test_defaults()
|
260 - | .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
|
260 + | // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
|
261 + | // Until the incorrect separation is addressed, we need to rely on this workaround.
|
262 + | .allow_no_auth()
|
261 263 | .endpoint_url("https://example.com");
|
262 264 |
|
263 265 | let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
|
264 266 | let result = client
|
265 267 | .kitchen_sink_operation()
|
266 268 | .set_string(::std::option::Option::Some("abc xyz".to_owned()))
|
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 = [
|
272 274 | ("Content-Type", "application/x-amz-json-1.1"),
|
273 275 | ("X-Amz-Target", "JsonProtocol.KitchenSinkOperation"),
|
274 276 | ];
|
275 277 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
|
276 278 | let required_headers = &["Content-Length"];
|
277 279 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::require_headers(http_request.headers(), required_headers));
|
278 280 | let body = http_request.body().bytes().expect("body should be strict");
|
279 281 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
|
280 282 | body,
|
281 283 | "{\"String\":\"abc xyz\"}",
|
282 284 | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
283 285 | ));
|
284 286 | let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
|
285 287 | ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
|
286 288 | ::pretty_assertions::assert_eq!(uri.path(), "/", "path was incorrect");
|
287 289 | }
|
288 290 |
|
289 291 | /// Serializes string shapes with jsonvalue trait
|
290 292 | /// Test ID: serializes_string_shapes_with_jsonvalue_trait
|
291 293 | #[::tokio::test]
|
292 294 | #[::tracing_test::traced_test]
|
293 295 | async fn serializes_string_shapes_with_jsonvalue_trait_request() {
|
294 296 | let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
|
295 297 | let config_builder = crate::config::Config::builder()
|
296 298 | .with_test_defaults()
|
297 - | .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
|
299 + | // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
|
300 + | // Until the incorrect separation is addressed, we need to rely on this workaround.
|
301 + | .allow_no_auth()
|
298 302 | .endpoint_url("https://example.com");
|
299 303 |
|
300 304 | let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
|
301 305 | let result = client.kitchen_sink_operation()
|
302 306 | .set_json_value(
|
303 307 | ::std::option::Option::Some(
|
304 308 | "{\"string\":\"value\",\"number\":1234.5,\"boolTrue\":true,\"boolFalse\":false,\"array\":[1,2,3,4],\"object\":{\"key\":\"value\"},\"null\":null}".to_owned()
|
305 309 | )
|
306 310 | )
|
307 311 | .send().await;
|
308 312 | let _ = dbg!(result);
|
309 313 | let http_request = request_receiver.expect_request();
|
310 314 | let expected_headers = [
|
311 315 | ("Content-Type", "application/x-amz-json-1.1"),
|
312 316 | ("X-Amz-Target", "JsonProtocol.KitchenSinkOperation"),
|
313 317 | ];
|
314 318 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
|
315 319 | let required_headers = &["Content-Length"];
|
316 320 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::require_headers(http_request.headers(), required_headers));
|
317 321 | let body = http_request.body().bytes().expect("body should be strict");
|
318 322 | ::aws_smithy_protocol_test::assert_ok(
|
319 323 | ::aws_smithy_protocol_test::validate_body(body, "{\"JsonValue\":\"{\\\"string\\\":\\\"value\\\",\\\"number\\\":1234.5,\\\"boolTrue\\\":true,\\\"boolFalse\\\":false,\\\"array\\\":[1,2,3,4],\\\"object\\\":{\\\"key\\\":\\\"value\\\"},\\\"null\\\":null}\"}", ::aws_smithy_protocol_test::MediaType::from("application/json"))
|
320 324 | );
|
321 325 | let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
|
322 326 | ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
|
323 327 | ::pretty_assertions::assert_eq!(uri.path(), "/", "path was incorrect");
|
324 328 | }
|
325 329 |
|
326 330 | /// Serializes integer shapes
|
327 331 | /// Test ID: serializes_integer_shapes
|
328 332 | #[::tokio::test]
|
329 333 | #[::tracing_test::traced_test]
|
330 334 | async fn serializes_integer_shapes_request() {
|
331 335 | let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
|
332 336 | let config_builder = crate::config::Config::builder()
|
333 337 | .with_test_defaults()
|
334 - | .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
|
338 + | // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
|
339 + | // Until the incorrect separation is addressed, we need to rely on this workaround.
|
340 + | .allow_no_auth()
|
335 341 | .endpoint_url("https://example.com");
|
336 342 |
|
337 343 | let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
|
338 344 | let result = client
|
339 345 | .kitchen_sink_operation()
|
340 346 | .set_integer(::std::option::Option::Some(1234))
|
341 347 | .send()
|
342 348 | .await;
|
343 349 | let _ = dbg!(result);
|
344 350 | let http_request = request_receiver.expect_request();
|
345 351 | let expected_headers = [
|
346 352 | ("Content-Type", "application/x-amz-json-1.1"),
|
347 353 | ("X-Amz-Target", "JsonProtocol.KitchenSinkOperation"),
|
348 354 | ];
|
349 355 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
|
350 356 | let required_headers = &["Content-Length"];
|
351 357 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::require_headers(http_request.headers(), required_headers));
|
352 358 | let body = http_request.body().bytes().expect("body should be strict");
|
353 359 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
|
354 360 | body,
|
355 361 | "{\"Integer\":1234}",
|
356 362 | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
357 363 | ));
|
358 364 | let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
|
359 365 | ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
|
360 366 | ::pretty_assertions::assert_eq!(uri.path(), "/", "path was incorrect");
|
361 367 | }
|
362 368 |
|
363 369 | /// Serializes long shapes
|
364 370 | /// Test ID: serializes_long_shapes
|
365 371 | #[::tokio::test]
|
366 372 | #[::tracing_test::traced_test]
|
367 373 | async fn serializes_long_shapes_request() {
|
368 374 | let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
|
369 375 | let config_builder = crate::config::Config::builder()
|
370 376 | .with_test_defaults()
|
371 - | .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
|
377 + | // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
|
378 + | // Until the incorrect separation is addressed, we need to rely on this workaround.
|
379 + | .allow_no_auth()
|
372 380 | .endpoint_url("https://example.com");
|
373 381 |
|
374 382 | let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
|
375 383 | let result = client
|
376 384 | .kitchen_sink_operation()
|
377 385 | .set_long(::std::option::Option::Some(999999999999))
|
378 386 | .send()
|
379 387 | .await;
|
380 388 | let _ = dbg!(result);
|
381 389 | let http_request = request_receiver.expect_request();
|
382 390 | let expected_headers = [
|
383 391 | ("Content-Type", "application/x-amz-json-1.1"),
|
384 392 | ("X-Amz-Target", "JsonProtocol.KitchenSinkOperation"),
|
385 393 | ];
|
386 394 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
|
387 395 | let required_headers = &["Content-Length"];
|
388 396 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::require_headers(http_request.headers(), required_headers));
|
389 397 | let body = http_request.body().bytes().expect("body should be strict");
|
390 398 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
|
391 399 | body,
|
392 400 | "{\"Long\":999999999999}",
|
393 401 | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
394 402 | ));
|
395 403 | let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
|
396 404 | ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
|
397 405 | ::pretty_assertions::assert_eq!(uri.path(), "/", "path was incorrect");
|
398 406 | }
|
399 407 |
|
400 408 | /// Serializes float shapes
|
401 409 | /// Test ID: serializes_float_shapes
|
402 410 | #[::tokio::test]
|
403 411 | #[::tracing_test::traced_test]
|
404 412 | async fn serializes_float_shapes_request() {
|
405 413 | let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
|
406 414 | let config_builder = crate::config::Config::builder()
|
407 415 | .with_test_defaults()
|
408 - | .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
|
416 + | // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
|
417 + | // Until the incorrect separation is addressed, we need to rely on this workaround.
|
418 + | .allow_no_auth()
|
409 419 | .endpoint_url("https://example.com");
|
410 420 |
|
411 421 | let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
|
412 422 | let result = client
|
413 423 | .kitchen_sink_operation()
|
414 424 | .set_float(::std::option::Option::Some(1234.5_f32))
|
415 425 | .send()
|
416 426 | .await;
|
417 427 | let _ = dbg!(result);
|
418 428 | let http_request = request_receiver.expect_request();
|
419 429 | let expected_headers = [
|
420 430 | ("Content-Type", "application/x-amz-json-1.1"),
|
421 431 | ("X-Amz-Target", "JsonProtocol.KitchenSinkOperation"),
|
422 432 | ];
|
423 433 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
|
424 434 | let required_headers = &["Content-Length"];
|
425 435 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::require_headers(http_request.headers(), required_headers));
|
426 436 | let body = http_request.body().bytes().expect("body should be strict");
|
427 437 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
|
428 438 | body,
|
429 439 | "{\"Float\":1234.5}",
|
430 440 | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
431 441 | ));
|
432 442 | let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
|
433 443 | ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
|
434 444 | ::pretty_assertions::assert_eq!(uri.path(), "/", "path was incorrect");
|
435 445 | }
|
436 446 |
|
437 447 | /// Serializes double shapes
|
438 448 | /// Test ID: serializes_double_shapes
|
439 449 | #[::tokio::test]
|
440 450 | #[::tracing_test::traced_test]
|
441 451 | async fn serializes_double_shapes_request() {
|
442 452 | let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
|
443 453 | let config_builder = crate::config::Config::builder()
|
444 454 | .with_test_defaults()
|
445 - | .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
|
455 + | // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
|
456 + | // Until the incorrect separation is addressed, we need to rely on this workaround.
|
457 + | .allow_no_auth()
|
446 458 | .endpoint_url("https://example.com");
|
447 459 |
|
448 460 | let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
|
449 461 | let result = client
|
450 462 | .kitchen_sink_operation()
|
451 463 | .set_double(::std::option::Option::Some(1234.5_f64))
|
452 464 | .send()
|
453 465 | .await;
|
454 466 | let _ = dbg!(result);
|
455 467 | let http_request = request_receiver.expect_request();
|
456 468 | let expected_headers = [
|
457 469 | ("Content-Type", "application/x-amz-json-1.1"),
|
458 470 | ("X-Amz-Target", "JsonProtocol.KitchenSinkOperation"),
|
459 471 | ];
|
460 472 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
|
461 473 | let required_headers = &["Content-Length"];
|
462 474 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::require_headers(http_request.headers(), required_headers));
|
463 475 | let body = http_request.body().bytes().expect("body should be strict");
|
464 476 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
|
465 477 | body,
|
466 478 | "{\"Double\":1234.5}",
|
467 479 | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
468 480 | ));
|
469 481 | let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
|
470 482 | ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
|
471 483 | ::pretty_assertions::assert_eq!(uri.path(), "/", "path was incorrect");
|
472 484 | }
|
473 485 |
|
474 486 | /// Serializes blob shapes
|
475 487 | /// Test ID: serializes_blob_shapes
|
476 488 | #[::tokio::test]
|
477 489 | #[::tracing_test::traced_test]
|
478 490 | async fn serializes_blob_shapes_request() {
|
479 491 | let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
|
480 492 | let config_builder = crate::config::Config::builder()
|
481 493 | .with_test_defaults()
|
482 - | .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
|
494 + | // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
|
495 + | // Until the incorrect separation is addressed, we need to rely on this workaround.
|
496 + | .allow_no_auth()
|
483 497 | .endpoint_url("https://example.com");
|
484 498 |
|
485 499 | let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
|
486 500 | let result = client
|
487 501 | .kitchen_sink_operation()
|
488 502 | .set_blob(::std::option::Option::Some(::aws_smithy_types::Blob::new("binary-value")))
|
489 503 | .send()
|
490 504 | .await;
|
491 505 | let _ = dbg!(result);
|
492 506 | let http_request = request_receiver.expect_request();
|
493 507 | let expected_headers = [
|
494 508 | ("Content-Type", "application/x-amz-json-1.1"),
|
495 509 | ("X-Amz-Target", "JsonProtocol.KitchenSinkOperation"),
|
496 510 | ];
|
497 511 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
|
498 512 | let required_headers = &["Content-Length"];
|
499 513 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::require_headers(http_request.headers(), required_headers));
|
500 514 | let body = http_request.body().bytes().expect("body should be strict");
|
501 515 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
|
502 516 | body,
|
503 517 | "{\"Blob\":\"YmluYXJ5LXZhbHVl\"}",
|
504 518 | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
505 519 | ));
|
506 520 | let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
|
507 521 | ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
|
508 522 | ::pretty_assertions::assert_eq!(uri.path(), "/", "path was incorrect");
|
509 523 | }
|
510 524 |
|
511 525 | /// Serializes boolean shapes (true)
|
512 526 | /// Test ID: serializes_boolean_shapes_true
|
513 527 | #[::tokio::test]
|
514 528 | #[::tracing_test::traced_test]
|
515 529 | async fn serializes_boolean_shapes_true_request() {
|
516 530 | let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
|
517 531 | let config_builder = crate::config::Config::builder()
|
518 532 | .with_test_defaults()
|
519 - | .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
|
533 + | // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
|
534 + | // Until the incorrect separation is addressed, we need to rely on this workaround.
|
535 + | .allow_no_auth()
|
520 536 | .endpoint_url("https://example.com");
|
521 537 |
|
522 538 | let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
|
523 539 | let result = client
|
524 540 | .kitchen_sink_operation()
|
525 541 | .set_boolean(::std::option::Option::Some(true))
|
526 542 | .send()
|
527 543 | .await;
|
528 544 | let _ = dbg!(result);
|
529 545 | let http_request = request_receiver.expect_request();
|
530 546 | let expected_headers = [
|
531 547 | ("Content-Type", "application/x-amz-json-1.1"),
|
532 548 | ("X-Amz-Target", "JsonProtocol.KitchenSinkOperation"),
|
533 549 | ];
|
534 550 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
|
535 551 | let required_headers = &["Content-Length"];
|
536 552 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::require_headers(http_request.headers(), required_headers));
|
537 553 | let body = http_request.body().bytes().expect("body should be strict");
|
538 554 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
|
539 555 | body,
|
540 556 | "{\"Boolean\":true}",
|
541 557 | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
542 558 | ));
|
543 559 | let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
|
544 560 | ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
|
545 561 | ::pretty_assertions::assert_eq!(uri.path(), "/", "path was incorrect");
|
546 562 | }
|
547 563 |
|
548 564 | /// Serializes boolean shapes (false)
|
549 565 | /// Test ID: serializes_boolean_shapes_false
|
550 566 | #[::tokio::test]
|
551 567 | #[::tracing_test::traced_test]
|
552 568 | async fn serializes_boolean_shapes_false_request() {
|
553 569 | let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
|
554 570 | let config_builder = crate::config::Config::builder()
|
555 571 | .with_test_defaults()
|
556 - | .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
|
572 + | // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
|
573 + | // Until the incorrect separation is addressed, we need to rely on this workaround.
|
574 + | .allow_no_auth()
|
557 575 | .endpoint_url("https://example.com");
|
558 576 |
|
559 577 | let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
|
560 578 | let result = client
|
561 579 | .kitchen_sink_operation()
|
562 580 | .set_boolean(::std::option::Option::Some(false))
|
563 581 | .send()
|
564 582 | .await;
|
565 583 | let _ = dbg!(result);
|
566 584 | let http_request = request_receiver.expect_request();
|
567 585 | let expected_headers = [
|
568 586 | ("Content-Type", "application/x-amz-json-1.1"),
|
569 587 | ("X-Amz-Target", "JsonProtocol.KitchenSinkOperation"),
|
570 588 | ];
|
571 589 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
|
572 590 | let required_headers = &["Content-Length"];
|
573 591 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::require_headers(http_request.headers(), required_headers));
|
574 592 | let body = http_request.body().bytes().expect("body should be strict");
|
575 593 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
|
576 594 | body,
|
577 595 | "{\"Boolean\":false}",
|
578 596 | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
579 597 | ));
|
580 598 | let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
|
581 599 | ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
|
582 600 | ::pretty_assertions::assert_eq!(uri.path(), "/", "path was incorrect");
|
583 601 | }
|
584 602 |
|
585 603 | /// Serializes timestamp shapes
|
586 604 | /// Test ID: serializes_timestamp_shapes
|
587 605 | #[::tokio::test]
|
588 606 | #[::tracing_test::traced_test]
|
589 607 | async fn serializes_timestamp_shapes_request() {
|
590 608 | let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
|
591 609 | let config_builder = crate::config::Config::builder()
|
592 610 | .with_test_defaults()
|
593 - | .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
|
611 + | // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
|
612 + | // Until the incorrect separation is addressed, we need to rely on this workaround.
|
613 + | .allow_no_auth()
|
594 614 | .endpoint_url("https://example.com");
|
595 615 |
|
596 616 | let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
|
597 617 | let result = client
|
598 618 | .kitchen_sink_operation()
|
599 619 | .set_timestamp(::std::option::Option::Some(::aws_smithy_types::DateTime::from_fractional_secs(
|
600 620 | 946845296, 0_f64,
|
601 621 | )))
|
602 622 | .send()
|
603 623 | .await;
|
604 624 | let _ = dbg!(result);
|
605 625 | let http_request = request_receiver.expect_request();
|
606 626 | let expected_headers = [
|
607 627 | ("Content-Type", "application/x-amz-json-1.1"),
|
608 628 | ("X-Amz-Target", "JsonProtocol.KitchenSinkOperation"),
|
609 629 | ];
|
610 630 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
|
611 631 | let required_headers = &["Content-Length"];
|
612 632 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::require_headers(http_request.headers(), required_headers));
|
613 633 | let body = http_request.body().bytes().expect("body should be strict");
|
614 634 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
|
615 635 | body,
|
616 636 | "{\"Timestamp\":946845296}",
|
617 637 | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
618 638 | ));
|
619 639 | let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
|
620 640 | ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
|
621 641 | ::pretty_assertions::assert_eq!(uri.path(), "/", "path was incorrect");
|
622 642 | }
|
623 643 |
|
624 644 | /// Serializes timestamp shapes with iso8601 timestampFormat
|
625 645 | /// Test ID: serializes_timestamp_shapes_with_iso8601_timestampformat
|
626 646 | #[::tokio::test]
|
627 647 | #[::tracing_test::traced_test]
|
628 648 | async fn serializes_timestamp_shapes_with_iso8601_timestampformat_request() {
|
629 649 | let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
|
630 650 | let config_builder = crate::config::Config::builder()
|
631 651 | .with_test_defaults()
|
632 - | .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
|
652 + | // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
|
653 + | // Until the incorrect separation is addressed, we need to rely on this workaround.
|
654 + | .allow_no_auth()
|
633 655 | .endpoint_url("https://example.com");
|
634 656 |
|
635 657 | let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
|
636 658 | let result = client
|
637 659 | .kitchen_sink_operation()
|
638 660 | .set_iso8601_timestamp(::std::option::Option::Some(::aws_smithy_types::DateTime::from_fractional_secs(
|
639 661 | 946845296, 0_f64,
|
640 662 | )))
|
641 663 | .send()
|
642 664 | .await;
|
643 665 | let _ = dbg!(result);
|
644 666 | let http_request = request_receiver.expect_request();
|
645 667 | let expected_headers = [
|
646 668 | ("Content-Type", "application/x-amz-json-1.1"),
|
647 669 | ("X-Amz-Target", "JsonProtocol.KitchenSinkOperation"),
|
648 670 | ];
|
649 671 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
|
650 672 | let required_headers = &["Content-Length"];
|
651 673 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::require_headers(http_request.headers(), required_headers));
|
652 674 | let body = http_request.body().bytes().expect("body should be strict");
|
653 675 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
|
654 676 | body,
|
655 677 | "{\"Iso8601Timestamp\":\"2000-01-02T20:34:56Z\"}",
|
656 678 | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
657 679 | ));
|
658 680 | let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
|
659 681 | ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
|
660 682 | ::pretty_assertions::assert_eq!(uri.path(), "/", "path was incorrect");
|
661 683 | }
|
662 684 |
|
663 685 | /// Serializes timestamp shapes with httpdate timestampFormat
|
664 686 | /// Test ID: serializes_timestamp_shapes_with_httpdate_timestampformat
|
665 687 | #[::tokio::test]
|
666 688 | #[::tracing_test::traced_test]
|
667 689 | async fn serializes_timestamp_shapes_with_httpdate_timestampformat_request() {
|
668 690 | let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
|
669 691 | let config_builder = crate::config::Config::builder()
|
670 692 | .with_test_defaults()
|
671 - | .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
|
693 + | // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
|
694 + | // Until the incorrect separation is addressed, we need to rely on this workaround.
|
695 + | .allow_no_auth()
|
672 696 | .endpoint_url("https://example.com");
|
673 697 |
|
674 698 | let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
|
675 699 | let result = client
|
676 700 | .kitchen_sink_operation()
|
677 701 | .set_httpdate_timestamp(::std::option::Option::Some(::aws_smithy_types::DateTime::from_fractional_secs(
|
678 702 | 946845296, 0_f64,
|
679 703 | )))
|
680 704 | .send()
|
681 705 | .await;
|
682 706 | let _ = dbg!(result);
|
683 707 | let http_request = request_receiver.expect_request();
|
684 708 | let expected_headers = [
|
685 709 | ("Content-Type", "application/x-amz-json-1.1"),
|
686 710 | ("X-Amz-Target", "JsonProtocol.KitchenSinkOperation"),
|
687 711 | ];
|
688 712 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
|
689 713 | let required_headers = &["Content-Length"];
|
690 714 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::require_headers(http_request.headers(), required_headers));
|
691 715 | let body = http_request.body().bytes().expect("body should be strict");
|
692 716 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
|
693 717 | body,
|
694 718 | "{\"HttpdateTimestamp\":\"Sun, 02 Jan 2000 20:34:56 GMT\"}",
|
695 719 | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
696 720 | ));
|
697 721 | let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
|
698 722 | ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
|
699 723 | ::pretty_assertions::assert_eq!(uri.path(), "/", "path was incorrect");
|
700 724 | }
|
701 725 |
|
702 726 | /// Serializes timestamp shapes with unixTimestamp timestampFormat
|
703 727 | /// Test ID: serializes_timestamp_shapes_with_unixtimestamp_timestampformat
|
704 728 | #[::tokio::test]
|
705 729 | #[::tracing_test::traced_test]
|
706 730 | async fn serializes_timestamp_shapes_with_unixtimestamp_timestampformat_request() {
|
707 731 | let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
|
708 732 | let config_builder = crate::config::Config::builder()
|
709 733 | .with_test_defaults()
|
710 - | .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
|
734 + | // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
|
735 + | // Until the incorrect separation is addressed, we need to rely on this workaround.
|
736 + | .allow_no_auth()
|
711 737 | .endpoint_url("https://example.com");
|
712 738 |
|
713 739 | let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
|
714 740 | let result = client
|
715 741 | .kitchen_sink_operation()
|
716 742 | .set_unix_timestamp(::std::option::Option::Some(::aws_smithy_types::DateTime::from_fractional_secs(
|
717 743 | 946845296, 0_f64,
|
718 744 | )))
|
719 745 | .send()
|
720 746 | .await;
|
721 747 | let _ = dbg!(result);
|
722 748 | let http_request = request_receiver.expect_request();
|
723 749 | let expected_headers = [
|
724 750 | ("Content-Type", "application/x-amz-json-1.1"),
|
725 751 | ("X-Amz-Target", "JsonProtocol.KitchenSinkOperation"),
|
726 752 | ];
|
727 753 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
|
728 754 | let required_headers = &["Content-Length"];
|
729 755 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::require_headers(http_request.headers(), required_headers));
|
730 756 | let body = http_request.body().bytes().expect("body should be strict");
|
731 757 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
|
732 758 | body,
|
733 759 | "{\"UnixTimestamp\":946845296}",
|
734 760 | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
735 761 | ));
|
736 762 | let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
|
737 763 | ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
|
738 764 | ::pretty_assertions::assert_eq!(uri.path(), "/", "path was incorrect");
|
739 765 | }
|
740 766 |
|
741 767 | /// Serializes list shapes
|
742 768 | /// Test ID: serializes_list_shapes
|
743 769 | #[::tokio::test]
|
744 770 | #[::tracing_test::traced_test]
|
745 771 | async fn serializes_list_shapes_request() {
|
746 772 | let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
|
747 773 | let config_builder = crate::config::Config::builder()
|
748 774 | .with_test_defaults()
|
749 - | .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
|
775 + | // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
|
776 + | // Until the incorrect separation is addressed, we need to rely on this workaround.
|
777 + | .allow_no_auth()
|
750 778 | .endpoint_url("https://example.com");
|
751 779 |
|
752 780 | let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
|
753 781 | let result = client
|
754 782 | .kitchen_sink_operation()
|
755 783 | .set_list_of_strings(::std::option::Option::Some(vec!["abc".to_owned(), "mno".to_owned(), "xyz".to_owned()]))
|
756 784 | .send()
|
757 785 | .await;
|
758 786 | let _ = dbg!(result);
|
759 787 | let http_request = request_receiver.expect_request();
|
760 788 | let expected_headers = [
|
761 789 | ("Content-Type", "application/x-amz-json-1.1"),
|
762 790 | ("X-Amz-Target", "JsonProtocol.KitchenSinkOperation"),
|
763 791 | ];
|
764 792 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
|
765 793 | let required_headers = &["Content-Length"];
|
766 794 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::require_headers(http_request.headers(), required_headers));
|
767 795 | let body = http_request.body().bytes().expect("body should be strict");
|
768 796 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
|
769 797 | body,
|
770 798 | "{\"ListOfStrings\":[\"abc\",\"mno\",\"xyz\"]}",
|
771 799 | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
772 800 | ));
|
773 801 | let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
|
774 802 | ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
|
775 803 | ::pretty_assertions::assert_eq!(uri.path(), "/", "path was incorrect");
|
776 804 | }
|
777 805 |
|
778 806 | /// Serializes empty list shapes
|
779 807 | /// Test ID: serializes_empty_list_shapes
|
780 808 | #[::tokio::test]
|
781 809 | #[::tracing_test::traced_test]
|
782 810 | async fn serializes_empty_list_shapes_request() {
|
783 811 | let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
|
784 812 | let config_builder = crate::config::Config::builder()
|
785 813 | .with_test_defaults()
|
786 - | .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
|
814 + | // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
|
815 + | // Until the incorrect separation is addressed, we need to rely on this workaround.
|
816 + | .allow_no_auth()
|
787 817 | .endpoint_url("https://example.com");
|
788 818 |
|
789 819 | let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
|
790 820 | let result = client
|
791 821 | .kitchen_sink_operation()
|
792 822 | .set_list_of_strings(::std::option::Option::Some(vec![]))
|
793 823 | .send()
|
794 824 | .await;
|
795 825 | let _ = dbg!(result);
|
796 826 | let http_request = request_receiver.expect_request();
|
797 827 | let expected_headers = [
|
798 828 | ("Content-Type", "application/x-amz-json-1.1"),
|
799 829 | ("X-Amz-Target", "JsonProtocol.KitchenSinkOperation"),
|
800 830 | ];
|
801 831 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
|
802 832 | let required_headers = &["Content-Length"];
|
803 833 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::require_headers(http_request.headers(), required_headers));
|
804 834 | let body = http_request.body().bytes().expect("body should be strict");
|
805 835 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
|
806 836 | body,
|
807 837 | "{\"ListOfStrings\":[]}",
|
808 838 | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
809 839 | ));
|
810 840 | let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
|
811 841 | ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
|
812 842 | ::pretty_assertions::assert_eq!(uri.path(), "/", "path was incorrect");
|
813 843 | }
|
814 844 |
|
815 845 | /// Serializes list of map shapes
|
816 846 | /// Test ID: serializes_list_of_map_shapes
|
817 847 | #[::tokio::test]
|
818 848 | #[::tracing_test::traced_test]
|
819 849 | async fn serializes_list_of_map_shapes_request() {
|
820 850 | let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
|
821 851 | let config_builder = crate::config::Config::builder()
|
822 852 | .with_test_defaults()
|
823 - | .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
|
853 + | // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
|
854 + | // Until the incorrect separation is addressed, we need to rely on this workaround.
|
855 + | .allow_no_auth()
|
824 856 | .endpoint_url("https://example.com");
|
825 857 |
|
826 858 | let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
|
827 859 | let result = client
|
828 860 | .kitchen_sink_operation()
|
829 861 | .set_list_of_maps_of_strings(::std::option::Option::Some(vec![
|
830 862 | {
|
831 863 | let mut ret = ::std::collections::HashMap::new();
|
832 864 | ret.insert("foo".to_owned(), "bar".to_owned());
|
833 865 | ret
|
834 866 | },
|
835 867 | {
|
836 868 | let mut ret = ::std::collections::HashMap::new();
|
837 869 | ret.insert("abc".to_owned(), "xyz".to_owned());
|
838 870 | ret
|
839 871 | },
|
840 872 | {
|
841 873 | let mut ret = ::std::collections::HashMap::new();
|
842 874 | ret.insert("red".to_owned(), "blue".to_owned());
|
843 875 | ret
|
844 876 | },
|
845 877 | ]))
|
846 878 | .send()
|
847 879 | .await;
|
848 880 | let _ = dbg!(result);
|
849 881 | let http_request = request_receiver.expect_request();
|
850 882 | let expected_headers = [
|
851 883 | ("Content-Type", "application/x-amz-json-1.1"),
|
852 884 | ("X-Amz-Target", "JsonProtocol.KitchenSinkOperation"),
|
853 885 | ];
|
854 886 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
|
855 887 | let required_headers = &["Content-Length"];
|
856 888 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::require_headers(http_request.headers(), required_headers));
|
857 889 | let body = http_request.body().bytes().expect("body should be strict");
|
858 890 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
|
859 891 | body,
|
860 892 | "{\"ListOfMapsOfStrings\":[{\"foo\":\"bar\"},{\"abc\":\"xyz\"},{\"red\":\"blue\"}]}",
|
861 893 | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
862 894 | ));
|
863 895 | let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
|
864 896 | ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
|
865 897 | ::pretty_assertions::assert_eq!(uri.path(), "/", "path was incorrect");
|
866 898 | }
|
867 899 |
|
868 900 | /// Serializes list of structure shapes
|
869 901 | /// Test ID: serializes_list_of_structure_shapes
|
870 902 | #[::tokio::test]
|
871 903 | #[::tracing_test::traced_test]
|
872 904 | async fn serializes_list_of_structure_shapes_request() {
|
873 905 | let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
|
874 906 | let config_builder = crate::config::Config::builder()
|
875 907 | .with_test_defaults()
|
876 - | .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
|
908 + | // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
|
909 + | // Until the incorrect separation is addressed, we need to rely on this workaround.
|
910 + | .allow_no_auth()
|
877 911 | .endpoint_url("https://example.com");
|
878 912 |
|
879 913 | let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
|
880 914 | let result = client
|
881 915 | .kitchen_sink_operation()
|
882 916 | .set_list_of_structs(::std::option::Option::Some(vec![
|
883 917 | crate::types::SimpleStruct::builder()
|
884 918 | .set_value(::std::option::Option::Some("abc".to_owned()))
|
885 919 | .build(),
|
886 920 | crate::types::SimpleStruct::builder()
|
887 921 | .set_value(::std::option::Option::Some("mno".to_owned()))
|
888 922 | .build(),
|
889 923 | crate::types::SimpleStruct::builder()
|
890 924 | .set_value(::std::option::Option::Some("xyz".to_owned()))
|
891 925 | .build(),
|
892 926 | ]))
|
893 927 | .send()
|
894 928 | .await;
|
895 929 | let _ = dbg!(result);
|
896 930 | let http_request = request_receiver.expect_request();
|
897 931 | let expected_headers = [
|
898 932 | ("Content-Type", "application/x-amz-json-1.1"),
|
899 933 | ("X-Amz-Target", "JsonProtocol.KitchenSinkOperation"),
|
900 934 | ];
|
901 935 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
|
902 936 | let required_headers = &["Content-Length"];
|
903 937 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::require_headers(http_request.headers(), required_headers));
|
904 938 | let body = http_request.body().bytes().expect("body should be strict");
|
905 939 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
|
906 940 | body,
|
907 941 | "{\"ListOfStructs\":[{\"Value\":\"abc\"},{\"Value\":\"mno\"},{\"Value\":\"xyz\"}]}",
|
908 942 | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
909 943 | ));
|
910 944 | let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
|
911 945 | ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
|
912 946 | ::pretty_assertions::assert_eq!(uri.path(), "/", "path was incorrect");
|
913 947 | }
|
914 948 |
|
915 949 | /// Serializes list of recursive structure shapes
|
916 950 | /// Test ID: serializes_list_of_recursive_structure_shapes
|
917 951 | #[::tokio::test]
|
918 952 | #[::tracing_test::traced_test]
|
919 953 | async fn serializes_list_of_recursive_structure_shapes_request() {
|
920 954 | let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
|
921 955 | let config_builder = crate::config::Config::builder()
|
922 956 | .with_test_defaults()
|
923 - | .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
|
957 + | // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
|
958 + | // Until the incorrect separation is addressed, we need to rely on this workaround.
|
959 + | .allow_no_auth()
|
924 960 | .endpoint_url("https://example.com");
|
925 961 |
|
926 962 | let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
|
927 963 | let result = client
|
928 964 | .kitchen_sink_operation()
|
929 965 | .set_recursive_list(::std::option::Option::Some(vec![crate::types::KitchenSink::builder()
|
930 966 | .set_recursive_list(::std::option::Option::Some(vec![crate::types::KitchenSink::builder()
|
931 967 | .set_recursive_list(::std::option::Option::Some(vec![crate::types::KitchenSink::builder()
|
932 968 | .set_integer(::std::option::Option::Some(123))
|
933 969 | .build()]))
|
934 970 | .build()]))
|
935 971 | .build()]))
|
936 972 | .send()
|
937 973 | .await;
|
938 974 | let _ = dbg!(result);
|
939 975 | let http_request = request_receiver.expect_request();
|
940 976 | let expected_headers = [
|
941 977 | ("Content-Type", "application/x-amz-json-1.1"),
|
942 978 | ("X-Amz-Target", "JsonProtocol.KitchenSinkOperation"),
|
943 979 | ];
|
944 980 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
|
945 981 | let required_headers = &["Content-Length"];
|
946 982 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::require_headers(http_request.headers(), required_headers));
|
947 983 | let body = http_request.body().bytes().expect("body should be strict");
|
948 984 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
|
949 985 | body,
|
950 986 | "{\"RecursiveList\":[{\"RecursiveList\":[{\"RecursiveList\":[{\"Integer\":123}]}]}]}",
|
951 987 | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
952 988 | ));
|
953 989 | let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
|
954 990 | ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
|
955 991 | ::pretty_assertions::assert_eq!(uri.path(), "/", "path was incorrect");
|
956 992 | }
|
957 993 |
|
958 994 | /// Serializes map shapes
|
959 995 | /// Test ID: serializes_map_shapes
|
960 996 | #[::tokio::test]
|
961 997 | #[::tracing_test::traced_test]
|
962 998 | async fn serializes_map_shapes_request() {
|
963 999 | let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
|
964 1000 | let config_builder = crate::config::Config::builder()
|
965 1001 | .with_test_defaults()
|
966 - | .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
|
1002 + | // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
|
1003 + | // Until the incorrect separation is addressed, we need to rely on this workaround.
|
1004 + | .allow_no_auth()
|
967 1005 | .endpoint_url("https://example.com");
|
968 1006 |
|
969 1007 | let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
|
970 1008 | let result = client
|
971 1009 | .kitchen_sink_operation()
|
972 1010 | .set_map_of_strings(::std::option::Option::Some({
|
973 1011 | let mut ret = ::std::collections::HashMap::new();
|
974 1012 | ret.insert("abc".to_owned(), "xyz".to_owned());
|
975 1013 | ret.insert("mno".to_owned(), "hjk".to_owned());
|
976 1014 | ret
|
977 1015 | }))
|
978 1016 | .send()
|
979 1017 | .await;
|
980 1018 | let _ = dbg!(result);
|
981 1019 | let http_request = request_receiver.expect_request();
|
982 1020 | let expected_headers = [
|
983 1021 | ("Content-Type", "application/x-amz-json-1.1"),
|
984 1022 | ("X-Amz-Target", "JsonProtocol.KitchenSinkOperation"),
|
985 1023 | ];
|
986 1024 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
|
987 1025 | let required_headers = &["Content-Length"];
|
988 1026 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::require_headers(http_request.headers(), required_headers));
|
989 1027 | let body = http_request.body().bytes().expect("body should be strict");
|
990 1028 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
|
991 1029 | body,
|
992 1030 | "{\"MapOfStrings\":{\"abc\":\"xyz\",\"mno\":\"hjk\"}}",
|
993 1031 | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
994 1032 | ));
|
995 1033 | let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
|
996 1034 | ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
|
997 1035 | ::pretty_assertions::assert_eq!(uri.path(), "/", "path was incorrect");
|
998 1036 | }
|
999 1037 |
|
1000 1038 | /// Serializes empty map shapes
|
1001 1039 | /// Test ID: serializes_empty_map_shapes
|
1002 1040 | #[::tokio::test]
|
1003 1041 | #[::tracing_test::traced_test]
|
1004 1042 | async fn serializes_empty_map_shapes_request() {
|
1005 1043 | let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
|
1006 1044 | let config_builder = crate::config::Config::builder()
|
1007 1045 | .with_test_defaults()
|
1008 - | .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
|
1046 + | // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
|
1047 + | // Until the incorrect separation is addressed, we need to rely on this workaround.
|
1048 + | .allow_no_auth()
|
1009 1049 | .endpoint_url("https://example.com");
|
1010 1050 |
|
1011 1051 | let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
|
1012 1052 | let result = client
|
1013 1053 | .kitchen_sink_operation()
|
1014 1054 | .set_map_of_strings(::std::option::Option::Some(::std::collections::HashMap::new()))
|
1015 1055 | .send()
|
1016 1056 | .await;
|
1017 1057 | let _ = dbg!(result);
|
1018 1058 | let http_request = request_receiver.expect_request();
|
1019 1059 | let expected_headers = [
|
1020 1060 | ("Content-Type", "application/x-amz-json-1.1"),
|
1021 1061 | ("X-Amz-Target", "JsonProtocol.KitchenSinkOperation"),
|
1022 1062 | ];
|
1023 1063 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
|
1024 1064 | let required_headers = &["Content-Length"];
|
1025 1065 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::require_headers(http_request.headers(), required_headers));
|
1026 1066 | let body = http_request.body().bytes().expect("body should be strict");
|
1027 1067 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
|
1028 1068 | body,
|
1029 1069 | "{\"MapOfStrings\":{}}",
|
1030 1070 | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
1031 1071 | ));
|
1032 1072 | let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
|
1033 1073 | ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
|
1034 1074 | ::pretty_assertions::assert_eq!(uri.path(), "/", "path was incorrect");
|
1035 1075 | }
|
1036 1076 |
|
1037 1077 | /// Serializes map of list shapes
|
1038 1078 | /// Test ID: serializes_map_of_list_shapes
|
1039 1079 | #[::tokio::test]
|
1040 1080 | #[::tracing_test::traced_test]
|
1041 1081 | async fn serializes_map_of_list_shapes_request() {
|
1042 1082 | let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
|
1043 1083 | let config_builder = crate::config::Config::builder()
|
1044 1084 | .with_test_defaults()
|
1045 - | .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
|
1085 + | // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
|
1086 + | // Until the incorrect separation is addressed, we need to rely on this workaround.
|
1087 + | .allow_no_auth()
|
1046 1088 | .endpoint_url("https://example.com");
|
1047 1089 |
|
1048 1090 | let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
|
1049 1091 | let result = client
|
1050 1092 | .kitchen_sink_operation()
|
1051 1093 | .set_map_of_lists_of_strings(::std::option::Option::Some({
|
1052 1094 | let mut ret = ::std::collections::HashMap::new();
|
1053 1095 | ret.insert("abc".to_owned(), vec!["abc".to_owned(), "xyz".to_owned()]);
|
1054 1096 | ret.insert("mno".to_owned(), vec!["xyz".to_owned(), "abc".to_owned()]);
|
1055 1097 | ret
|
1056 1098 | }))
|
1057 1099 | .send()
|
1058 1100 | .await;
|
1059 1101 | let _ = dbg!(result);
|
1060 1102 | let http_request = request_receiver.expect_request();
|
1061 1103 | let expected_headers = [
|
1062 1104 | ("Content-Type", "application/x-amz-json-1.1"),
|
1063 1105 | ("X-Amz-Target", "JsonProtocol.KitchenSinkOperation"),
|
1064 1106 | ];
|
1065 1107 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
|
1066 1108 | let required_headers = &["Content-Length"];
|
1067 1109 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::require_headers(http_request.headers(), required_headers));
|
1068 1110 | let body = http_request.body().bytes().expect("body should be strict");
|
1069 1111 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
|
1070 1112 | body,
|
1071 1113 | "{\"MapOfListsOfStrings\":{\"abc\":[\"abc\",\"xyz\"],\"mno\":[\"xyz\",\"abc\"]}}",
|
1072 1114 | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
1073 1115 | ));
|
1074 1116 | let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
|
1075 1117 | ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
|
1076 1118 | ::pretty_assertions::assert_eq!(uri.path(), "/", "path was incorrect");
|
1077 1119 | }
|
1078 1120 |
|
1079 1121 | /// Serializes map of structure shapes
|
1080 1122 | /// Test ID: serializes_map_of_structure_shapes
|
1081 1123 | #[::tokio::test]
|
1082 1124 | #[::tracing_test::traced_test]
|
1083 1125 | async fn serializes_map_of_structure_shapes_request() {
|
1084 1126 | let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
|
1085 1127 | let config_builder = crate::config::Config::builder()
|
1086 1128 | .with_test_defaults()
|
1087 - | .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
|
1129 + | // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
|
1130 + | // Until the incorrect separation is addressed, we need to rely on this workaround.
|
1131 + | .allow_no_auth()
|
1088 1132 | .endpoint_url("https://example.com");
|
1089 1133 |
|
1090 1134 | let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
|
1091 1135 | let result = client
|
1092 1136 | .kitchen_sink_operation()
|
1093 1137 | .set_map_of_structs(::std::option::Option::Some({
|
1094 1138 | let mut ret = ::std::collections::HashMap::new();
|
1095 1139 | ret.insert(
|
1096 1140 | "key1".to_owned(),
|
1097 1141 | crate::types::SimpleStruct::builder()
|
1098 1142 | .set_value(::std::option::Option::Some("value-1".to_owned()))
|
1099 1143 | .build(),
|
1100 1144 | );
|
1101 1145 | ret.insert(
|
1102 1146 | "key2".to_owned(),
|
1103 1147 | crate::types::SimpleStruct::builder()
|
1104 1148 | .set_value(::std::option::Option::Some("value-2".to_owned()))
|
1105 1149 | .build(),
|
1106 1150 | );
|
1107 1151 | ret
|
1108 1152 | }))
|
1109 1153 | .send()
|
1110 1154 | .await;
|
1111 1155 | let _ = dbg!(result);
|
1112 1156 | let http_request = request_receiver.expect_request();
|
1113 1157 | let expected_headers = [
|
1114 1158 | ("Content-Type", "application/x-amz-json-1.1"),
|
1115 1159 | ("X-Amz-Target", "JsonProtocol.KitchenSinkOperation"),
|
1116 1160 | ];
|
1117 1161 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
|
1118 1162 | let required_headers = &["Content-Length"];
|
1119 1163 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::require_headers(http_request.headers(), required_headers));
|
1120 1164 | let body = http_request.body().bytes().expect("body should be strict");
|
1121 1165 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
|
1122 1166 | body,
|
1123 1167 | "{\"MapOfStructs\":{\"key1\":{\"Value\":\"value-1\"},\"key2\":{\"Value\":\"value-2\"}}}",
|
1124 1168 | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
1125 1169 | ));
|
1126 1170 | let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
|
1127 1171 | ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
|
1128 1172 | ::pretty_assertions::assert_eq!(uri.path(), "/", "path was incorrect");
|
1129 1173 | }
|
1130 1174 |
|
1131 1175 | /// Serializes map of recursive structure shapes
|
1132 1176 | /// Test ID: serializes_map_of_recursive_structure_shapes
|
1133 1177 | #[::tokio::test]
|
1134 1178 | #[::tracing_test::traced_test]
|
1135 1179 | async fn serializes_map_of_recursive_structure_shapes_request() {
|
1136 1180 | let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
|
1137 1181 | let config_builder = crate::config::Config::builder()
|
1138 1182 | .with_test_defaults()
|
1139 - | .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
|
1183 + | // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177):
|
1184 + | // Until the incorrect separation is addressed, we need to rely on this workaround.
|
1185 + | .allow_no_auth()
|
1140 1186 | .endpoint_url("https://example.com");
|
1141 1187 |
|
1142 1188 | let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
|
1143 1189 | let result = client
|
1144 1190 | .kitchen_sink_operation()
|
1145 1191 | .set_recursive_map(::std::option::Option::Some({
|
1146 1192 | let mut ret = ::std::collections::HashMap::new();
|
1147 1193 | ret.insert(
|
1148 1194 | "key1".to_owned(),
|
1149 1195 | crate::types::KitchenSink::builder()
|