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