258 256 | .set_hi(::std::option::Option::Some("bye".to_owned()))
|
259 257 | .build(),
|
260 258 | ),
|
261 259 | );
|
262 260 | ret
|
263 261 | }))
|
264 262 | .send()
|
265 263 | .await;
|
266 264 | let _ = dbg!(result);
|
267 265 | let http_request = request_receiver.expect_request();
|
268 - | let expected_headers = [
|
269 - | ("Accept", "application/cbor"),
|
270 - | ("Content-Type", "application/cbor"),
|
271 - | ("smithy-protocol", "rpc-v2-cbor"),
|
272 - | ];
|
266 + | let expected_headers = [("Content-Type", "application/cbor"), ("smithy-protocol", "rpc-v2-cbor")];
|
273 267 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
|
274 268 | let required_headers = &["Content-Length"];
|
275 269 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::require_headers(http_request.headers(), required_headers));
|
276 270 | let body = http_request.body().bytes().expect("body should be strict");
|
277 271 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
|
278 272 | body,
|
279 273 | "v29zcGFyc2VTdHJ1Y3RNYXC/Y2Zvb79iaGlldGhlcmX/Y2Jher9iaGljYnll////",
|
280 274 | ::aws_smithy_protocol_test::MediaType::from("application/cbor"),
|
281 275 | ));
|
282 276 | let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
|
283 277 | ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
|
284 278 | ::pretty_assertions::assert_eq!(uri.path(), "/service/RpcV2Protocol/operation/RpcV2CborSparseMaps", "path was incorrect");
|
285 279 | }
|
286 280 |
|
287 281 | /// Serializes null map values in sparse maps
|
288 282 | /// Test ID: RpcV2CborSerializesNullMapValues
|
289 283 | #[::tokio::test]
|
290 284 | #[::tracing_test::traced_test]
|
291 285 | async fn rpc_v2_cbor_serializes_null_map_values_request() {
|
292 286 | let (http_client, request_receiver) = ::aws_smithy_runtime::client::http::test_util::capture_request(None);
|
293 287 | let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
|
294 288 |
|
295 289 | let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
|
296 290 | let result = client
|
297 291 | .rpc_v2_cbor_sparse_maps()
|
298 292 | .set_sparse_boolean_map(::std::option::Option::Some({
|
299 293 | let mut ret = ::std::collections::HashMap::new();
|
300 294 | ret.insert("x".to_owned(), ::std::option::Option::None);
|
301 295 | ret
|
302 296 | }))
|
303 297 | .set_sparse_number_map(::std::option::Option::Some({
|
304 298 | let mut ret = ::std::collections::HashMap::new();
|
305 299 | ret.insert("x".to_owned(), ::std::option::Option::None);
|
306 300 | ret
|
307 301 | }))
|
308 302 | .set_sparse_string_map(::std::option::Option::Some({
|
309 303 | let mut ret = ::std::collections::HashMap::new();
|
310 304 | ret.insert("x".to_owned(), ::std::option::Option::None);
|
311 305 | ret
|
312 306 | }))
|
313 307 | .set_sparse_struct_map(::std::option::Option::Some({
|
314 308 | let mut ret = ::std::collections::HashMap::new();
|
315 309 | ret.insert("x".to_owned(), ::std::option::Option::None);
|
316 310 | ret
|
317 311 | }))
|
318 312 | .send()
|
319 313 | .await;
|
320 314 | let _ = dbg!(result);
|
321 315 | let http_request = request_receiver.expect_request();
|
322 - | let expected_headers = [
|
323 - | ("Accept", "application/cbor"),
|
324 - | ("Content-Type", "application/cbor"),
|
325 - | ("smithy-protocol", "rpc-v2-cbor"),
|
326 - | ];
|
316 + | let expected_headers = [("Content-Type", "application/cbor"), ("smithy-protocol", "rpc-v2-cbor")];
|
327 317 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
|
328 318 | let required_headers = &["Content-Length"];
|
329 319 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::require_headers(http_request.headers(), required_headers));
|
330 320 | let body = http_request.body().bytes().expect("body should be strict");
|
331 321 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
|
332 322 | body,
|
333 323 | "v3BzcGFyc2VCb29sZWFuTWFwv2F49v9vc3BhcnNlTnVtYmVyTWFwv2F49v9vc3BhcnNlU3RyaW5nTWFwv2F49v9vc3BhcnNlU3RydWN0TWFwv2F49v//",
|
334 324 | ::aws_smithy_protocol_test::MediaType::from("application/cbor"),
|
335 325 | ));
|
336 326 | let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
|
337 327 | ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
|
338 328 | ::pretty_assertions::assert_eq!(uri.path(), "/service/RpcV2Protocol/operation/RpcV2CborSparseMaps", "path was incorrect");
|
339 329 | }
|
340 330 |
|
341 331 | /// A request that contains a sparse map of sets
|
342 332 | /// Test ID: RpcV2CborSerializesSparseSetMap
|
343 333 | #[::tokio::test]
|
344 334 | #[::tracing_test::traced_test]
|
345 335 | async fn rpc_v2_cbor_serializes_sparse_set_map_request() {
|
346 336 | let (http_client, request_receiver) = ::aws_smithy_runtime::client::http::test_util::capture_request(None);
|
347 337 | let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
|
348 338 |
|
349 339 | let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
|
350 340 | let result = client
|
351 341 | .rpc_v2_cbor_sparse_maps()
|
352 342 | .set_sparse_set_map(::std::option::Option::Some({
|
353 343 | let mut ret = ::std::collections::HashMap::new();
|
354 344 | ret.insert("x".to_owned(), ::std::option::Option::Some(vec![]));
|
355 345 | ret.insert("y".to_owned(), ::std::option::Option::Some(vec!["a".to_owned(), "b".to_owned()]));
|
356 346 | ret
|
357 347 | }))
|
358 348 | .send()
|
359 349 | .await;
|
360 350 | let _ = dbg!(result);
|
361 351 | let http_request = request_receiver.expect_request();
|
362 - | let expected_headers = [
|
363 - | ("Accept", "application/cbor"),
|
364 - | ("Content-Type", "application/cbor"),
|
365 - | ("smithy-protocol", "rpc-v2-cbor"),
|
366 - | ];
|
352 + | let expected_headers = [("Content-Type", "application/cbor"), ("smithy-protocol", "rpc-v2-cbor")];
|
367 353 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
|
368 354 | let required_headers = &["Content-Length"];
|
369 355 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::require_headers(http_request.headers(), required_headers));
|
370 356 | let body = http_request.body().bytes().expect("body should be strict");
|
371 357 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
|
372 358 | body,
|
373 359 | "v2xzcGFyc2VTZXRNYXC/YXif/2F5n2FhYWL///8=",
|
374 360 | ::aws_smithy_protocol_test::MediaType::from("application/cbor"),
|
375 361 | ));
|
376 362 | let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
|
377 363 | ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
|
378 364 | ::pretty_assertions::assert_eq!(uri.path(), "/service/RpcV2Protocol/operation/RpcV2CborSparseMaps", "path was incorrect");
|
379 365 | }
|
380 366 |
|
381 367 | /// A request that contains a sparse map of sets.
|
382 368 | /// Test ID: RpcV2CborSerializesSparseSetMapAndRetainsNull
|
383 369 | #[::tokio::test]
|
384 370 | #[::tracing_test::traced_test]
|
385 371 | async fn rpc_v2_cbor_serializes_sparse_set_map_and_retains_null_request() {
|
386 372 | let (http_client, request_receiver) = ::aws_smithy_runtime::client::http::test_util::capture_request(None);
|
387 373 | let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
|
388 374 |
|
389 375 | let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
|
390 376 | let result = client
|
391 377 | .rpc_v2_cbor_sparse_maps()
|
392 378 | .set_sparse_set_map(::std::option::Option::Some({
|
393 379 | let mut ret = ::std::collections::HashMap::new();
|
394 380 | ret.insert("x".to_owned(), ::std::option::Option::Some(vec![]));
|
395 381 | ret.insert("y".to_owned(), ::std::option::Option::Some(vec!["a".to_owned(), "b".to_owned()]));
|
396 382 | ret.insert("z".to_owned(), ::std::option::Option::None);
|
397 383 | ret
|
398 384 | }))
|
399 385 | .send()
|
400 386 | .await;
|
401 387 | let _ = dbg!(result);
|
402 388 | let http_request = request_receiver.expect_request();
|
403 - | let expected_headers = [
|
404 - | ("Accept", "application/cbor"),
|
405 - | ("Content-Type", "application/cbor"),
|
406 - | ("smithy-protocol", "rpc-v2-cbor"),
|
407 - | ];
|
389 + | let expected_headers = [("Content-Type", "application/cbor"), ("smithy-protocol", "rpc-v2-cbor")];
|
408 390 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
|
409 391 | let required_headers = &["Content-Length"];
|
410 392 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::require_headers(http_request.headers(), required_headers));
|
411 393 | let body = http_request.body().bytes().expect("body should be strict");
|
412 394 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
|
413 395 | body,
|
414 396 | "v2xzcGFyc2VTZXRNYXC/YXif/2F5n2FhYWL/YXr2//8=",
|
415 397 | ::aws_smithy_protocol_test::MediaType::from("application/cbor"),
|
416 398 | ));
|
417 399 | let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
|
418 400 | ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
|
419 401 | ::pretty_assertions::assert_eq!(uri.path(), "/service/RpcV2Protocol/operation/RpcV2CborSparseMaps", "path was incorrect");
|
420 402 | }
|
421 403 |
|
422 404 | /// Ensure that 0 and false are sent over the wire in all maps and lists
|
423 405 | /// Test ID: RpcV2CborSerializesZeroValuesInSparseMaps
|
424 406 | #[::tokio::test]
|
425 407 | #[::tracing_test::traced_test]
|
426 408 | async fn rpc_v2_cbor_serializes_zero_values_in_sparse_maps_request() {
|
427 409 | let (http_client, request_receiver) = ::aws_smithy_runtime::client::http::test_util::capture_request(None);
|
428 410 | let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
|
429 411 |
|
430 412 | let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
|
431 413 | let result = client
|
432 414 | .rpc_v2_cbor_sparse_maps()
|
433 415 | .set_sparse_number_map(::std::option::Option::Some({
|
434 416 | let mut ret = ::std::collections::HashMap::new();
|
435 417 | ret.insert("x".to_owned(), ::std::option::Option::Some(0));
|
436 418 | ret
|
437 419 | }))
|
438 420 | .set_sparse_boolean_map(::std::option::Option::Some({
|
439 421 | let mut ret = ::std::collections::HashMap::new();
|
440 422 | ret.insert("x".to_owned(), ::std::option::Option::Some(false));
|
441 423 | ret
|
442 424 | }))
|
443 425 | .send()
|
444 426 | .await;
|
445 427 | let _ = dbg!(result);
|
446 428 | let http_request = request_receiver.expect_request();
|
447 - | let expected_headers = [
|
448 - | ("Accept", "application/cbor"),
|
449 - | ("Content-Type", "application/cbor"),
|
450 - | ("smithy-protocol", "rpc-v2-cbor"),
|
451 - | ];
|
429 + | let expected_headers = [("Content-Type", "application/cbor"), ("smithy-protocol", "rpc-v2-cbor")];
|
452 430 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
|
453 431 | let required_headers = &["Content-Length"];
|
454 432 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::require_headers(http_request.headers(), required_headers));
|
455 433 | let body = http_request.body().bytes().expect("body should be strict");
|
456 434 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
|
457 435 | body,
|
458 436 | "v29zcGFyc2VOdW1iZXJNYXC/YXgA/3BzcGFyc2VCb29sZWFuTWFwv2F49P//",
|
459 437 | ::aws_smithy_protocol_test::MediaType::from("application/cbor"),
|
460 438 | ));
|
461 439 | let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
|