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