4104 4333 | "we expected operation handler to be invoked but it was not entered"
|
4105 4334 | );
|
4106 4335 | }
|
4107 4336 |
|
4108 4337 | /// Serializes integer shapes
|
4109 4338 | /// Test ID: serializes_integer_shapes
|
4110 4339 | #[::tokio::test]
|
4111 4340 | #[::tracing_test::traced_test]
|
4112 4341 | async fn serializes_integer_shapes_request() {
|
4113 4342 | #[allow(unused_mut)]
|
4114 - | let mut http_request = http::Request::builder()
|
4343 + | let mut http_request = ::http_1x::Request::builder()
|
4115 4344 | .uri("/")
|
4116 4345 | .method("POST")
|
4117 4346 | .header("Content-Type", "application/x-amz-json-1.1")
|
4118 4347 | .header("X-Amz-Target", "JsonProtocol.KitchenSinkOperation")
|
4119 - | .body(::aws_smithy_http_server::body::Body::from(
|
4120 - | ::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
|
4121 - | "{\"Integer\":1234}".as_bytes(),
|
4122 - | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
4348 + | .body(::aws_smithy_http_server::body::boxed(
|
4349 + | ::http_body_util::Full::new(::bytes::Bytes::copy_from_slice(
|
4350 + | &::aws_smithy_protocol_test::decode_body_data(
|
4351 + | "{\"Integer\":1234}".as_bytes(),
|
4352 + | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
4353 + | ),
|
4123 4354 | )),
|
4124 4355 | ))
|
4125 4356 | .unwrap();
|
4126 4357 | #[allow(unused_mut)]
|
4127 4358 | let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
|
4128 4359 | let config = crate::service::JsonProtocolConfig::builder().build();
|
4129 - | let service = crate::service::JsonProtocol::builder::<::hyper::body::Body, _, _, _>(config)
|
4130 - | .kitchen_sink_operation(move |input: crate::input::KitchenSinkOperationInput| {
|
4131 - | let sender = sender.clone();
|
4132 - | async move {
|
4133 - | let result = {
|
4134 - | use ::aws_smithy_protocol_test::FloatEquals;
|
4135 - | let expected = crate::input::KitchenSinkOperationInput {
|
4136 - | integer: ::std::option::Option::Some(1234),
|
4137 - | blob: ::std::option::Option::None,
|
4138 - | boolean: ::std::option::Option::None,
|
4139 - | double: ::std::option::Option::None,
|
4140 - | empty_struct: ::std::option::Option::None,
|
4141 - | float: ::std::option::Option::None,
|
4142 - | httpdate_timestamp: ::std::option::Option::None,
|
4143 - | iso8601_timestamp: ::std::option::Option::None,
|
4144 - | json_value: ::std::option::Option::None,
|
4145 - | list_of_lists: ::std::option::Option::None,
|
4146 - | list_of_maps_of_strings: ::std::option::Option::None,
|
4147 - | list_of_strings: ::std::option::Option::None,
|
4148 - | list_of_structs: ::std::option::Option::None,
|
4149 - | long: ::std::option::Option::None,
|
4150 - | map_of_lists_of_strings: ::std::option::Option::None,
|
4151 - | map_of_maps: ::std::option::Option::None,
|
4152 - | map_of_strings: ::std::option::Option::None,
|
4153 - | map_of_structs: ::std::option::Option::None,
|
4154 - | recursive_list: ::std::option::Option::None,
|
4155 - | recursive_map: ::std::option::Option::None,
|
4156 - | recursive_struct: ::std::option::Option::None,
|
4157 - | simple_struct: ::std::option::Option::None,
|
4158 - | string: ::std::option::Option::None,
|
4159 - | struct_with_json_name: ::std::option::Option::None,
|
4160 - | timestamp: ::std::option::Option::None,
|
4161 - | unix_timestamp: ::std::option::Option::None,
|
4162 - | };
|
4163 - | ::pretty_assertions::assert_eq!(
|
4164 - | input.blob,
|
4165 - | expected.blob,
|
4166 - | "Unexpected value for `blob`"
|
4167 - | );
|
4168 - | ::pretty_assertions::assert_eq!(
|
4169 - | input.boolean,
|
4170 - | expected.boolean,
|
4171 - | "Unexpected value for `boolean`"
|
4172 - | );
|
4173 - | assert!(
|
4174 - | input.double.float_equals(&expected.double),
|
4175 - | "Unexpected value for `double` {:?} vs. {:?}",
|
4176 - | expected.double,
|
4177 - | input.double
|
4178 - | );
|
4179 - | ::pretty_assertions::assert_eq!(
|
4180 - | input.empty_struct,
|
4181 - | expected.empty_struct,
|
4182 - | "Unexpected value for `empty_struct`"
|
4183 - | );
|
4184 - | assert!(
|
4185 - | input.float.float_equals(&expected.float),
|
4186 - | "Unexpected value for `float` {:?} vs. {:?}",
|
4187 - | expected.float,
|
4188 - | input.float
|
4189 - | );
|
4190 - | ::pretty_assertions::assert_eq!(
|
4191 - | input.httpdate_timestamp,
|
4192 - | expected.httpdate_timestamp,
|
4193 - | "Unexpected value for `httpdate_timestamp`"
|
4194 - | );
|
4195 - | ::pretty_assertions::assert_eq!(
|
4196 - | input.integer,
|
4197 - | expected.integer,
|
4198 - | "Unexpected value for `integer`"
|
4199 - | );
|
4200 - | ::pretty_assertions::assert_eq!(
|
4201 - | input.iso8601_timestamp,
|
4202 - | expected.iso8601_timestamp,
|
4203 - | "Unexpected value for `iso8601_timestamp`"
|
4204 - | );
|
4205 - | ::pretty_assertions::assert_eq!(
|
4206 - | input.json_value,
|
4207 - | expected.json_value,
|
4208 - | "Unexpected value for `json_value`"
|
4209 - | );
|
4210 - | ::pretty_assertions::assert_eq!(
|
4211 - | input.list_of_lists,
|
4212 - | expected.list_of_lists,
|
4213 - | "Unexpected value for `list_of_lists`"
|
4214 - | );
|
4215 - | ::pretty_assertions::assert_eq!(
|
4216 - | input.list_of_maps_of_strings,
|
4217 - | expected.list_of_maps_of_strings,
|
4218 - | "Unexpected value for `list_of_maps_of_strings`"
|
4219 - | );
|
4220 - | ::pretty_assertions::assert_eq!(
|
4221 - | input.list_of_strings,
|
4222 - | expected.list_of_strings,
|
4223 - | "Unexpected value for `list_of_strings`"
|
4224 - | );
|
4225 - | ::pretty_assertions::assert_eq!(
|
4226 - | input.list_of_structs,
|
4227 - | expected.list_of_structs,
|
4228 - | "Unexpected value for `list_of_structs`"
|
4229 - | );
|
4230 - | ::pretty_assertions::assert_eq!(
|
4231 - | input.long,
|
4232 - | expected.long,
|
4233 - | "Unexpected value for `long`"
|
4234 - | );
|
4235 - | ::pretty_assertions::assert_eq!(
|
4236 - | input.map_of_lists_of_strings,
|
4237 - | expected.map_of_lists_of_strings,
|
4238 - | "Unexpected value for `map_of_lists_of_strings`"
|
4239 - | );
|
4240 - | ::pretty_assertions::assert_eq!(
|
4241 - | input.map_of_maps,
|
4242 - | expected.map_of_maps,
|
4243 - | "Unexpected value for `map_of_maps`"
|
4244 - | );
|
4245 - | ::pretty_assertions::assert_eq!(
|
4246 - | input.map_of_strings,
|
4247 - | expected.map_of_strings,
|
4248 - | "Unexpected value for `map_of_strings`"
|
4249 - | );
|
4250 - | ::pretty_assertions::assert_eq!(
|
4251 - | input.map_of_structs,
|
4252 - | expected.map_of_structs,
|
4253 - | "Unexpected value for `map_of_structs`"
|
4254 - | );
|
4255 - | ::pretty_assertions::assert_eq!(
|
4256 - | input.recursive_list,
|
4257 - | expected.recursive_list,
|
4258 - | "Unexpected value for `recursive_list`"
|
4259 - | );
|
4260 - | ::pretty_assertions::assert_eq!(
|
4261 - | input.recursive_map,
|
4262 - | expected.recursive_map,
|
4263 - | "Unexpected value for `recursive_map`"
|
4264 - | );
|
4265 - | ::pretty_assertions::assert_eq!(
|
4266 - | input.recursive_struct,
|
4267 - | expected.recursive_struct,
|
4268 - | "Unexpected value for `recursive_struct`"
|
4269 - | );
|
4270 - | ::pretty_assertions::assert_eq!(
|
4271 - | input.simple_struct,
|
4272 - | expected.simple_struct,
|
4273 - | "Unexpected value for `simple_struct`"
|
4274 - | );
|
4275 - | ::pretty_assertions::assert_eq!(
|
4276 - | input.string,
|
4277 - | expected.string,
|
4278 - | "Unexpected value for `string`"
|
4279 - | );
|
4280 - | ::pretty_assertions::assert_eq!(
|
4281 - | input.struct_with_json_name,
|
4282 - | expected.struct_with_json_name,
|
4283 - | "Unexpected value for `struct_with_json_name`"
|
4284 - | );
|
4285 - | ::pretty_assertions::assert_eq!(
|
4286 - | input.timestamp,
|
4287 - | expected.timestamp,
|
4288 - | "Unexpected value for `timestamp`"
|
4289 - | );
|
4290 - | ::pretty_assertions::assert_eq!(
|
4291 - | input.unix_timestamp,
|
4292 - | expected.unix_timestamp,
|
4293 - | "Unexpected value for `unix_timestamp`"
|
4294 - | );
|
4295 - | let output = crate::output::KitchenSinkOperationOutput {
|
4296 - | blob: ::std::option::Option::None,
|
4297 - | boolean: ::std::option::Option::None,
|
4298 - | double: ::std::option::Option::None,
|
4299 - | empty_struct: ::std::option::Option::None,
|
4300 - | float: ::std::option::Option::None,
|
4301 - | httpdate_timestamp: ::std::option::Option::None,
|
4302 - | integer: ::std::option::Option::None,
|
4303 - | iso8601_timestamp: ::std::option::Option::None,
|
4304 - | json_value: ::std::option::Option::None,
|
4305 - | list_of_lists: ::std::option::Option::None,
|
4306 - | list_of_maps_of_strings: ::std::option::Option::None,
|
4307 - | list_of_strings: ::std::option::Option::None,
|
4308 - | list_of_structs: ::std::option::Option::None,
|
4309 - | long: ::std::option::Option::None,
|
4310 - | map_of_lists_of_strings: ::std::option::Option::None,
|
4311 - | map_of_maps: ::std::option::Option::None,
|
4312 - | map_of_strings: ::std::option::Option::None,
|
4313 - | map_of_structs: ::std::option::Option::None,
|
4314 - | recursive_list: ::std::option::Option::None,
|
4315 - | recursive_map: ::std::option::Option::None,
|
4316 - | recursive_struct: ::std::option::Option::None,
|
4317 - | simple_struct: ::std::option::Option::None,
|
4318 - | string: ::std::option::Option::None,
|
4319 - | struct_with_json_name: ::std::option::Option::None,
|
4320 - | timestamp: ::std::option::Option::None,
|
4321 - | unix_timestamp: ::std::option::Option::None,
|
4322 - | };
|
4323 - | Ok(output)
|
4360 + | let service = crate::service::JsonProtocol::builder::<
|
4361 + | ::aws_smithy_http_server::body::BoxBody,
|
4362 + | _,
|
4363 + | _,
|
4364 + | _,
|
4365 + | >(config)
|
4366 + | .kitchen_sink_operation(move |input: crate::input::KitchenSinkOperationInput| {
|
4367 + | let sender = sender.clone();
|
4368 + | async move {
|
4369 + | let result = {
|
4370 + | use ::aws_smithy_protocol_test::FloatEquals;
|
4371 + | let expected = crate::input::KitchenSinkOperationInput {
|
4372 + | integer: ::std::option::Option::Some(1234),
|
4373 + | blob: ::std::option::Option::None,
|
4374 + | boolean: ::std::option::Option::None,
|
4375 + | double: ::std::option::Option::None,
|
4376 + | empty_struct: ::std::option::Option::None,
|
4377 + | float: ::std::option::Option::None,
|
4378 + | httpdate_timestamp: ::std::option::Option::None,
|
4379 + | iso8601_timestamp: ::std::option::Option::None,
|
4380 + | json_value: ::std::option::Option::None,
|
4381 + | list_of_lists: ::std::option::Option::None,
|
4382 + | list_of_maps_of_strings: ::std::option::Option::None,
|
4383 + | list_of_strings: ::std::option::Option::None,
|
4384 + | list_of_structs: ::std::option::Option::None,
|
4385 + | long: ::std::option::Option::None,
|
4386 + | map_of_lists_of_strings: ::std::option::Option::None,
|
4387 + | map_of_maps: ::std::option::Option::None,
|
4388 + | map_of_strings: ::std::option::Option::None,
|
4389 + | map_of_structs: ::std::option::Option::None,
|
4390 + | recursive_list: ::std::option::Option::None,
|
4391 + | recursive_map: ::std::option::Option::None,
|
4392 + | recursive_struct: ::std::option::Option::None,
|
4393 + | simple_struct: ::std::option::Option::None,
|
4394 + | string: ::std::option::Option::None,
|
4395 + | struct_with_json_name: ::std::option::Option::None,
|
4396 + | timestamp: ::std::option::Option::None,
|
4397 + | unix_timestamp: ::std::option::Option::None,
|
4324 4398 | };
|
4325 - | sender.send(()).await.expect("receiver dropped early");
|
4326 - | result
|
4327 - | }
|
4328 - | })
|
4329 - | .build_unchecked();
|
4330 - | let http_response = ::tower::ServiceExt::oneshot(service, http_request)
|
4331 - | .await
|
4332 - | .expect("unable to make an HTTP request");
|
4333 - | assert!(
|
4334 - | receiver.recv().await.is_some(),
|
4335 - | "we expected operation handler to be invoked but it was not entered"
|
4336 - | );
|
4337 - | }
|
4399 + | ::pretty_assertions::assert_eq!(
|
4400 + | input.blob,
|
4401 + | expected.blob,
|
4402 + | "Unexpected value for `blob`"
|
4403 + | );
|
4404 + | ::pretty_assertions::assert_eq!(
|
4405 + | input.boolean,
|
4406 + | expected.boolean,
|
4407 + | "Unexpected value for `boolean`"
|
4408 + | );
|
4409 + | assert!(
|
4410 + | input.double.float_equals(&expected.double),
|
4411 + | "Unexpected value for `double` {:?} vs. {:?}",
|
4412 + | expected.double,
|
4413 + | input.double
|
4414 + | );
|
4415 + | ::pretty_assertions::assert_eq!(
|
4416 + | input.empty_struct,
|
4417 + | expected.empty_struct,
|
4418 + | "Unexpected value for `empty_struct`"
|
4419 + | );
|
4420 + | assert!(
|
4421 + | input.float.float_equals(&expected.float),
|
4422 + | "Unexpected value for `float` {:?} vs. {:?}",
|
4423 + | expected.float,
|
4424 + | input.float
|
4425 + | );
|
4426 + | ::pretty_assertions::assert_eq!(
|
4427 + | input.httpdate_timestamp,
|
4428 + | expected.httpdate_timestamp,
|
4429 + | "Unexpected value for `httpdate_timestamp`"
|
4430 + | );
|
4431 + | ::pretty_assertions::assert_eq!(
|
4432 + | input.integer,
|
4433 + | expected.integer,
|
4434 + | "Unexpected value for `integer`"
|
4435 + | );
|
4436 + | ::pretty_assertions::assert_eq!(
|
4437 + | input.iso8601_timestamp,
|
4438 + | expected.iso8601_timestamp,
|
4439 + | "Unexpected value for `iso8601_timestamp`"
|
4440 + | );
|
4441 + | ::pretty_assertions::assert_eq!(
|
4442 + | input.json_value,
|
4443 + | expected.json_value,
|
4444 + | "Unexpected value for `json_value`"
|
4445 + | );
|
4446 + | ::pretty_assertions::assert_eq!(
|
4447 + | input.list_of_lists,
|
4448 + | expected.list_of_lists,
|
4449 + | "Unexpected value for `list_of_lists`"
|
4450 + | );
|
4451 + | ::pretty_assertions::assert_eq!(
|
4452 + | input.list_of_maps_of_strings,
|
4453 + | expected.list_of_maps_of_strings,
|
4454 + | "Unexpected value for `list_of_maps_of_strings`"
|
4455 + | );
|
4456 + | ::pretty_assertions::assert_eq!(
|
4457 + | input.list_of_strings,
|
4458 + | expected.list_of_strings,
|
4459 + | "Unexpected value for `list_of_strings`"
|
4460 + | );
|
4461 + | ::pretty_assertions::assert_eq!(
|
4462 + | input.list_of_structs,
|
4463 + | expected.list_of_structs,
|
4464 + | "Unexpected value for `list_of_structs`"
|
4465 + | );
|
4466 + | ::pretty_assertions::assert_eq!(
|
4467 + | input.long,
|
4468 + | expected.long,
|
4469 + | "Unexpected value for `long`"
|
4470 + | );
|
4471 + | ::pretty_assertions::assert_eq!(
|
4472 + | input.map_of_lists_of_strings,
|
4473 + | expected.map_of_lists_of_strings,
|
4474 + | "Unexpected value for `map_of_lists_of_strings`"
|
4475 + | );
|
4476 + | ::pretty_assertions::assert_eq!(
|
4477 + | input.map_of_maps,
|
4478 + | expected.map_of_maps,
|
4479 + | "Unexpected value for `map_of_maps`"
|
4480 + | );
|
4481 + | ::pretty_assertions::assert_eq!(
|
4482 + | input.map_of_strings,
|
4483 + | expected.map_of_strings,
|
4484 + | "Unexpected value for `map_of_strings`"
|
4485 + | );
|
4486 + | ::pretty_assertions::assert_eq!(
|
4487 + | input.map_of_structs,
|
4488 + | expected.map_of_structs,
|
4489 + | "Unexpected value for `map_of_structs`"
|
4490 + | );
|
4491 + | ::pretty_assertions::assert_eq!(
|
4492 + | input.recursive_list,
|
4493 + | expected.recursive_list,
|
4494 + | "Unexpected value for `recursive_list`"
|
4495 + | );
|
4496 + | ::pretty_assertions::assert_eq!(
|
4497 + | input.recursive_map,
|
4498 + | expected.recursive_map,
|
4499 + | "Unexpected value for `recursive_map`"
|
4500 + | );
|
4501 + | ::pretty_assertions::assert_eq!(
|
4502 + | input.recursive_struct,
|
4503 + | expected.recursive_struct,
|
4504 + | "Unexpected value for `recursive_struct`"
|
4505 + | );
|
4506 + | ::pretty_assertions::assert_eq!(
|
4507 + | input.simple_struct,
|
4508 + | expected.simple_struct,
|
4509 + | "Unexpected value for `simple_struct`"
|
4510 + | );
|
4511 + | ::pretty_assertions::assert_eq!(
|
4512 + | input.string,
|
4513 + | expected.string,
|
4514 + | "Unexpected value for `string`"
|
4515 + | );
|
4516 + | ::pretty_assertions::assert_eq!(
|
4517 + | input.struct_with_json_name,
|
4518 + | expected.struct_with_json_name,
|
4519 + | "Unexpected value for `struct_with_json_name`"
|
4520 + | );
|
4521 + | ::pretty_assertions::assert_eq!(
|
4522 + | input.timestamp,
|
4523 + | expected.timestamp,
|
4524 + | "Unexpected value for `timestamp`"
|
4525 + | );
|
4526 + | ::pretty_assertions::assert_eq!(
|
4527 + | input.unix_timestamp,
|
4528 + | expected.unix_timestamp,
|
4529 + | "Unexpected value for `unix_timestamp`"
|
4530 + | );
|
4531 + | let output = crate::output::KitchenSinkOperationOutput {
|
4532 + | blob: ::std::option::Option::None,
|
4533 + | boolean: ::std::option::Option::None,
|
4534 + | double: ::std::option::Option::None,
|
4535 + | empty_struct: ::std::option::Option::None,
|
4536 + | float: ::std::option::Option::None,
|
4537 + | httpdate_timestamp: ::std::option::Option::None,
|
4538 + | integer: ::std::option::Option::None,
|
4539 + | iso8601_timestamp: ::std::option::Option::None,
|
4540 + | json_value: ::std::option::Option::None,
|
4541 + | list_of_lists: ::std::option::Option::None,
|
4542 + | list_of_maps_of_strings: ::std::option::Option::None,
|
4543 + | list_of_strings: ::std::option::Option::None,
|
4544 + | list_of_structs: ::std::option::Option::None,
|
4545 + | long: ::std::option::Option::None,
|
4546 + | map_of_lists_of_strings: ::std::option::Option::None,
|
4547 + | map_of_maps: ::std::option::Option::None,
|
4548 + | map_of_strings: ::std::option::Option::None,
|
4549 + | map_of_structs: ::std::option::Option::None,
|
4550 + | recursive_list: ::std::option::Option::None,
|
4551 + | recursive_map: ::std::option::Option::None,
|
4552 + | recursive_struct: ::std::option::Option::None,
|
4553 + | simple_struct: ::std::option::Option::None,
|
4554 + | string: ::std::option::Option::None,
|
4555 + | struct_with_json_name: ::std::option::Option::None,
|
4556 + | timestamp: ::std::option::Option::None,
|
4557 + | unix_timestamp: ::std::option::Option::None,
|
4558 + | };
|
4559 + | Ok(output)
|
4560 + | };
|
4561 + | sender.send(()).await.expect("receiver dropped early");
|
4562 + | result
|
4563 + | }
|
4564 + | })
|
4565 + | .build_unchecked();
|
4566 + | let http_response = ::tower::ServiceExt::oneshot(service, http_request)
|
4567 + | .await
|
4568 + | .expect("unable to make an HTTP request");
|
4569 + | assert!(
|
4570 + | receiver.recv().await.is_some(),
|
4571 + | "we expected operation handler to be invoked but it was not entered"
|
4572 + | );
|
4573 + | }
|
4338 4574 |
|
4339 4575 | /// Serializes long shapes
|
4340 4576 | /// Test ID: serializes_long_shapes
|
4341 4577 | #[::tokio::test]
|
4342 4578 | #[::tracing_test::traced_test]
|
4343 4579 | async fn serializes_long_shapes_request() {
|
4344 4580 | #[allow(unused_mut)]
|
4345 - | let mut http_request = http::Request::builder()
|
4581 + | let mut http_request = ::http_1x::Request::builder()
|
4346 4582 | .uri("/")
|
4347 4583 | .method("POST")
|
4348 4584 | .header("Content-Type", "application/x-amz-json-1.1")
|
4349 4585 | .header("X-Amz-Target", "JsonProtocol.KitchenSinkOperation")
|
4350 - | .body(::aws_smithy_http_server::body::Body::from(
|
4351 - | ::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
|
4352 - | "{\"Long\":999999999999}".as_bytes(),
|
4353 - | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
4586 + | .body(::aws_smithy_http_server::body::boxed(
|
4587 + | ::http_body_util::Full::new(::bytes::Bytes::copy_from_slice(
|
4588 + | &::aws_smithy_protocol_test::decode_body_data(
|
4589 + | "{\"Long\":999999999999}".as_bytes(),
|
4590 + | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
4591 + | ),
|
4354 4592 | )),
|
4355 4593 | ))
|
4356 4594 | .unwrap();
|
4357 4595 | #[allow(unused_mut)]
|
4358 4596 | let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
|
4359 4597 | let config = crate::service::JsonProtocolConfig::builder().build();
|
4360 - | let service = crate::service::JsonProtocol::builder::<::hyper::body::Body, _, _, _>(config)
|
4361 - | .kitchen_sink_operation(move |input: crate::input::KitchenSinkOperationInput| {
|
4362 - | let sender = sender.clone();
|
4363 - | async move {
|
4364 - | let result = {
|
4365 - | use ::aws_smithy_protocol_test::FloatEquals;
|
4366 - | let expected = crate::input::KitchenSinkOperationInput {
|
4367 - | long: ::std::option::Option::Some(999999999999),
|
4368 - | blob: ::std::option::Option::None,
|
4369 - | boolean: ::std::option::Option::None,
|
4370 - | double: ::std::option::Option::None,
|
4371 - | empty_struct: ::std::option::Option::None,
|
4372 - | float: ::std::option::Option::None,
|
4373 - | httpdate_timestamp: ::std::option::Option::None,
|
4374 - | integer: ::std::option::Option::None,
|
4375 - | iso8601_timestamp: ::std::option::Option::None,
|
4376 - | json_value: ::std::option::Option::None,
|
4377 - | list_of_lists: ::std::option::Option::None,
|
4378 - | list_of_maps_of_strings: ::std::option::Option::None,
|
4379 - | list_of_strings: ::std::option::Option::None,
|
4380 - | list_of_structs: ::std::option::Option::None,
|
4381 - | map_of_lists_of_strings: ::std::option::Option::None,
|
4382 - | map_of_maps: ::std::option::Option::None,
|
4383 - | map_of_strings: ::std::option::Option::None,
|
4384 - | map_of_structs: ::std::option::Option::None,
|
4385 - | recursive_list: ::std::option::Option::None,
|
4386 - | recursive_map: ::std::option::Option::None,
|
4387 - | recursive_struct: ::std::option::Option::None,
|
4388 - | simple_struct: ::std::option::Option::None,
|
4389 - | string: ::std::option::Option::None,
|
4390 - | struct_with_json_name: ::std::option::Option::None,
|
4391 - | timestamp: ::std::option::Option::None,
|
4392 - | unix_timestamp: ::std::option::Option::None,
|
4393 - | };
|
4394 - | ::pretty_assertions::assert_eq!(
|
4395 - | input.blob,
|
4396 - | expected.blob,
|
4397 - | "Unexpected value for `blob`"
|
4398 - | );
|
4399 - | ::pretty_assertions::assert_eq!(
|
4400 - | input.boolean,
|
4401 - | expected.boolean,
|
4402 - | "Unexpected value for `boolean`"
|
4403 - | );
|
4404 - | assert!(
|
4405 - | input.double.float_equals(&expected.double),
|
4406 - | "Unexpected value for `double` {:?} vs. {:?}",
|
4407 - | expected.double,
|
4408 - | input.double
|
4409 - | );
|
4410 - | ::pretty_assertions::assert_eq!(
|
4411 - | input.empty_struct,
|
4412 - | expected.empty_struct,
|
4413 - | "Unexpected value for `empty_struct`"
|
4414 - | );
|
4415 - | assert!(
|
4416 - | input.float.float_equals(&expected.float),
|
4417 - | "Unexpected value for `float` {:?} vs. {:?}",
|
4418 - | expected.float,
|
4419 - | input.float
|
4420 - | );
|
4421 - | ::pretty_assertions::assert_eq!(
|
4422 - | input.httpdate_timestamp,
|
4423 - | expected.httpdate_timestamp,
|
4424 - | "Unexpected value for `httpdate_timestamp`"
|
4425 - | );
|
4426 - | ::pretty_assertions::assert_eq!(
|
4427 - | input.integer,
|
4428 - | expected.integer,
|
4429 - | "Unexpected value for `integer`"
|
4430 - | );
|
4431 - | ::pretty_assertions::assert_eq!(
|
4432 - | input.iso8601_timestamp,
|
4433 - | expected.iso8601_timestamp,
|
4434 - | "Unexpected value for `iso8601_timestamp`"
|
4435 - | );
|
4436 - | ::pretty_assertions::assert_eq!(
|
4437 - | input.json_value,
|
4438 - | expected.json_value,
|
4439 - | "Unexpected value for `json_value`"
|
4440 - | );
|
4441 - | ::pretty_assertions::assert_eq!(
|
4442 - | input.list_of_lists,
|
4443 - | expected.list_of_lists,
|
4444 - | "Unexpected value for `list_of_lists`"
|
4445 - | );
|
4446 - | ::pretty_assertions::assert_eq!(
|
4447 - | input.list_of_maps_of_strings,
|
4448 - | expected.list_of_maps_of_strings,
|
4449 - | "Unexpected value for `list_of_maps_of_strings`"
|
4450 - | );
|
4451 - | ::pretty_assertions::assert_eq!(
|
4452 - | input.list_of_strings,
|
4453 - | expected.list_of_strings,
|
4454 - | "Unexpected value for `list_of_strings`"
|
4455 - | );
|
4456 - | ::pretty_assertions::assert_eq!(
|
4457 - | input.list_of_structs,
|
4458 - | expected.list_of_structs,
|
4459 - | "Unexpected value for `list_of_structs`"
|
4460 - | );
|
4461 - | ::pretty_assertions::assert_eq!(
|
4462 - | input.long,
|
4463 - | expected.long,
|
4464 - | "Unexpected value for `long`"
|
4465 - | );
|
4466 - | ::pretty_assertions::assert_eq!(
|
4467 - | input.map_of_lists_of_strings,
|
4468 - | expected.map_of_lists_of_strings,
|
4469 - | "Unexpected value for `map_of_lists_of_strings`"
|
4470 - | );
|
4471 - | ::pretty_assertions::assert_eq!(
|
4472 - | input.map_of_maps,
|
4473 - | expected.map_of_maps,
|
4474 - | "Unexpected value for `map_of_maps`"
|
4475 - | );
|
4476 - | ::pretty_assertions::assert_eq!(
|
4477 - | input.map_of_strings,
|
4478 - | expected.map_of_strings,
|
4479 - | "Unexpected value for `map_of_strings`"
|
4480 - | );
|
4481 - | ::pretty_assertions::assert_eq!(
|
4482 - | input.map_of_structs,
|
4483 - | expected.map_of_structs,
|
4484 - | "Unexpected value for `map_of_structs`"
|
4485 - | );
|
4486 - | ::pretty_assertions::assert_eq!(
|
4487 - | input.recursive_list,
|
4488 - | expected.recursive_list,
|
4489 - | "Unexpected value for `recursive_list`"
|
4490 - | );
|
4491 - | ::pretty_assertions::assert_eq!(
|
4492 - | input.recursive_map,
|
4493 - | expected.recursive_map,
|
4494 - | "Unexpected value for `recursive_map`"
|
4495 - | );
|
4496 - | ::pretty_assertions::assert_eq!(
|
4497 - | input.recursive_struct,
|
4498 - | expected.recursive_struct,
|
4499 - | "Unexpected value for `recursive_struct`"
|
4500 - | );
|
4501 - | ::pretty_assertions::assert_eq!(
|
4502 - | input.simple_struct,
|
4503 - | expected.simple_struct,
|
4504 - | "Unexpected value for `simple_struct`"
|
4505 - | );
|
4506 - | ::pretty_assertions::assert_eq!(
|
4507 - | input.string,
|
4508 - | expected.string,
|
4509 - | "Unexpected value for `string`"
|
4510 - | );
|
4511 - | ::pretty_assertions::assert_eq!(
|
4512 - | input.struct_with_json_name,
|
4513 - | expected.struct_with_json_name,
|
4514 - | "Unexpected value for `struct_with_json_name`"
|
4515 - | );
|
4516 - | ::pretty_assertions::assert_eq!(
|
4517 - | input.timestamp,
|
4518 - | expected.timestamp,
|
4519 - | "Unexpected value for `timestamp`"
|
4520 - | );
|
4521 - | ::pretty_assertions::assert_eq!(
|
4522 - | input.unix_timestamp,
|
4523 - | expected.unix_timestamp,
|
4524 - | "Unexpected value for `unix_timestamp`"
|
4525 - | );
|
4526 - | let output = crate::output::KitchenSinkOperationOutput {
|
4527 - | blob: ::std::option::Option::None,
|
4528 - | boolean: ::std::option::Option::None,
|
4529 - | double: ::std::option::Option::None,
|
4530 - | empty_struct: ::std::option::Option::None,
|
4531 - | float: ::std::option::Option::None,
|
4532 - | httpdate_timestamp: ::std::option::Option::None,
|
4533 - | integer: ::std::option::Option::None,
|
4534 - | iso8601_timestamp: ::std::option::Option::None,
|
4535 - | json_value: ::std::option::Option::None,
|
4536 - | list_of_lists: ::std::option::Option::None,
|
4537 - | list_of_maps_of_strings: ::std::option::Option::None,
|
4538 - | list_of_strings: ::std::option::Option::None,
|
4539 - | list_of_structs: ::std::option::Option::None,
|
4540 - | long: ::std::option::Option::None,
|
4541 - | map_of_lists_of_strings: ::std::option::Option::None,
|
4542 - | map_of_maps: ::std::option::Option::None,
|
4543 - | map_of_strings: ::std::option::Option::None,
|
4544 - | map_of_structs: ::std::option::Option::None,
|
4545 - | recursive_list: ::std::option::Option::None,
|
4546 - | recursive_map: ::std::option::Option::None,
|
4547 - | recursive_struct: ::std::option::Option::None,
|
4548 - | simple_struct: ::std::option::Option::None,
|
4549 - | string: ::std::option::Option::None,
|
4550 - | struct_with_json_name: ::std::option::Option::None,
|
4551 - | timestamp: ::std::option::Option::None,
|
4552 - | unix_timestamp: ::std::option::Option::None,
|
4553 - | };
|
4554 - | Ok(output)
|
4598 + | let service = crate::service::JsonProtocol::builder::<
|
4599 + | ::aws_smithy_http_server::body::BoxBody,
|
4600 + | _,
|
4601 + | _,
|
4602 + | _,
|
4603 + | >(config)
|
4604 + | .kitchen_sink_operation(move |input: crate::input::KitchenSinkOperationInput| {
|
4605 + | let sender = sender.clone();
|
4606 + | async move {
|
4607 + | let result = {
|
4608 + | use ::aws_smithy_protocol_test::FloatEquals;
|
4609 + | let expected = crate::input::KitchenSinkOperationInput {
|
4610 + | long: ::std::option::Option::Some(999999999999),
|
4611 + | blob: ::std::option::Option::None,
|
4612 + | boolean: ::std::option::Option::None,
|
4613 + | double: ::std::option::Option::None,
|
4614 + | empty_struct: ::std::option::Option::None,
|
4615 + | float: ::std::option::Option::None,
|
4616 + | httpdate_timestamp: ::std::option::Option::None,
|
4617 + | integer: ::std::option::Option::None,
|
4618 + | iso8601_timestamp: ::std::option::Option::None,
|
4619 + | json_value: ::std::option::Option::None,
|
4620 + | list_of_lists: ::std::option::Option::None,
|
4621 + | list_of_maps_of_strings: ::std::option::Option::None,
|
4622 + | list_of_strings: ::std::option::Option::None,
|
4623 + | list_of_structs: ::std::option::Option::None,
|
4624 + | map_of_lists_of_strings: ::std::option::Option::None,
|
4625 + | map_of_maps: ::std::option::Option::None,
|
4626 + | map_of_strings: ::std::option::Option::None,
|
4627 + | map_of_structs: ::std::option::Option::None,
|
4628 + | recursive_list: ::std::option::Option::None,
|
4629 + | recursive_map: ::std::option::Option::None,
|
4630 + | recursive_struct: ::std::option::Option::None,
|
4631 + | simple_struct: ::std::option::Option::None,
|
4632 + | string: ::std::option::Option::None,
|
4633 + | struct_with_json_name: ::std::option::Option::None,
|
4634 + | timestamp: ::std::option::Option::None,
|
4635 + | unix_timestamp: ::std::option::Option::None,
|
4555 4636 | };
|
4556 - | sender.send(()).await.expect("receiver dropped early");
|
4557 - | result
|
4558 - | }
|
4559 - | })
|
4560 - | .build_unchecked();
|
4637 + | ::pretty_assertions::assert_eq!(
|
4638 + | input.blob,
|
4639 + | expected.blob,
|
4640 + | "Unexpected value for `blob`"
|
4641 + | );
|
4642 + | ::pretty_assertions::assert_eq!(
|
4643 + | input.boolean,
|
4644 + | expected.boolean,
|
4645 + | "Unexpected value for `boolean`"
|
4646 + | );
|
4647 + | assert!(
|
4648 + | input.double.float_equals(&expected.double),
|
4649 + | "Unexpected value for `double` {:?} vs. {:?}",
|
4650 + | expected.double,
|
4651 + | input.double
|
4652 + | );
|
4653 + | ::pretty_assertions::assert_eq!(
|
4654 + | input.empty_struct,
|
4655 + | expected.empty_struct,
|
4656 + | "Unexpected value for `empty_struct`"
|
4657 + | );
|
4658 + | assert!(
|
4659 + | input.float.float_equals(&expected.float),
|
4660 + | "Unexpected value for `float` {:?} vs. {:?}",
|
4661 + | expected.float,
|
4662 + | input.float
|
4663 + | );
|
4664 + | ::pretty_assertions::assert_eq!(
|
4665 + | input.httpdate_timestamp,
|
4666 + | expected.httpdate_timestamp,
|
4667 + | "Unexpected value for `httpdate_timestamp`"
|
4668 + | );
|
4669 + | ::pretty_assertions::assert_eq!(
|
4670 + | input.integer,
|
4671 + | expected.integer,
|
4672 + | "Unexpected value for `integer`"
|
4673 + | );
|
4674 + | ::pretty_assertions::assert_eq!(
|
4675 + | input.iso8601_timestamp,
|
4676 + | expected.iso8601_timestamp,
|
4677 + | "Unexpected value for `iso8601_timestamp`"
|
4678 + | );
|
4679 + | ::pretty_assertions::assert_eq!(
|
4680 + | input.json_value,
|
4681 + | expected.json_value,
|
4682 + | "Unexpected value for `json_value`"
|
4683 + | );
|
4684 + | ::pretty_assertions::assert_eq!(
|
4685 + | input.list_of_lists,
|
4686 + | expected.list_of_lists,
|
4687 + | "Unexpected value for `list_of_lists`"
|
4688 + | );
|
4689 + | ::pretty_assertions::assert_eq!(
|
4690 + | input.list_of_maps_of_strings,
|
4691 + | expected.list_of_maps_of_strings,
|
4692 + | "Unexpected value for `list_of_maps_of_strings`"
|
4693 + | );
|
4694 + | ::pretty_assertions::assert_eq!(
|
4695 + | input.list_of_strings,
|
4696 + | expected.list_of_strings,
|
4697 + | "Unexpected value for `list_of_strings`"
|
4698 + | );
|
4699 + | ::pretty_assertions::assert_eq!(
|
4700 + | input.list_of_structs,
|
4701 + | expected.list_of_structs,
|
4702 + | "Unexpected value for `list_of_structs`"
|
4703 + | );
|
4704 + | ::pretty_assertions::assert_eq!(
|
4705 + | input.long,
|
4706 + | expected.long,
|
4707 + | "Unexpected value for `long`"
|
4708 + | );
|
4709 + | ::pretty_assertions::assert_eq!(
|
4710 + | input.map_of_lists_of_strings,
|
4711 + | expected.map_of_lists_of_strings,
|
4712 + | "Unexpected value for `map_of_lists_of_strings`"
|
4713 + | );
|
4714 + | ::pretty_assertions::assert_eq!(
|
4715 + | input.map_of_maps,
|
4716 + | expected.map_of_maps,
|
4717 + | "Unexpected value for `map_of_maps`"
|
4718 + | );
|
4719 + | ::pretty_assertions::assert_eq!(
|
4720 + | input.map_of_strings,
|
4721 + | expected.map_of_strings,
|
4722 + | "Unexpected value for `map_of_strings`"
|
4723 + | );
|
4724 + | ::pretty_assertions::assert_eq!(
|
4725 + | input.map_of_structs,
|
4726 + | expected.map_of_structs,
|
4727 + | "Unexpected value for `map_of_structs`"
|
4728 + | );
|
4729 + | ::pretty_assertions::assert_eq!(
|
4730 + | input.recursive_list,
|
4731 + | expected.recursive_list,
|
4732 + | "Unexpected value for `recursive_list`"
|
4733 + | );
|
4734 + | ::pretty_assertions::assert_eq!(
|
4735 + | input.recursive_map,
|
4736 + | expected.recursive_map,
|
4737 + | "Unexpected value for `recursive_map`"
|
4738 + | );
|
4739 + | ::pretty_assertions::assert_eq!(
|
4740 + | input.recursive_struct,
|
4741 + | expected.recursive_struct,
|
4742 + | "Unexpected value for `recursive_struct`"
|
4743 + | );
|
4744 + | ::pretty_assertions::assert_eq!(
|
4745 + | input.simple_struct,
|
4746 + | expected.simple_struct,
|
4747 + | "Unexpected value for `simple_struct`"
|
4748 + | );
|
4749 + | ::pretty_assertions::assert_eq!(
|
4750 + | input.string,
|
4751 + | expected.string,
|
4752 + | "Unexpected value for `string`"
|
4753 + | );
|
4754 + | ::pretty_assertions::assert_eq!(
|
4755 + | input.struct_with_json_name,
|
4756 + | expected.struct_with_json_name,
|
4757 + | "Unexpected value for `struct_with_json_name`"
|
4758 + | );
|
4759 + | ::pretty_assertions::assert_eq!(
|
4760 + | input.timestamp,
|
4761 + | expected.timestamp,
|
4762 + | "Unexpected value for `timestamp`"
|
4763 + | );
|
4764 + | ::pretty_assertions::assert_eq!(
|
4765 + | input.unix_timestamp,
|
4766 + | expected.unix_timestamp,
|
4767 + | "Unexpected value for `unix_timestamp`"
|
4768 + | );
|
4769 + | let output = crate::output::KitchenSinkOperationOutput {
|
4770 + | blob: ::std::option::Option::None,
|
4771 + | boolean: ::std::option::Option::None,
|
4772 + | double: ::std::option::Option::None,
|
4773 + | empty_struct: ::std::option::Option::None,
|
4774 + | float: ::std::option::Option::None,
|
4775 + | httpdate_timestamp: ::std::option::Option::None,
|
4776 + | integer: ::std::option::Option::None,
|
4777 + | iso8601_timestamp: ::std::option::Option::None,
|
4778 + | json_value: ::std::option::Option::None,
|
4779 + | list_of_lists: ::std::option::Option::None,
|
4780 + | list_of_maps_of_strings: ::std::option::Option::None,
|
4781 + | list_of_strings: ::std::option::Option::None,
|
4782 + | list_of_structs: ::std::option::Option::None,
|
4783 + | long: ::std::option::Option::None,
|
4784 + | map_of_lists_of_strings: ::std::option::Option::None,
|
4785 + | map_of_maps: ::std::option::Option::None,
|
4786 + | map_of_strings: ::std::option::Option::None,
|
4787 + | map_of_structs: ::std::option::Option::None,
|
4788 + | recursive_list: ::std::option::Option::None,
|
4789 + | recursive_map: ::std::option::Option::None,
|
4790 + | recursive_struct: ::std::option::Option::None,
|
4791 + | simple_struct: ::std::option::Option::None,
|
4792 + | string: ::std::option::Option::None,
|
4793 + | struct_with_json_name: ::std::option::Option::None,
|
4794 + | timestamp: ::std::option::Option::None,
|
4795 + | unix_timestamp: ::std::option::Option::None,
|
4796 + | };
|
4797 + | Ok(output)
|
4798 + | };
|
4799 + | sender.send(()).await.expect("receiver dropped early");
|
4800 + | result
|
4801 + | }
|
4802 + | })
|
4803 + | .build_unchecked();
|
4561 4804 | let http_response = ::tower::ServiceExt::oneshot(service, http_request)
|
4562 4805 | .await
|
4563 4806 | .expect("unable to make an HTTP request");
|
4564 4807 | assert!(
|
4565 4808 | receiver.recv().await.is_some(),
|
4566 4809 | "we expected operation handler to be invoked but it was not entered"
|
4567 4810 | );
|
4568 4811 | }
|
4569 4812 |
|
4570 4813 | /// Serializes float shapes
|
4571 4814 | /// Test ID: serializes_float_shapes
|
4572 4815 | #[::tokio::test]
|
4573 4816 | #[::tracing_test::traced_test]
|
4574 4817 | async fn serializes_float_shapes_request() {
|
4575 4818 | #[allow(unused_mut)]
|
4576 - | let mut http_request = http::Request::builder()
|
4819 + | let mut http_request = ::http_1x::Request::builder()
|
4577 4820 | .uri("/")
|
4578 4821 | .method("POST")
|
4579 4822 | .header("Content-Type", "application/x-amz-json-1.1")
|
4580 4823 | .header("X-Amz-Target", "JsonProtocol.KitchenSinkOperation")
|
4581 - | .body(::aws_smithy_http_server::body::Body::from(
|
4582 - | ::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
|
4583 - | "{\"Float\":1234.5}".as_bytes(),
|
4584 - | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
4824 + | .body(::aws_smithy_http_server::body::boxed(
|
4825 + | ::http_body_util::Full::new(::bytes::Bytes::copy_from_slice(
|
4826 + | &::aws_smithy_protocol_test::decode_body_data(
|
4827 + | "{\"Float\":1234.5}".as_bytes(),
|
4828 + | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
4829 + | ),
|
4585 4830 | )),
|
4586 4831 | ))
|
4587 4832 | .unwrap();
|
4588 4833 | #[allow(unused_mut)]
|
4589 4834 | let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
|
4590 4835 | let config = crate::service::JsonProtocolConfig::builder().build();
|
4591 - | let service = crate::service::JsonProtocol::builder::<::hyper::body::Body, _, _, _>(config)
|
4592 - | .kitchen_sink_operation(move |input: crate::input::KitchenSinkOperationInput| {
|
4593 - | let sender = sender.clone();
|
4594 - | async move {
|
4595 - | let result = {
|
4596 - | use ::aws_smithy_protocol_test::FloatEquals;
|
4597 - | let expected = crate::input::KitchenSinkOperationInput {
|
4598 - | float: ::std::option::Option::Some(1234.5_f32),
|
4599 - | blob: ::std::option::Option::None,
|
4600 - | boolean: ::std::option::Option::None,
|
4601 - | double: ::std::option::Option::None,
|
4602 - | empty_struct: ::std::option::Option::None,
|
4603 - | httpdate_timestamp: ::std::option::Option::None,
|
4604 - | integer: ::std::option::Option::None,
|
4605 - | iso8601_timestamp: ::std::option::Option::None,
|
4606 - | json_value: ::std::option::Option::None,
|
4607 - | list_of_lists: ::std::option::Option::None,
|
4608 - | list_of_maps_of_strings: ::std::option::Option::None,
|
4609 - | list_of_strings: ::std::option::Option::None,
|
4610 - | list_of_structs: ::std::option::Option::None,
|
4611 - | long: ::std::option::Option::None,
|
4612 - | map_of_lists_of_strings: ::std::option::Option::None,
|
4613 - | map_of_maps: ::std::option::Option::None,
|
4614 - | map_of_strings: ::std::option::Option::None,
|
4615 - | map_of_structs: ::std::option::Option::None,
|
4616 - | recursive_list: ::std::option::Option::None,
|
4617 - | recursive_map: ::std::option::Option::None,
|
4618 - | recursive_struct: ::std::option::Option::None,
|
4619 - | simple_struct: ::std::option::Option::None,
|
4620 - | string: ::std::option::Option::None,
|
4621 - | struct_with_json_name: ::std::option::Option::None,
|
4622 - | timestamp: ::std::option::Option::None,
|
4623 - | unix_timestamp: ::std::option::Option::None,
|
4624 - | };
|
4625 - | ::pretty_assertions::assert_eq!(
|
4626 - | input.blob,
|
4627 - | expected.blob,
|
4628 - | "Unexpected value for `blob`"
|
4629 - | );
|
4630 - | ::pretty_assertions::assert_eq!(
|
4631 - | input.boolean,
|
4632 - | expected.boolean,
|
4633 - | "Unexpected value for `boolean`"
|
4634 - | );
|
4635 - | assert!(
|
4636 - | input.double.float_equals(&expected.double),
|
4637 - | "Unexpected value for `double` {:?} vs. {:?}",
|
4638 - | expected.double,
|
4639 - | input.double
|
4640 - | );
|
4641 - | ::pretty_assertions::assert_eq!(
|
4642 - | input.empty_struct,
|
4643 - | expected.empty_struct,
|
4644 - | "Unexpected value for `empty_struct`"
|
4645 - | );
|
4646 - | assert!(
|
4647 - | input.float.float_equals(&expected.float),
|
4648 - | "Unexpected value for `float` {:?} vs. {:?}",
|
4649 - | expected.float,
|
4650 - | input.float
|
4651 - | );
|
4652 - | ::pretty_assertions::assert_eq!(
|
4653 - | input.httpdate_timestamp,
|
4654 - | expected.httpdate_timestamp,
|
4655 - | "Unexpected value for `httpdate_timestamp`"
|
4656 - | );
|
4657 - | ::pretty_assertions::assert_eq!(
|
4658 - | input.integer,
|
4659 - | expected.integer,
|
4660 - | "Unexpected value for `integer`"
|
4661 - | );
|
4662 - | ::pretty_assertions::assert_eq!(
|
4663 - | input.iso8601_timestamp,
|
4664 - | expected.iso8601_timestamp,
|
4665 - | "Unexpected value for `iso8601_timestamp`"
|
4666 - | );
|
4667 - | ::pretty_assertions::assert_eq!(
|
4668 - | input.json_value,
|
4669 - | expected.json_value,
|
4670 - | "Unexpected value for `json_value`"
|
4671 - | );
|
4672 - | ::pretty_assertions::assert_eq!(
|
4673 - | input.list_of_lists,
|
4674 - | expected.list_of_lists,
|
4675 - | "Unexpected value for `list_of_lists`"
|
4676 - | );
|
4677 - | ::pretty_assertions::assert_eq!(
|
4678 - | input.list_of_maps_of_strings,
|
4679 - | expected.list_of_maps_of_strings,
|
4680 - | "Unexpected value for `list_of_maps_of_strings`"
|
4681 - | );
|
4682 - | ::pretty_assertions::assert_eq!(
|
4683 - | input.list_of_strings,
|
4684 - | expected.list_of_strings,
|
4685 - | "Unexpected value for `list_of_strings`"
|
4686 - | );
|
4687 - | ::pretty_assertions::assert_eq!(
|
4688 - | input.list_of_structs,
|
4689 - | expected.list_of_structs,
|
4690 - | "Unexpected value for `list_of_structs`"
|
4691 - | );
|
4692 - | ::pretty_assertions::assert_eq!(
|
4693 - | input.long,
|
4694 - | expected.long,
|
4695 - | "Unexpected value for `long`"
|
4696 - | );
|
4697 - | ::pretty_assertions::assert_eq!(
|
4698 - | input.map_of_lists_of_strings,
|
4699 - | expected.map_of_lists_of_strings,
|
4700 - | "Unexpected value for `map_of_lists_of_strings`"
|
4701 - | );
|
4702 - | ::pretty_assertions::assert_eq!(
|
4703 - | input.map_of_maps,
|
4704 - | expected.map_of_maps,
|
4705 - | "Unexpected value for `map_of_maps`"
|
4706 - | );
|
4707 - | ::pretty_assertions::assert_eq!(
|
4708 - | input.map_of_strings,
|
4709 - | expected.map_of_strings,
|
4710 - | "Unexpected value for `map_of_strings`"
|
4711 - | );
|
4712 - | ::pretty_assertions::assert_eq!(
|
4713 - | input.map_of_structs,
|
4714 - | expected.map_of_structs,
|
4715 - | "Unexpected value for `map_of_structs`"
|
4716 - | );
|
4717 - | ::pretty_assertions::assert_eq!(
|
4718 - | input.recursive_list,
|
4719 - | expected.recursive_list,
|
4720 - | "Unexpected value for `recursive_list`"
|
4721 - | );
|
4722 - | ::pretty_assertions::assert_eq!(
|
4723 - | input.recursive_map,
|
4724 - | expected.recursive_map,
|
4725 - | "Unexpected value for `recursive_map`"
|
4726 - | );
|
4727 - | ::pretty_assertions::assert_eq!(
|
4728 - | input.recursive_struct,
|
4729 - | expected.recursive_struct,
|
4730 - | "Unexpected value for `recursive_struct`"
|
4731 - | );
|
4732 - | ::pretty_assertions::assert_eq!(
|
4733 - | input.simple_struct,
|
4734 - | expected.simple_struct,
|
4735 - | "Unexpected value for `simple_struct`"
|
4736 - | );
|
4737 - | ::pretty_assertions::assert_eq!(
|
4738 - | input.string,
|
4739 - | expected.string,
|
4740 - | "Unexpected value for `string`"
|
4741 - | );
|
4742 - | ::pretty_assertions::assert_eq!(
|
4743 - | input.struct_with_json_name,
|
4744 - | expected.struct_with_json_name,
|
4745 - | "Unexpected value for `struct_with_json_name`"
|
4746 - | );
|
4747 - | ::pretty_assertions::assert_eq!(
|
4748 - | input.timestamp,
|
4749 - | expected.timestamp,
|
4750 - | "Unexpected value for `timestamp`"
|
4751 - | );
|
4752 - | ::pretty_assertions::assert_eq!(
|
4753 - | input.unix_timestamp,
|
4754 - | expected.unix_timestamp,
|
4755 - | "Unexpected value for `unix_timestamp`"
|
4756 - | );
|
4757 - | let output = crate::output::KitchenSinkOperationOutput {
|
4758 - | blob: ::std::option::Option::None,
|
4759 - | boolean: ::std::option::Option::None,
|
4760 - | double: ::std::option::Option::None,
|
4761 - | empty_struct: ::std::option::Option::None,
|
4762 - | float: ::std::option::Option::None,
|
4763 - | httpdate_timestamp: ::std::option::Option::None,
|
4764 - | integer: ::std::option::Option::None,
|
4765 - | iso8601_timestamp: ::std::option::Option::None,
|
4766 - | json_value: ::std::option::Option::None,
|
4767 - | list_of_lists: ::std::option::Option::None,
|
4768 - | list_of_maps_of_strings: ::std::option::Option::None,
|
4769 - | list_of_strings: ::std::option::Option::None,
|
4770 - | list_of_structs: ::std::option::Option::None,
|
4771 - | long: ::std::option::Option::None,
|
4772 - | map_of_lists_of_strings: ::std::option::Option::None,
|
4773 - | map_of_maps: ::std::option::Option::None,
|
4774 - | map_of_strings: ::std::option::Option::None,
|
4775 - | map_of_structs: ::std::option::Option::None,
|
4776 - | recursive_list: ::std::option::Option::None,
|
4777 - | recursive_map: ::std::option::Option::None,
|
4778 - | recursive_struct: ::std::option::Option::None,
|
4779 - | simple_struct: ::std::option::Option::None,
|
4780 - | string: ::std::option::Option::None,
|
4781 - | struct_with_json_name: ::std::option::Option::None,
|
4782 - | timestamp: ::std::option::Option::None,
|
4783 - | unix_timestamp: ::std::option::Option::None,
|
4784 - | };
|
4785 - | Ok(output)
|
4836 + | let service = crate::service::JsonProtocol::builder::<
|
4837 + | ::aws_smithy_http_server::body::BoxBody,
|
4838 + | _,
|
4839 + | _,
|
4840 + | _,
|
4841 + | >(config)
|
4842 + | .kitchen_sink_operation(move |input: crate::input::KitchenSinkOperationInput| {
|
4843 + | let sender = sender.clone();
|
4844 + | async move {
|
4845 + | let result = {
|
4846 + | use ::aws_smithy_protocol_test::FloatEquals;
|
4847 + | let expected = crate::input::KitchenSinkOperationInput {
|
4848 + | float: ::std::option::Option::Some(1234.5_f32),
|
4849 + | blob: ::std::option::Option::None,
|
4850 + | boolean: ::std::option::Option::None,
|
4851 + | double: ::std::option::Option::None,
|
4852 + | empty_struct: ::std::option::Option::None,
|
4853 + | httpdate_timestamp: ::std::option::Option::None,
|
4854 + | integer: ::std::option::Option::None,
|
4855 + | iso8601_timestamp: ::std::option::Option::None,
|
4856 + | json_value: ::std::option::Option::None,
|
4857 + | list_of_lists: ::std::option::Option::None,
|
4858 + | list_of_maps_of_strings: ::std::option::Option::None,
|
4859 + | list_of_strings: ::std::option::Option::None,
|
4860 + | list_of_structs: ::std::option::Option::None,
|
4861 + | long: ::std::option::Option::None,
|
4862 + | map_of_lists_of_strings: ::std::option::Option::None,
|
4863 + | map_of_maps: ::std::option::Option::None,
|
4864 + | map_of_strings: ::std::option::Option::None,
|
4865 + | map_of_structs: ::std::option::Option::None,
|
4866 + | recursive_list: ::std::option::Option::None,
|
4867 + | recursive_map: ::std::option::Option::None,
|
4868 + | recursive_struct: ::std::option::Option::None,
|
4869 + | simple_struct: ::std::option::Option::None,
|
4870 + | string: ::std::option::Option::None,
|
4871 + | struct_with_json_name: ::std::option::Option::None,
|
4872 + | timestamp: ::std::option::Option::None,
|
4873 + | unix_timestamp: ::std::option::Option::None,
|
4786 4874 | };
|
4787 - | sender.send(()).await.expect("receiver dropped early");
|
4788 - | result
|
4789 - | }
|
4790 - | })
|
4791 - | .build_unchecked();
|
4875 + | ::pretty_assertions::assert_eq!(
|
4876 + | input.blob,
|
4877 + | expected.blob,
|
4878 + | "Unexpected value for `blob`"
|
4879 + | );
|
4880 + | ::pretty_assertions::assert_eq!(
|
4881 + | input.boolean,
|
4882 + | expected.boolean,
|
4883 + | "Unexpected value for `boolean`"
|
4884 + | );
|
4885 + | assert!(
|
4886 + | input.double.float_equals(&expected.double),
|
4887 + | "Unexpected value for `double` {:?} vs. {:?}",
|
4888 + | expected.double,
|
4889 + | input.double
|
4890 + | );
|
4891 + | ::pretty_assertions::assert_eq!(
|
4892 + | input.empty_struct,
|
4893 + | expected.empty_struct,
|
4894 + | "Unexpected value for `empty_struct`"
|
4895 + | );
|
4896 + | assert!(
|
4897 + | input.float.float_equals(&expected.float),
|
4898 + | "Unexpected value for `float` {:?} vs. {:?}",
|
4899 + | expected.float,
|
4900 + | input.float
|
4901 + | );
|
4902 + | ::pretty_assertions::assert_eq!(
|
4903 + | input.httpdate_timestamp,
|
4904 + | expected.httpdate_timestamp,
|
4905 + | "Unexpected value for `httpdate_timestamp`"
|
4906 + | );
|
4907 + | ::pretty_assertions::assert_eq!(
|
4908 + | input.integer,
|
4909 + | expected.integer,
|
4910 + | "Unexpected value for `integer`"
|
4911 + | );
|
4912 + | ::pretty_assertions::assert_eq!(
|
4913 + | input.iso8601_timestamp,
|
4914 + | expected.iso8601_timestamp,
|
4915 + | "Unexpected value for `iso8601_timestamp`"
|
4916 + | );
|
4917 + | ::pretty_assertions::assert_eq!(
|
4918 + | input.json_value,
|
4919 + | expected.json_value,
|
4920 + | "Unexpected value for `json_value`"
|
4921 + | );
|
4922 + | ::pretty_assertions::assert_eq!(
|
4923 + | input.list_of_lists,
|
4924 + | expected.list_of_lists,
|
4925 + | "Unexpected value for `list_of_lists`"
|
4926 + | );
|
4927 + | ::pretty_assertions::assert_eq!(
|
4928 + | input.list_of_maps_of_strings,
|
4929 + | expected.list_of_maps_of_strings,
|
4930 + | "Unexpected value for `list_of_maps_of_strings`"
|
4931 + | );
|
4932 + | ::pretty_assertions::assert_eq!(
|
4933 + | input.list_of_strings,
|
4934 + | expected.list_of_strings,
|
4935 + | "Unexpected value for `list_of_strings`"
|
4936 + | );
|
4937 + | ::pretty_assertions::assert_eq!(
|
4938 + | input.list_of_structs,
|
4939 + | expected.list_of_structs,
|
4940 + | "Unexpected value for `list_of_structs`"
|
4941 + | );
|
4942 + | ::pretty_assertions::assert_eq!(
|
4943 + | input.long,
|
4944 + | expected.long,
|
4945 + | "Unexpected value for `long`"
|
4946 + | );
|
4947 + | ::pretty_assertions::assert_eq!(
|
4948 + | input.map_of_lists_of_strings,
|
4949 + | expected.map_of_lists_of_strings,
|
4950 + | "Unexpected value for `map_of_lists_of_strings`"
|
4951 + | );
|
4952 + | ::pretty_assertions::assert_eq!(
|
4953 + | input.map_of_maps,
|
4954 + | expected.map_of_maps,
|
4955 + | "Unexpected value for `map_of_maps`"
|
4956 + | );
|
4957 + | ::pretty_assertions::assert_eq!(
|
4958 + | input.map_of_strings,
|
4959 + | expected.map_of_strings,
|
4960 + | "Unexpected value for `map_of_strings`"
|
4961 + | );
|
4962 + | ::pretty_assertions::assert_eq!(
|
4963 + | input.map_of_structs,
|
4964 + | expected.map_of_structs,
|
4965 + | "Unexpected value for `map_of_structs`"
|
4966 + | );
|
4967 + | ::pretty_assertions::assert_eq!(
|
4968 + | input.recursive_list,
|
4969 + | expected.recursive_list,
|
4970 + | "Unexpected value for `recursive_list`"
|
4971 + | );
|
4972 + | ::pretty_assertions::assert_eq!(
|
4973 + | input.recursive_map,
|
4974 + | expected.recursive_map,
|
4975 + | "Unexpected value for `recursive_map`"
|
4976 + | );
|
4977 + | ::pretty_assertions::assert_eq!(
|
4978 + | input.recursive_struct,
|
4979 + | expected.recursive_struct,
|
4980 + | "Unexpected value for `recursive_struct`"
|
4981 + | );
|
4982 + | ::pretty_assertions::assert_eq!(
|
4983 + | input.simple_struct,
|
4984 + | expected.simple_struct,
|
4985 + | "Unexpected value for `simple_struct`"
|
4986 + | );
|
4987 + | ::pretty_assertions::assert_eq!(
|
4988 + | input.string,
|
4989 + | expected.string,
|
4990 + | "Unexpected value for `string`"
|
4991 + | );
|
4992 + | ::pretty_assertions::assert_eq!(
|
4993 + | input.struct_with_json_name,
|
4994 + | expected.struct_with_json_name,
|
4995 + | "Unexpected value for `struct_with_json_name`"
|
4996 + | );
|
4997 + | ::pretty_assertions::assert_eq!(
|
4998 + | input.timestamp,
|
4999 + | expected.timestamp,
|
5000 + | "Unexpected value for `timestamp`"
|
5001 + | );
|
5002 + | ::pretty_assertions::assert_eq!(
|
5003 + | input.unix_timestamp,
|
5004 + | expected.unix_timestamp,
|
5005 + | "Unexpected value for `unix_timestamp`"
|
5006 + | );
|
5007 + | let output = crate::output::KitchenSinkOperationOutput {
|
5008 + | blob: ::std::option::Option::None,
|
5009 + | boolean: ::std::option::Option::None,
|
5010 + | double: ::std::option::Option::None,
|
5011 + | empty_struct: ::std::option::Option::None,
|
5012 + | float: ::std::option::Option::None,
|
5013 + | httpdate_timestamp: ::std::option::Option::None,
|
5014 + | integer: ::std::option::Option::None,
|
5015 + | iso8601_timestamp: ::std::option::Option::None,
|
5016 + | json_value: ::std::option::Option::None,
|
5017 + | list_of_lists: ::std::option::Option::None,
|
5018 + | list_of_maps_of_strings: ::std::option::Option::None,
|
5019 + | list_of_strings: ::std::option::Option::None,
|
5020 + | list_of_structs: ::std::option::Option::None,
|
5021 + | long: ::std::option::Option::None,
|
5022 + | map_of_lists_of_strings: ::std::option::Option::None,
|
5023 + | map_of_maps: ::std::option::Option::None,
|
5024 + | map_of_strings: ::std::option::Option::None,
|
5025 + | map_of_structs: ::std::option::Option::None,
|
5026 + | recursive_list: ::std::option::Option::None,
|
5027 + | recursive_map: ::std::option::Option::None,
|
5028 + | recursive_struct: ::std::option::Option::None,
|
5029 + | simple_struct: ::std::option::Option::None,
|
5030 + | string: ::std::option::Option::None,
|
5031 + | struct_with_json_name: ::std::option::Option::None,
|
5032 + | timestamp: ::std::option::Option::None,
|
5033 + | unix_timestamp: ::std::option::Option::None,
|
5034 + | };
|
5035 + | Ok(output)
|
5036 + | };
|
5037 + | sender.send(()).await.expect("receiver dropped early");
|
5038 + | result
|
5039 + | }
|
5040 + | })
|
5041 + | .build_unchecked();
|
4792 5042 | let http_response = ::tower::ServiceExt::oneshot(service, http_request)
|
4793 5043 | .await
|
4794 5044 | .expect("unable to make an HTTP request");
|
4795 5045 | assert!(
|
4796 5046 | receiver.recv().await.is_some(),
|
4797 5047 | "we expected operation handler to be invoked but it was not entered"
|
4798 5048 | );
|
4799 5049 | }
|
4800 5050 |
|
4801 5051 | /// Serializes double shapes
|
4802 5052 | /// Test ID: serializes_double_shapes
|
4803 5053 | #[::tokio::test]
|
4804 5054 | #[::tracing_test::traced_test]
|
4805 5055 | async fn serializes_double_shapes_request() {
|
4806 5056 | #[allow(unused_mut)]
|
4807 - | let mut http_request = http::Request::builder()
|
5057 + | let mut http_request = ::http_1x::Request::builder()
|
4808 5058 | .uri("/")
|
4809 5059 | .method("POST")
|
4810 5060 | .header("Content-Type", "application/x-amz-json-1.1")
|
4811 5061 | .header("X-Amz-Target", "JsonProtocol.KitchenSinkOperation")
|
4812 - | .body(::aws_smithy_http_server::body::Body::from(
|
4813 - | ::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
|
4814 - | "{\"Double\":1234.5}".as_bytes(),
|
4815 - | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
5062 + | .body(::aws_smithy_http_server::body::boxed(
|
5063 + | ::http_body_util::Full::new(::bytes::Bytes::copy_from_slice(
|
5064 + | &::aws_smithy_protocol_test::decode_body_data(
|
5065 + | "{\"Double\":1234.5}".as_bytes(),
|
5066 + | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
5067 + | ),
|
4816 5068 | )),
|
4817 5069 | ))
|
4818 5070 | .unwrap();
|
4819 5071 | #[allow(unused_mut)]
|
4820 5072 | let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
|
4821 5073 | let config = crate::service::JsonProtocolConfig::builder().build();
|
4822 - | let service = crate::service::JsonProtocol::builder::<::hyper::body::Body, _, _, _>(config)
|
4823 - | .kitchen_sink_operation(move |input: crate::input::KitchenSinkOperationInput| {
|
4824 - | let sender = sender.clone();
|
4825 - | async move {
|
4826 - | let result = {
|
4827 - | use ::aws_smithy_protocol_test::FloatEquals;
|
4828 - | let expected = crate::input::KitchenSinkOperationInput {
|
4829 - | double: ::std::option::Option::Some(1234.5_f64),
|
4830 - | blob: ::std::option::Option::None,
|
4831 - | boolean: ::std::option::Option::None,
|
4832 - | empty_struct: ::std::option::Option::None,
|
4833 - | float: ::std::option::Option::None,
|
4834 - | httpdate_timestamp: ::std::option::Option::None,
|
4835 - | integer: ::std::option::Option::None,
|
4836 - | iso8601_timestamp: ::std::option::Option::None,
|
4837 - | json_value: ::std::option::Option::None,
|
4838 - | list_of_lists: ::std::option::Option::None,
|
4839 - | list_of_maps_of_strings: ::std::option::Option::None,
|
4840 - | list_of_strings: ::std::option::Option::None,
|
4841 - | list_of_structs: ::std::option::Option::None,
|
4842 - | long: ::std::option::Option::None,
|
4843 - | map_of_lists_of_strings: ::std::option::Option::None,
|
4844 - | map_of_maps: ::std::option::Option::None,
|
4845 - | map_of_strings: ::std::option::Option::None,
|
4846 - | map_of_structs: ::std::option::Option::None,
|
4847 - | recursive_list: ::std::option::Option::None,
|
4848 - | recursive_map: ::std::option::Option::None,
|
4849 - | recursive_struct: ::std::option::Option::None,
|
4850 - | simple_struct: ::std::option::Option::None,
|
4851 - | string: ::std::option::Option::None,
|
4852 - | struct_with_json_name: ::std::option::Option::None,
|
4853 - | timestamp: ::std::option::Option::None,
|
4854 - | unix_timestamp: ::std::option::Option::None,
|
4855 - | };
|
4856 - | ::pretty_assertions::assert_eq!(
|
4857 - | input.blob,
|
4858 - | expected.blob,
|
4859 - | "Unexpected value for `blob`"
|
4860 - | );
|
4861 - | ::pretty_assertions::assert_eq!(
|
4862 - | input.boolean,
|
4863 - | expected.boolean,
|
4864 - | "Unexpected value for `boolean`"
|
4865 - | );
|
4866 - | assert!(
|
4867 - | input.double.float_equals(&expected.double),
|
4868 - | "Unexpected value for `double` {:?} vs. {:?}",
|
4869 - | expected.double,
|
4870 - | input.double
|
4871 - | );
|
4872 - | ::pretty_assertions::assert_eq!(
|
4873 - | input.empty_struct,
|
4874 - | expected.empty_struct,
|
4875 - | "Unexpected value for `empty_struct`"
|
4876 - | );
|
4877 - | assert!(
|
4878 - | input.float.float_equals(&expected.float),
|
4879 - | "Unexpected value for `float` {:?} vs. {:?}",
|
4880 - | expected.float,
|
4881 - | input.float
|
4882 - | );
|
4883 - | ::pretty_assertions::assert_eq!(
|
4884 - | input.httpdate_timestamp,
|
4885 - | expected.httpdate_timestamp,
|
4886 - | "Unexpected value for `httpdate_timestamp`"
|
4887 - | );
|
4888 - | ::pretty_assertions::assert_eq!(
|
4889 - | input.integer,
|
4890 - | expected.integer,
|
4891 - | "Unexpected value for `integer`"
|
4892 - | );
|
4893 - | ::pretty_assertions::assert_eq!(
|
4894 - | input.iso8601_timestamp,
|
4895 - | expected.iso8601_timestamp,
|
4896 - | "Unexpected value for `iso8601_timestamp`"
|
4897 - | );
|
4898 - | ::pretty_assertions::assert_eq!(
|
4899 - | input.json_value,
|
4900 - | expected.json_value,
|
4901 - | "Unexpected value for `json_value`"
|
4902 - | );
|
4903 - | ::pretty_assertions::assert_eq!(
|
4904 - | input.list_of_lists,
|
4905 - | expected.list_of_lists,
|
4906 - | "Unexpected value for `list_of_lists`"
|
4907 - | );
|
4908 - | ::pretty_assertions::assert_eq!(
|
4909 - | input.list_of_maps_of_strings,
|
4910 - | expected.list_of_maps_of_strings,
|
4911 - | "Unexpected value for `list_of_maps_of_strings`"
|
4912 - | );
|
4913 - | ::pretty_assertions::assert_eq!(
|
4914 - | input.list_of_strings,
|
4915 - | expected.list_of_strings,
|
4916 - | "Unexpected value for `list_of_strings`"
|
4917 - | );
|
4918 - | ::pretty_assertions::assert_eq!(
|
4919 - | input.list_of_structs,
|
4920 - | expected.list_of_structs,
|
4921 - | "Unexpected value for `list_of_structs`"
|
4922 - | );
|
4923 - | ::pretty_assertions::assert_eq!(
|
4924 - | input.long,
|
4925 - | expected.long,
|
4926 - | "Unexpected value for `long`"
|
4927 - | );
|
4928 - | ::pretty_assertions::assert_eq!(
|
4929 - | input.map_of_lists_of_strings,
|
4930 - | expected.map_of_lists_of_strings,
|
4931 - | "Unexpected value for `map_of_lists_of_strings`"
|
4932 - | );
|
4933 - | ::pretty_assertions::assert_eq!(
|
4934 - | input.map_of_maps,
|
4935 - | expected.map_of_maps,
|
4936 - | "Unexpected value for `map_of_maps`"
|
4937 - | );
|
4938 - | ::pretty_assertions::assert_eq!(
|
4939 - | input.map_of_strings,
|
4940 - | expected.map_of_strings,
|
4941 - | "Unexpected value for `map_of_strings`"
|
4942 - | );
|
4943 - | ::pretty_assertions::assert_eq!(
|
4944 - | input.map_of_structs,
|
4945 - | expected.map_of_structs,
|
4946 - | "Unexpected value for `map_of_structs`"
|
4947 - | );
|
4948 - | ::pretty_assertions::assert_eq!(
|
4949 - | input.recursive_list,
|
4950 - | expected.recursive_list,
|
4951 - | "Unexpected value for `recursive_list`"
|
4952 - | );
|
4953 - | ::pretty_assertions::assert_eq!(
|
4954 - | input.recursive_map,
|
4955 - | expected.recursive_map,
|
4956 - | "Unexpected value for `recursive_map`"
|
4957 - | );
|
4958 - | ::pretty_assertions::assert_eq!(
|
4959 - | input.recursive_struct,
|
4960 - | expected.recursive_struct,
|
4961 - | "Unexpected value for `recursive_struct`"
|
4962 - | );
|
4963 - | ::pretty_assertions::assert_eq!(
|
4964 - | input.simple_struct,
|
4965 - | expected.simple_struct,
|
4966 - | "Unexpected value for `simple_struct`"
|
4967 - | );
|
4968 - | ::pretty_assertions::assert_eq!(
|
4969 - | input.string,
|
4970 - | expected.string,
|
4971 - | "Unexpected value for `string`"
|
4972 - | );
|
4973 - | ::pretty_assertions::assert_eq!(
|
4974 - | input.struct_with_json_name,
|
4975 - | expected.struct_with_json_name,
|
4976 - | "Unexpected value for `struct_with_json_name`"
|
4977 - | );
|
4978 - | ::pretty_assertions::assert_eq!(
|
4979 - | input.timestamp,
|
4980 - | expected.timestamp,
|
4981 - | "Unexpected value for `timestamp`"
|
4982 - | );
|
4983 - | ::pretty_assertions::assert_eq!(
|
4984 - | input.unix_timestamp,
|
4985 - | expected.unix_timestamp,
|
4986 - | "Unexpected value for `unix_timestamp`"
|
4987 - | );
|
4988 - | let output = crate::output::KitchenSinkOperationOutput {
|
4989 - | blob: ::std::option::Option::None,
|
4990 - | boolean: ::std::option::Option::None,
|
4991 - | double: ::std::option::Option::None,
|
4992 - | empty_struct: ::std::option::Option::None,
|
4993 - | float: ::std::option::Option::None,
|
4994 - | httpdate_timestamp: ::std::option::Option::None,
|
4995 - | integer: ::std::option::Option::None,
|
4996 - | iso8601_timestamp: ::std::option::Option::None,
|
4997 - | json_value: ::std::option::Option::None,
|
4998 - | list_of_lists: ::std::option::Option::None,
|
4999 - | list_of_maps_of_strings: ::std::option::Option::None,
|
5000 - | list_of_strings: ::std::option::Option::None,
|
5001 - | list_of_structs: ::std::option::Option::None,
|
5002 - | long: ::std::option::Option::None,
|
5003 - | map_of_lists_of_strings: ::std::option::Option::None,
|
5004 - | map_of_maps: ::std::option::Option::None,
|
5005 - | map_of_strings: ::std::option::Option::None,
|
5006 - | map_of_structs: ::std::option::Option::None,
|
5007 - | recursive_list: ::std::option::Option::None,
|
5008 - | recursive_map: ::std::option::Option::None,
|
5009 - | recursive_struct: ::std::option::Option::None,
|
5010 - | simple_struct: ::std::option::Option::None,
|
5011 - | string: ::std::option::Option::None,
|
5012 - | struct_with_json_name: ::std::option::Option::None,
|
5013 - | timestamp: ::std::option::Option::None,
|
5014 - | unix_timestamp: ::std::option::Option::None,
|
5015 - | };
|
5016 - | Ok(output)
|
5074 + | let service = crate::service::JsonProtocol::builder::<
|
5075 + | ::aws_smithy_http_server::body::BoxBody,
|
5076 + | _,
|
5077 + | _,
|
5078 + | _,
|
5079 + | >(config)
|
5080 + | .kitchen_sink_operation(move |input: crate::input::KitchenSinkOperationInput| {
|
5081 + | let sender = sender.clone();
|
5082 + | async move {
|
5083 + | let result = {
|
5084 + | use ::aws_smithy_protocol_test::FloatEquals;
|
5085 + | let expected = crate::input::KitchenSinkOperationInput {
|
5086 + | double: ::std::option::Option::Some(1234.5_f64),
|
5087 + | blob: ::std::option::Option::None,
|
5088 + | boolean: ::std::option::Option::None,
|
5089 + | empty_struct: ::std::option::Option::None,
|
5090 + | float: ::std::option::Option::None,
|
5091 + | httpdate_timestamp: ::std::option::Option::None,
|
5092 + | integer: ::std::option::Option::None,
|
5093 + | iso8601_timestamp: ::std::option::Option::None,
|
5094 + | json_value: ::std::option::Option::None,
|
5095 + | list_of_lists: ::std::option::Option::None,
|
5096 + | list_of_maps_of_strings: ::std::option::Option::None,
|
5097 + | list_of_strings: ::std::option::Option::None,
|
5098 + | list_of_structs: ::std::option::Option::None,
|
5099 + | long: ::std::option::Option::None,
|
5100 + | map_of_lists_of_strings: ::std::option::Option::None,
|
5101 + | map_of_maps: ::std::option::Option::None,
|
5102 + | map_of_strings: ::std::option::Option::None,
|
5103 + | map_of_structs: ::std::option::Option::None,
|
5104 + | recursive_list: ::std::option::Option::None,
|
5105 + | recursive_map: ::std::option::Option::None,
|
5106 + | recursive_struct: ::std::option::Option::None,
|
5107 + | simple_struct: ::std::option::Option::None,
|
5108 + | string: ::std::option::Option::None,
|
5109 + | struct_with_json_name: ::std::option::Option::None,
|
5110 + | timestamp: ::std::option::Option::None,
|
5111 + | unix_timestamp: ::std::option::Option::None,
|
5017 5112 | };
|
5018 - | sender.send(()).await.expect("receiver dropped early");
|
5019 - | result
|
5020 - | }
|
5021 - | })
|
5022 - | .build_unchecked();
|
5113 + | ::pretty_assertions::assert_eq!(
|
5114 + | input.blob,
|
5115 + | expected.blob,
|
5116 + | "Unexpected value for `blob`"
|
5117 + | );
|
5118 + | ::pretty_assertions::assert_eq!(
|
5119 + | input.boolean,
|
5120 + | expected.boolean,
|
5121 + | "Unexpected value for `boolean`"
|
5122 + | );
|
5123 + | assert!(
|
5124 + | input.double.float_equals(&expected.double),
|
5125 + | "Unexpected value for `double` {:?} vs. {:?}",
|
5126 + | expected.double,
|
5127 + | input.double
|
5128 + | );
|
5129 + | ::pretty_assertions::assert_eq!(
|
5130 + | input.empty_struct,
|
5131 + | expected.empty_struct,
|
5132 + | "Unexpected value for `empty_struct`"
|
5133 + | );
|
5134 + | assert!(
|
5135 + | input.float.float_equals(&expected.float),
|
5136 + | "Unexpected value for `float` {:?} vs. {:?}",
|
5137 + | expected.float,
|
5138 + | input.float
|
5139 + | );
|
5140 + | ::pretty_assertions::assert_eq!(
|
5141 + | input.httpdate_timestamp,
|
5142 + | expected.httpdate_timestamp,
|
5143 + | "Unexpected value for `httpdate_timestamp`"
|
5144 + | );
|
5145 + | ::pretty_assertions::assert_eq!(
|
5146 + | input.integer,
|
5147 + | expected.integer,
|
5148 + | "Unexpected value for `integer`"
|
5149 + | );
|
5150 + | ::pretty_assertions::assert_eq!(
|
5151 + | input.iso8601_timestamp,
|
5152 + | expected.iso8601_timestamp,
|
5153 + | "Unexpected value for `iso8601_timestamp`"
|
5154 + | );
|
5155 + | ::pretty_assertions::assert_eq!(
|
5156 + | input.json_value,
|
5157 + | expected.json_value,
|
5158 + | "Unexpected value for `json_value`"
|
5159 + | );
|
5160 + | ::pretty_assertions::assert_eq!(
|
5161 + | input.list_of_lists,
|
5162 + | expected.list_of_lists,
|
5163 + | "Unexpected value for `list_of_lists`"
|
5164 + | );
|
5165 + | ::pretty_assertions::assert_eq!(
|
5166 + | input.list_of_maps_of_strings,
|
5167 + | expected.list_of_maps_of_strings,
|
5168 + | "Unexpected value for `list_of_maps_of_strings`"
|
5169 + | );
|
5170 + | ::pretty_assertions::assert_eq!(
|
5171 + | input.list_of_strings,
|
5172 + | expected.list_of_strings,
|
5173 + | "Unexpected value for `list_of_strings`"
|
5174 + | );
|
5175 + | ::pretty_assertions::assert_eq!(
|
5176 + | input.list_of_structs,
|
5177 + | expected.list_of_structs,
|
5178 + | "Unexpected value for `list_of_structs`"
|
5179 + | );
|
5180 + | ::pretty_assertions::assert_eq!(
|
5181 + | input.long,
|
5182 + | expected.long,
|
5183 + | "Unexpected value for `long`"
|
5184 + | );
|
5185 + | ::pretty_assertions::assert_eq!(
|
5186 + | input.map_of_lists_of_strings,
|
5187 + | expected.map_of_lists_of_strings,
|
5188 + | "Unexpected value for `map_of_lists_of_strings`"
|
5189 + | );
|
5190 + | ::pretty_assertions::assert_eq!(
|
5191 + | input.map_of_maps,
|
5192 + | expected.map_of_maps,
|
5193 + | "Unexpected value for `map_of_maps`"
|
5194 + | );
|
5195 + | ::pretty_assertions::assert_eq!(
|
5196 + | input.map_of_strings,
|
5197 + | expected.map_of_strings,
|
5198 + | "Unexpected value for `map_of_strings`"
|
5199 + | );
|
5200 + | ::pretty_assertions::assert_eq!(
|
5201 + | input.map_of_structs,
|
5202 + | expected.map_of_structs,
|
5203 + | "Unexpected value for `map_of_structs`"
|
5204 + | );
|
5205 + | ::pretty_assertions::assert_eq!(
|
5206 + | input.recursive_list,
|
5207 + | expected.recursive_list,
|
5208 + | "Unexpected value for `recursive_list`"
|
5209 + | );
|
5210 + | ::pretty_assertions::assert_eq!(
|
5211 + | input.recursive_map,
|
5212 + | expected.recursive_map,
|
5213 + | "Unexpected value for `recursive_map`"
|
5214 + | );
|
5215 + | ::pretty_assertions::assert_eq!(
|
5216 + | input.recursive_struct,
|
5217 + | expected.recursive_struct,
|
5218 + | "Unexpected value for `recursive_struct`"
|
5219 + | );
|
5220 + | ::pretty_assertions::assert_eq!(
|
5221 + | input.simple_struct,
|
5222 + | expected.simple_struct,
|
5223 + | "Unexpected value for `simple_struct`"
|
5224 + | );
|
5225 + | ::pretty_assertions::assert_eq!(
|
5226 + | input.string,
|
5227 + | expected.string,
|
5228 + | "Unexpected value for `string`"
|
5229 + | );
|
5230 + | ::pretty_assertions::assert_eq!(
|
5231 + | input.struct_with_json_name,
|
5232 + | expected.struct_with_json_name,
|
5233 + | "Unexpected value for `struct_with_json_name`"
|
5234 + | );
|
5235 + | ::pretty_assertions::assert_eq!(
|
5236 + | input.timestamp,
|
5237 + | expected.timestamp,
|
5238 + | "Unexpected value for `timestamp`"
|
5239 + | );
|
5240 + | ::pretty_assertions::assert_eq!(
|
5241 + | input.unix_timestamp,
|
5242 + | expected.unix_timestamp,
|
5243 + | "Unexpected value for `unix_timestamp`"
|
5244 + | );
|
5245 + | let output = crate::output::KitchenSinkOperationOutput {
|
5246 + | blob: ::std::option::Option::None,
|
5247 + | boolean: ::std::option::Option::None,
|
5248 + | double: ::std::option::Option::None,
|
5249 + | empty_struct: ::std::option::Option::None,
|
5250 + | float: ::std::option::Option::None,
|
5251 + | httpdate_timestamp: ::std::option::Option::None,
|
5252 + | integer: ::std::option::Option::None,
|
5253 + | iso8601_timestamp: ::std::option::Option::None,
|
5254 + | json_value: ::std::option::Option::None,
|
5255 + | list_of_lists: ::std::option::Option::None,
|
5256 + | list_of_maps_of_strings: ::std::option::Option::None,
|
5257 + | list_of_strings: ::std::option::Option::None,
|
5258 + | list_of_structs: ::std::option::Option::None,
|
5259 + | long: ::std::option::Option::None,
|
5260 + | map_of_lists_of_strings: ::std::option::Option::None,
|
5261 + | map_of_maps: ::std::option::Option::None,
|
5262 + | map_of_strings: ::std::option::Option::None,
|
5263 + | map_of_structs: ::std::option::Option::None,
|
5264 + | recursive_list: ::std::option::Option::None,
|
5265 + | recursive_map: ::std::option::Option::None,
|
5266 + | recursive_struct: ::std::option::Option::None,
|
5267 + | simple_struct: ::std::option::Option::None,
|
5268 + | string: ::std::option::Option::None,
|
5269 + | struct_with_json_name: ::std::option::Option::None,
|
5270 + | timestamp: ::std::option::Option::None,
|
5271 + | unix_timestamp: ::std::option::Option::None,
|
5272 + | };
|
5273 + | Ok(output)
|
5274 + | };
|
5275 + | sender.send(()).await.expect("receiver dropped early");
|
5276 + | result
|
5277 + | }
|
5278 + | })
|
5279 + | .build_unchecked();
|
5023 5280 | let http_response = ::tower::ServiceExt::oneshot(service, http_request)
|
5024 5281 | .await
|
5025 5282 | .expect("unable to make an HTTP request");
|
5026 5283 | assert!(
|
5027 5284 | receiver.recv().await.is_some(),
|
5028 5285 | "we expected operation handler to be invoked but it was not entered"
|
5029 5286 | );
|
5030 5287 | }
|
5031 5288 |
|
5032 5289 | /// Serializes blob shapes
|
5033 5290 | /// Test ID: serializes_blob_shapes
|
5034 5291 | #[::tokio::test]
|
5035 5292 | #[::tracing_test::traced_test]
|
5036 5293 | async fn serializes_blob_shapes_request() {
|
5037 5294 | #[allow(unused_mut)]
|
5038 - | let mut http_request = http::Request::builder()
|
5295 + | let mut http_request = ::http_1x::Request::builder()
|
5039 5296 | .uri("/")
|
5040 5297 | .method("POST")
|
5041 5298 | .header("Content-Type", "application/x-amz-json-1.1")
|
5042 5299 | .header("X-Amz-Target", "JsonProtocol.KitchenSinkOperation")
|
5043 - | .body(::aws_smithy_http_server::body::Body::from(
|
5044 - | ::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
|
5045 - | "{\"Blob\":\"YmluYXJ5LXZhbHVl\"}".as_bytes(),
|
5046 - | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
5300 + | .body(::aws_smithy_http_server::body::boxed(
|
5301 + | ::http_body_util::Full::new(::bytes::Bytes::copy_from_slice(
|
5302 + | &::aws_smithy_protocol_test::decode_body_data(
|
5303 + | "{\"Blob\":\"YmluYXJ5LXZhbHVl\"}".as_bytes(),
|
5304 + | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
5305 + | ),
|
5047 5306 | )),
|
5048 5307 | ))
|
5049 5308 | .unwrap();
|
5050 5309 | #[allow(unused_mut)]
|
5051 5310 | let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
|
5052 5311 | let config = crate::service::JsonProtocolConfig::builder().build();
|
5053 - | let service = crate::service::JsonProtocol::builder::<::hyper::body::Body, _, _, _>(config)
|
5054 - | .kitchen_sink_operation(move |input: crate::input::KitchenSinkOperationInput| {
|
5055 - | let sender = sender.clone();
|
5056 - | async move {
|
5057 - | let result = {
|
5058 - | use ::aws_smithy_protocol_test::FloatEquals;
|
5059 - | let expected = crate::input::KitchenSinkOperationInput {
|
5060 - | blob: ::std::option::Option::Some(::aws_smithy_types::Blob::new(
|
5061 - | "binary-value",
|
5062 - | )),
|
5063 - | boolean: ::std::option::Option::None,
|
5064 - | double: ::std::option::Option::None,
|
5065 - | empty_struct: ::std::option::Option::None,
|
5066 - | float: ::std::option::Option::None,
|
5067 - | httpdate_timestamp: ::std::option::Option::None,
|
5068 - | integer: ::std::option::Option::None,
|
5069 - | iso8601_timestamp: ::std::option::Option::None,
|
5070 - | json_value: ::std::option::Option::None,
|
5071 - | list_of_lists: ::std::option::Option::None,
|
5072 - | list_of_maps_of_strings: ::std::option::Option::None,
|
5073 - | list_of_strings: ::std::option::Option::None,
|
5074 - | list_of_structs: ::std::option::Option::None,
|
5075 - | long: ::std::option::Option::None,
|
5076 - | map_of_lists_of_strings: ::std::option::Option::None,
|
5077 - | map_of_maps: ::std::option::Option::None,
|
5078 - | map_of_strings: ::std::option::Option::None,
|
5079 - | map_of_structs: ::std::option::Option::None,
|
5080 - | recursive_list: ::std::option::Option::None,
|
5081 - | recursive_map: ::std::option::Option::None,
|
5082 - | recursive_struct: ::std::option::Option::None,
|
5083 - | simple_struct: ::std::option::Option::None,
|
5084 - | string: ::std::option::Option::None,
|
5085 - | struct_with_json_name: ::std::option::Option::None,
|
5086 - | timestamp: ::std::option::Option::None,
|
5087 - | unix_timestamp: ::std::option::Option::None,
|
5088 - | };
|
5089 - | ::pretty_assertions::assert_eq!(
|
5090 - | input.blob,
|
5091 - | expected.blob,
|
5092 - | "Unexpected value for `blob`"
|
5093 - | );
|
5094 - | ::pretty_assertions::assert_eq!(
|
5095 - | input.boolean,
|
5096 - | expected.boolean,
|
5097 - | "Unexpected value for `boolean`"
|
5098 - | );
|
5099 - | assert!(
|
5100 - | input.double.float_equals(&expected.double),
|
5101 - | "Unexpected value for `double` {:?} vs. {:?}",
|
5102 - | expected.double,
|
5103 - | input.double
|
5104 - | );
|
5105 - | ::pretty_assertions::assert_eq!(
|
5106 - | input.empty_struct,
|
5107 - | expected.empty_struct,
|
5108 - | "Unexpected value for `empty_struct`"
|
5109 - | );
|
5110 - | assert!(
|
5111 - | input.float.float_equals(&expected.float),
|
5112 - | "Unexpected value for `float` {:?} vs. {:?}",
|
5113 - | expected.float,
|
5114 - | input.float
|
5115 - | );
|
5116 - | ::pretty_assertions::assert_eq!(
|
5117 - | input.httpdate_timestamp,
|
5118 - | expected.httpdate_timestamp,
|
5119 - | "Unexpected value for `httpdate_timestamp`"
|
5120 - | );
|
5121 - | ::pretty_assertions::assert_eq!(
|
5122 - | input.integer,
|
5123 - | expected.integer,
|
5124 - | "Unexpected value for `integer`"
|
5125 - | );
|
5126 - | ::pretty_assertions::assert_eq!(
|
5127 - | input.iso8601_timestamp,
|
5128 - | expected.iso8601_timestamp,
|
5129 - | "Unexpected value for `iso8601_timestamp`"
|
5130 - | );
|
5131 - | ::pretty_assertions::assert_eq!(
|
5132 - | input.json_value,
|
5133 - | expected.json_value,
|
5134 - | "Unexpected value for `json_value`"
|
5135 - | );
|
5136 - | ::pretty_assertions::assert_eq!(
|
5137 - | input.list_of_lists,
|
5138 - | expected.list_of_lists,
|
5139 - | "Unexpected value for `list_of_lists`"
|
5140 - | );
|
5141 - | ::pretty_assertions::assert_eq!(
|
5142 - | input.list_of_maps_of_strings,
|
5143 - | expected.list_of_maps_of_strings,
|
5144 - | "Unexpected value for `list_of_maps_of_strings`"
|
5145 - | );
|
5146 - | ::pretty_assertions::assert_eq!(
|
5147 - | input.list_of_strings,
|
5148 - | expected.list_of_strings,
|
5149 - | "Unexpected value for `list_of_strings`"
|
5150 - | );
|
5151 - | ::pretty_assertions::assert_eq!(
|
5152 - | input.list_of_structs,
|
5153 - | expected.list_of_structs,
|
5154 - | "Unexpected value for `list_of_structs`"
|
5155 - | );
|
5156 - | ::pretty_assertions::assert_eq!(
|
5157 - | input.long,
|
5158 - | expected.long,
|
5159 - | "Unexpected value for `long`"
|
5160 - | );
|
5161 - | ::pretty_assertions::assert_eq!(
|
5162 - | input.map_of_lists_of_strings,
|
5163 - | expected.map_of_lists_of_strings,
|
5164 - | "Unexpected value for `map_of_lists_of_strings`"
|
5165 - | );
|
5166 - | ::pretty_assertions::assert_eq!(
|
5167 - | input.map_of_maps,
|
5168 - | expected.map_of_maps,
|
5169 - | "Unexpected value for `map_of_maps`"
|
5170 - | );
|
5171 - | ::pretty_assertions::assert_eq!(
|
5172 - | input.map_of_strings,
|
5173 - | expected.map_of_strings,
|
5174 - | "Unexpected value for `map_of_strings`"
|
5175 - | );
|
5176 - | ::pretty_assertions::assert_eq!(
|
5177 - | input.map_of_structs,
|
5178 - | expected.map_of_structs,
|
5179 - | "Unexpected value for `map_of_structs`"
|
5180 - | );
|
5181 - | ::pretty_assertions::assert_eq!(
|
5182 - | input.recursive_list,
|
5183 - | expected.recursive_list,
|
5184 - | "Unexpected value for `recursive_list`"
|
5185 - | );
|
5186 - | ::pretty_assertions::assert_eq!(
|
5187 - | input.recursive_map,
|
5188 - | expected.recursive_map,
|
5189 - | "Unexpected value for `recursive_map`"
|
5190 - | );
|
5191 - | ::pretty_assertions::assert_eq!(
|
5192 - | input.recursive_struct,
|
5193 - | expected.recursive_struct,
|
5194 - | "Unexpected value for `recursive_struct`"
|
5195 - | );
|
5196 - | ::pretty_assertions::assert_eq!(
|
5197 - | input.simple_struct,
|
5198 - | expected.simple_struct,
|
5199 - | "Unexpected value for `simple_struct`"
|
5200 - | );
|
5201 - | ::pretty_assertions::assert_eq!(
|
5202 - | input.string,
|
5203 - | expected.string,
|
5204 - | "Unexpected value for `string`"
|
5205 - | );
|
5206 - | ::pretty_assertions::assert_eq!(
|
5207 - | input.struct_with_json_name,
|
5208 - | expected.struct_with_json_name,
|
5209 - | "Unexpected value for `struct_with_json_name`"
|
5210 - | );
|
5211 - | ::pretty_assertions::assert_eq!(
|
5212 - | input.timestamp,
|
5213 - | expected.timestamp,
|
5214 - | "Unexpected value for `timestamp`"
|
5215 - | );
|
5216 - | ::pretty_assertions::assert_eq!(
|
5217 - | input.unix_timestamp,
|
5218 - | expected.unix_timestamp,
|
5219 - | "Unexpected value for `unix_timestamp`"
|
5220 - | );
|
5221 - | let output = crate::output::KitchenSinkOperationOutput {
|
5222 - | blob: ::std::option::Option::None,
|
5223 - | boolean: ::std::option::Option::None,
|
5224 - | double: ::std::option::Option::None,
|
5225 - | empty_struct: ::std::option::Option::None,
|
5226 - | float: ::std::option::Option::None,
|
5227 - | httpdate_timestamp: ::std::option::Option::None,
|
5228 - | integer: ::std::option::Option::None,
|
5229 - | iso8601_timestamp: ::std::option::Option::None,
|
5230 - | json_value: ::std::option::Option::None,
|
5231 - | list_of_lists: ::std::option::Option::None,
|
5232 - | list_of_maps_of_strings: ::std::option::Option::None,
|
5233 - | list_of_strings: ::std::option::Option::None,
|
5234 - | list_of_structs: ::std::option::Option::None,
|
5235 - | long: ::std::option::Option::None,
|
5236 - | map_of_lists_of_strings: ::std::option::Option::None,
|
5237 - | map_of_maps: ::std::option::Option::None,
|
5238 - | map_of_strings: ::std::option::Option::None,
|
5239 - | map_of_structs: ::std::option::Option::None,
|
5240 - | recursive_list: ::std::option::Option::None,
|
5241 - | recursive_map: ::std::option::Option::None,
|
5242 - | recursive_struct: ::std::option::Option::None,
|
5243 - | simple_struct: ::std::option::Option::None,
|
5244 - | string: ::std::option::Option::None,
|
5245 - | struct_with_json_name: ::std::option::Option::None,
|
5246 - | timestamp: ::std::option::Option::None,
|
5247 - | unix_timestamp: ::std::option::Option::None,
|
5248 - | };
|
5249 - | Ok(output)
|
5250 - | };
|
5251 - | sender.send(()).await.expect("receiver dropped early");
|
5252 - | result
|
5253 - | }
|
5254 - | })
|
5255 - | .build_unchecked();
|
5256 - | let http_response = ::tower::ServiceExt::oneshot(service, http_request)
|
5257 - | .await
|
5258 - | .expect("unable to make an HTTP request");
|
5259 - | assert!(
|
5260 - | receiver.recv().await.is_some(),
|
5261 - | "we expected operation handler to be invoked but it was not entered"
|
5262 - | );
|
5263 - | }
|
5264 - |
|
5265 - | /// Serializes boolean shapes (true)
|
5266 - | /// Test ID: serializes_boolean_shapes_true
|
5267 - | #[::tokio::test]
|
5268 - | #[::tracing_test::traced_test]
|
5269 - | async fn serializes_boolean_shapes_true_request() {
|
5270 - | #[allow(unused_mut)]
|
5271 - | let mut http_request = http::Request::builder()
|
5272 - | .uri("/")
|
5273 - | .method("POST")
|
5274 - | .header("Content-Type", "application/x-amz-json-1.1")
|
5275 - | .header("X-Amz-Target", "JsonProtocol.KitchenSinkOperation")
|
5276 - | .body(::aws_smithy_http_server::body::Body::from(
|
5277 - | ::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
|
5278 - | "{\"Boolean\":true}".as_bytes(),
|
5279 - | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
5280 - | )),
|
5281 - | ))
|
5282 - | .unwrap();
|
5283 - | #[allow(unused_mut)]
|
5284 - | let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
|
5285 - | let config = crate::service::JsonProtocolConfig::builder().build();
|
5286 - | let service = crate::service::JsonProtocol::builder::<::hyper::body::Body, _, _, _>(config)
|
5287 - | .kitchen_sink_operation(move |input: crate::input::KitchenSinkOperationInput| {
|
5288 - | let sender = sender.clone();
|
5289 - | async move {
|
5290 - | let result = {
|
5291 - | use ::aws_smithy_protocol_test::FloatEquals;
|
5292 - | let expected = crate::input::KitchenSinkOperationInput {
|
5293 - | boolean: ::std::option::Option::Some(true),
|
5294 - | blob: ::std::option::Option::None,
|
5295 - | double: ::std::option::Option::None,
|
5296 - | empty_struct: ::std::option::Option::None,
|
5297 - | float: ::std::option::Option::None,
|
5298 - | httpdate_timestamp: ::std::option::Option::None,
|
5299 - | integer: ::std::option::Option::None,
|
5300 - | iso8601_timestamp: ::std::option::Option::None,
|
5301 - | json_value: ::std::option::Option::None,
|
5302 - | list_of_lists: ::std::option::Option::None,
|
5303 - | list_of_maps_of_strings: ::std::option::Option::None,
|
5304 - | list_of_strings: ::std::option::Option::None,
|
5305 - | list_of_structs: ::std::option::Option::None,
|
5306 - | long: ::std::option::Option::None,
|
5307 - | map_of_lists_of_strings: ::std::option::Option::None,
|
5308 - | map_of_maps: ::std::option::Option::None,
|
5309 - | map_of_strings: ::std::option::Option::None,
|
5310 - | map_of_structs: ::std::option::Option::None,
|
5311 - | recursive_list: ::std::option::Option::None,
|
5312 - | recursive_map: ::std::option::Option::None,
|
5313 - | recursive_struct: ::std::option::Option::None,
|
5314 - | simple_struct: ::std::option::Option::None,
|
5315 - | string: ::std::option::Option::None,
|
5316 - | struct_with_json_name: ::std::option::Option::None,
|
5317 - | timestamp: ::std::option::Option::None,
|
5318 - | unix_timestamp: ::std::option::Option::None,
|
5319 - | };
|
5320 - | ::pretty_assertions::assert_eq!(
|
5321 - | input.blob,
|
5322 - | expected.blob,
|
5323 - | "Unexpected value for `blob`"
|
5324 - | );
|
5325 - | ::pretty_assertions::assert_eq!(
|
5326 - | input.boolean,
|
5327 - | expected.boolean,
|
5328 - | "Unexpected value for `boolean`"
|
5329 - | );
|
5330 - | assert!(
|
5331 - | input.double.float_equals(&expected.double),
|
5332 - | "Unexpected value for `double` {:?} vs. {:?}",
|
5333 - | expected.double,
|
5334 - | input.double
|
5335 - | );
|
5336 - | ::pretty_assertions::assert_eq!(
|
5337 - | input.empty_struct,
|
5338 - | expected.empty_struct,
|
5339 - | "Unexpected value for `empty_struct`"
|
5340 - | );
|
5341 - | assert!(
|
5342 - | input.float.float_equals(&expected.float),
|
5343 - | "Unexpected value for `float` {:?} vs. {:?}",
|
5344 - | expected.float,
|
5345 - | input.float
|
5346 - | );
|
5347 - | ::pretty_assertions::assert_eq!(
|
5348 - | input.httpdate_timestamp,
|
5349 - | expected.httpdate_timestamp,
|
5350 - | "Unexpected value for `httpdate_timestamp`"
|
5351 - | );
|
5352 - | ::pretty_assertions::assert_eq!(
|
5353 - | input.integer,
|
5354 - | expected.integer,
|
5355 - | "Unexpected value for `integer`"
|
5356 - | );
|
5357 - | ::pretty_assertions::assert_eq!(
|
5358 - | input.iso8601_timestamp,
|
5359 - | expected.iso8601_timestamp,
|
5360 - | "Unexpected value for `iso8601_timestamp`"
|
5361 - | );
|
5362 - | ::pretty_assertions::assert_eq!(
|
5363 - | input.json_value,
|
5364 - | expected.json_value,
|
5365 - | "Unexpected value for `json_value`"
|
5366 - | );
|
5367 - | ::pretty_assertions::assert_eq!(
|
5368 - | input.list_of_lists,
|
5369 - | expected.list_of_lists,
|
5370 - | "Unexpected value for `list_of_lists`"
|
5371 - | );
|
5372 - | ::pretty_assertions::assert_eq!(
|
5373 - | input.list_of_maps_of_strings,
|
5374 - | expected.list_of_maps_of_strings,
|
5375 - | "Unexpected value for `list_of_maps_of_strings`"
|
5376 - | );
|
5377 - | ::pretty_assertions::assert_eq!(
|
5378 - | input.list_of_strings,
|
5379 - | expected.list_of_strings,
|
5380 - | "Unexpected value for `list_of_strings`"
|
5381 - | );
|
5382 - | ::pretty_assertions::assert_eq!(
|
5383 - | input.list_of_structs,
|
5384 - | expected.list_of_structs,
|
5385 - | "Unexpected value for `list_of_structs`"
|
5386 - | );
|
5387 - | ::pretty_assertions::assert_eq!(
|
5388 - | input.long,
|
5389 - | expected.long,
|
5390 - | "Unexpected value for `long`"
|
5391 - | );
|
5392 - | ::pretty_assertions::assert_eq!(
|
5393 - | input.map_of_lists_of_strings,
|
5394 - | expected.map_of_lists_of_strings,
|
5395 - | "Unexpected value for `map_of_lists_of_strings`"
|
5396 - | );
|
5397 - | ::pretty_assertions::assert_eq!(
|
5398 - | input.map_of_maps,
|
5399 - | expected.map_of_maps,
|
5400 - | "Unexpected value for `map_of_maps`"
|
5401 - | );
|
5402 - | ::pretty_assertions::assert_eq!(
|
5403 - | input.map_of_strings,
|
5404 - | expected.map_of_strings,
|
5405 - | "Unexpected value for `map_of_strings`"
|
5406 - | );
|
5407 - | ::pretty_assertions::assert_eq!(
|
5408 - | input.map_of_structs,
|
5409 - | expected.map_of_structs,
|
5410 - | "Unexpected value for `map_of_structs`"
|
5411 - | );
|
5412 - | ::pretty_assertions::assert_eq!(
|
5413 - | input.recursive_list,
|
5414 - | expected.recursive_list,
|
5415 - | "Unexpected value for `recursive_list`"
|
5416 - | );
|
5417 - | ::pretty_assertions::assert_eq!(
|
5418 - | input.recursive_map,
|
5419 - | expected.recursive_map,
|
5420 - | "Unexpected value for `recursive_map`"
|
5421 - | );
|
5422 - | ::pretty_assertions::assert_eq!(
|
5423 - | input.recursive_struct,
|
5424 - | expected.recursive_struct,
|
5425 - | "Unexpected value for `recursive_struct`"
|
5426 - | );
|
5427 - | ::pretty_assertions::assert_eq!(
|
5428 - | input.simple_struct,
|
5429 - | expected.simple_struct,
|
5430 - | "Unexpected value for `simple_struct`"
|
5431 - | );
|
5432 - | ::pretty_assertions::assert_eq!(
|
5433 - | input.string,
|
5434 - | expected.string,
|
5435 - | "Unexpected value for `string`"
|
5436 - | );
|
5437 - | ::pretty_assertions::assert_eq!(
|
5438 - | input.struct_with_json_name,
|
5439 - | expected.struct_with_json_name,
|
5440 - | "Unexpected value for `struct_with_json_name`"
|
5441 - | );
|
5442 - | ::pretty_assertions::assert_eq!(
|
5443 - | input.timestamp,
|
5444 - | expected.timestamp,
|
5445 - | "Unexpected value for `timestamp`"
|
5446 - | );
|
5447 - | ::pretty_assertions::assert_eq!(
|
5448 - | input.unix_timestamp,
|
5449 - | expected.unix_timestamp,
|
5450 - | "Unexpected value for `unix_timestamp`"
|
5451 - | );
|
5452 - | let output = crate::output::KitchenSinkOperationOutput {
|
5453 - | blob: ::std::option::Option::None,
|
5454 - | boolean: ::std::option::Option::None,
|
5455 - | double: ::std::option::Option::None,
|
5456 - | empty_struct: ::std::option::Option::None,
|
5457 - | float: ::std::option::Option::None,
|
5458 - | httpdate_timestamp: ::std::option::Option::None,
|
5459 - | integer: ::std::option::Option::None,
|
5460 - | iso8601_timestamp: ::std::option::Option::None,
|
5461 - | json_value: ::std::option::Option::None,
|
5462 - | list_of_lists: ::std::option::Option::None,
|
5463 - | list_of_maps_of_strings: ::std::option::Option::None,
|
5464 - | list_of_strings: ::std::option::Option::None,
|
5465 - | list_of_structs: ::std::option::Option::None,
|
5466 - | long: ::std::option::Option::None,
|
5467 - | map_of_lists_of_strings: ::std::option::Option::None,
|
5468 - | map_of_maps: ::std::option::Option::None,
|
5469 - | map_of_strings: ::std::option::Option::None,
|
5470 - | map_of_structs: ::std::option::Option::None,
|
5471 - | recursive_list: ::std::option::Option::None,
|
5472 - | recursive_map: ::std::option::Option::None,
|
5473 - | recursive_struct: ::std::option::Option::None,
|
5474 - | simple_struct: ::std::option::Option::None,
|
5475 - | string: ::std::option::Option::None,
|
5476 - | struct_with_json_name: ::std::option::Option::None,
|
5477 - | timestamp: ::std::option::Option::None,
|
5478 - | unix_timestamp: ::std::option::Option::None,
|
5479 - | };
|
5480 - | Ok(output)
|
5312 + | let service = crate::service::JsonProtocol::builder::<
|
5313 + | ::aws_smithy_http_server::body::BoxBody,
|
5314 + | _,
|
5315 + | _,
|
5316 + | _,
|
5317 + | >(config)
|
5318 + | .kitchen_sink_operation(move |input: crate::input::KitchenSinkOperationInput| {
|
5319 + | let sender = sender.clone();
|
5320 + | async move {
|
5321 + | let result = {
|
5322 + | use ::aws_smithy_protocol_test::FloatEquals;
|
5323 + | let expected = crate::input::KitchenSinkOperationInput {
|
5324 + | blob: ::std::option::Option::Some(::aws_smithy_types::Blob::new(
|
5325 + | "binary-value",
|
5326 + | )),
|
5327 + | boolean: ::std::option::Option::None,
|
5328 + | double: ::std::option::Option::None,
|
5329 + | empty_struct: ::std::option::Option::None,
|
5330 + | float: ::std::option::Option::None,
|
5331 + | httpdate_timestamp: ::std::option::Option::None,
|
5332 + | integer: ::std::option::Option::None,
|
5333 + | iso8601_timestamp: ::std::option::Option::None,
|
5334 + | json_value: ::std::option::Option::None,
|
5335 + | list_of_lists: ::std::option::Option::None,
|
5336 + | list_of_maps_of_strings: ::std::option::Option::None,
|
5337 + | list_of_strings: ::std::option::Option::None,
|
5338 + | list_of_structs: ::std::option::Option::None,
|
5339 + | long: ::std::option::Option::None,
|
5340 + | map_of_lists_of_strings: ::std::option::Option::None,
|
5341 + | map_of_maps: ::std::option::Option::None,
|
5342 + | map_of_strings: ::std::option::Option::None,
|
5343 + | map_of_structs: ::std::option::Option::None,
|
5344 + | recursive_list: ::std::option::Option::None,
|
5345 + | recursive_map: ::std::option::Option::None,
|
5346 + | recursive_struct: ::std::option::Option::None,
|
5347 + | simple_struct: ::std::option::Option::None,
|
5348 + | string: ::std::option::Option::None,
|
5349 + | struct_with_json_name: ::std::option::Option::None,
|
5350 + | timestamp: ::std::option::Option::None,
|
5351 + | unix_timestamp: ::std::option::Option::None,
|
5481 5352 | };
|
5482 - | sender.send(()).await.expect("receiver dropped early");
|
5483 - | result
|
5484 - | }
|
5485 - | })
|
5486 - | .build_unchecked();
|
5487 - | let http_response = ::tower::ServiceExt::oneshot(service, http_request)
|
5488 - | .await
|
5489 - | .expect("unable to make an HTTP request");
|
5490 - | assert!(
|
5491 - | receiver.recv().await.is_some(),
|
5492 - | "we expected operation handler to be invoked but it was not entered"
|
5493 - | );
|
5494 - | }
|
5495 - |
|
5496 - | /// Serializes boolean shapes (false)
|
5497 - | /// Test ID: serializes_boolean_shapes_false
|
5498 - | #[::tokio::test]
|
5499 - | #[::tracing_test::traced_test]
|
5500 - | async fn serializes_boolean_shapes_false_request() {
|
5501 - | #[allow(unused_mut)]
|
5502 - | let mut http_request = http::Request::builder()
|
5503 - | .uri("/")
|
5504 - | .method("POST")
|
5505 - | .header("Content-Type", "application/x-amz-json-1.1")
|
5506 - | .header("X-Amz-Target", "JsonProtocol.KitchenSinkOperation")
|
5507 - | .body(::aws_smithy_http_server::body::Body::from(
|
5508 - | ::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
|
5509 - | "{\"Boolean\":false}".as_bytes(),
|
5510 - | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
5511 - | )),
|
5512 - | ))
|
5513 - | .unwrap();
|
5514 - | #[allow(unused_mut)]
|
5515 - | let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
|
5516 - | let config = crate::service::JsonProtocolConfig::builder().build();
|
5517 - | let service = crate::service::JsonProtocol::builder::<::hyper::body::Body, _, _, _>(config)
|
5518 - | .kitchen_sink_operation(move |input: crate::input::KitchenSinkOperationInput| {
|
5519 - | let sender = sender.clone();
|
5520 - | async move {
|
5521 - | let result = {
|
5522 - | use ::aws_smithy_protocol_test::FloatEquals;
|
5523 - | let expected = crate::input::KitchenSinkOperationInput {
|
5524 - | boolean: ::std::option::Option::Some(false),
|
5525 - | blob: ::std::option::Option::None,
|
5526 - | double: ::std::option::Option::None,
|
5527 - | empty_struct: ::std::option::Option::None,
|
5528 - | float: ::std::option::Option::None,
|
5529 - | httpdate_timestamp: ::std::option::Option::None,
|
5530 - | integer: ::std::option::Option::None,
|
5531 - | iso8601_timestamp: ::std::option::Option::None,
|
5532 - | json_value: ::std::option::Option::None,
|
5533 - | list_of_lists: ::std::option::Option::None,
|
5534 - | list_of_maps_of_strings: ::std::option::Option::None,
|
5535 - | list_of_strings: ::std::option::Option::None,
|
5536 - | list_of_structs: ::std::option::Option::None,
|
5537 - | long: ::std::option::Option::None,
|
5538 - | map_of_lists_of_strings: ::std::option::Option::None,
|
5539 - | map_of_maps: ::std::option::Option::None,
|
5540 - | map_of_strings: ::std::option::Option::None,
|
5541 - | map_of_structs: ::std::option::Option::None,
|
5542 - | recursive_list: ::std::option::Option::None,
|
5543 - | recursive_map: ::std::option::Option::None,
|
5544 - | recursive_struct: ::std::option::Option::None,
|
5545 - | simple_struct: ::std::option::Option::None,
|
5546 - | string: ::std::option::Option::None,
|
5547 - | struct_with_json_name: ::std::option::Option::None,
|
5548 - | timestamp: ::std::option::Option::None,
|
5549 - | unix_timestamp: ::std::option::Option::None,
|
5550 - | };
|
5551 - | ::pretty_assertions::assert_eq!(
|
5552 - | input.blob,
|
5553 - | expected.blob,
|
5554 - | "Unexpected value for `blob`"
|
5555 - | );
|
5556 - | ::pretty_assertions::assert_eq!(
|
5557 - | input.boolean,
|
5558 - | expected.boolean,
|
5559 - | "Unexpected value for `boolean`"
|
5560 - | );
|
5561 - | assert!(
|
5562 - | input.double.float_equals(&expected.double),
|
5563 - | "Unexpected value for `double` {:?} vs. {:?}",
|
5564 - | expected.double,
|
5565 - | input.double
|
5566 - | );
|
5567 - | ::pretty_assertions::assert_eq!(
|
5568 - | input.empty_struct,
|
5569 - | expected.empty_struct,
|
5570 - | "Unexpected value for `empty_struct`"
|
5571 - | );
|
5572 - | assert!(
|
5573 - | input.float.float_equals(&expected.float),
|
5574 - | "Unexpected value for `float` {:?} vs. {:?}",
|
5575 - | expected.float,
|
5576 - | input.float
|
5577 - | );
|
5578 - | ::pretty_assertions::assert_eq!(
|
5579 - | input.httpdate_timestamp,
|
5580 - | expected.httpdate_timestamp,
|
5581 - | "Unexpected value for `httpdate_timestamp`"
|
5582 - | );
|
5583 - | ::pretty_assertions::assert_eq!(
|
5584 - | input.integer,
|
5585 - | expected.integer,
|
5586 - | "Unexpected value for `integer`"
|
5587 - | );
|
5588 - | ::pretty_assertions::assert_eq!(
|
5589 - | input.iso8601_timestamp,
|
5590 - | expected.iso8601_timestamp,
|
5591 - | "Unexpected value for `iso8601_timestamp`"
|
5592 - | );
|
5593 - | ::pretty_assertions::assert_eq!(
|
5594 - | input.json_value,
|
5595 - | expected.json_value,
|
5596 - | "Unexpected value for `json_value`"
|
5597 - | );
|
5598 - | ::pretty_assertions::assert_eq!(
|
5599 - | input.list_of_lists,
|
5600 - | expected.list_of_lists,
|
5601 - | "Unexpected value for `list_of_lists`"
|
5602 - | );
|
5603 - | ::pretty_assertions::assert_eq!(
|
5604 - | input.list_of_maps_of_strings,
|
5605 - | expected.list_of_maps_of_strings,
|
5606 - | "Unexpected value for `list_of_maps_of_strings`"
|
5607 - | );
|
5608 - | ::pretty_assertions::assert_eq!(
|
5609 - | input.list_of_strings,
|
5610 - | expected.list_of_strings,
|
5611 - | "Unexpected value for `list_of_strings`"
|
5612 - | );
|
5613 - | ::pretty_assertions::assert_eq!(
|
5614 - | input.list_of_structs,
|
5615 - | expected.list_of_structs,
|
5616 - | "Unexpected value for `list_of_structs`"
|
5617 - | );
|
5618 - | ::pretty_assertions::assert_eq!(
|
5619 - | input.long,
|
5620 - | expected.long,
|
5621 - | "Unexpected value for `long`"
|
5622 - | );
|
5623 - | ::pretty_assertions::assert_eq!(
|
5624 - | input.map_of_lists_of_strings,
|
5625 - | expected.map_of_lists_of_strings,
|
5626 - | "Unexpected value for `map_of_lists_of_strings`"
|
5627 - | );
|
5628 - | ::pretty_assertions::assert_eq!(
|
5629 - | input.map_of_maps,
|
5630 - | expected.map_of_maps,
|
5631 - | "Unexpected value for `map_of_maps`"
|
5632 - | );
|
5633 - | ::pretty_assertions::assert_eq!(
|
5634 - | input.map_of_strings,
|
5635 - | expected.map_of_strings,
|
5636 - | "Unexpected value for `map_of_strings`"
|
5637 - | );
|
5638 - | ::pretty_assertions::assert_eq!(
|
5639 - | input.map_of_structs,
|
5640 - | expected.map_of_structs,
|
5641 - | "Unexpected value for `map_of_structs`"
|
5642 - | );
|
5643 - | ::pretty_assertions::assert_eq!(
|
5644 - | input.recursive_list,
|
5645 - | expected.recursive_list,
|
5646 - | "Unexpected value for `recursive_list`"
|
5647 - | );
|
5648 - | ::pretty_assertions::assert_eq!(
|
5649 - | input.recursive_map,
|
5650 - | expected.recursive_map,
|
5651 - | "Unexpected value for `recursive_map`"
|
5652 - | );
|
5653 - | ::pretty_assertions::assert_eq!(
|
5654 - | input.recursive_struct,
|
5655 - | expected.recursive_struct,
|
5656 - | "Unexpected value for `recursive_struct`"
|
5657 - | );
|
5658 - | ::pretty_assertions::assert_eq!(
|
5659 - | input.simple_struct,
|
5660 - | expected.simple_struct,
|
5661 - | "Unexpected value for `simple_struct`"
|
5662 - | );
|
5663 - | ::pretty_assertions::assert_eq!(
|
5664 - | input.string,
|
5665 - | expected.string,
|
5666 - | "Unexpected value for `string`"
|
5667 - | );
|
5668 - | ::pretty_assertions::assert_eq!(
|
5669 - | input.struct_with_json_name,
|
5670 - | expected.struct_with_json_name,
|
5671 - | "Unexpected value for `struct_with_json_name`"
|
5672 - | );
|
5673 - | ::pretty_assertions::assert_eq!(
|
5674 - | input.timestamp,
|
5675 - | expected.timestamp,
|
5676 - | "Unexpected value for `timestamp`"
|
5677 - | );
|
5678 - | ::pretty_assertions::assert_eq!(
|
5679 - | input.unix_timestamp,
|
5680 - | expected.unix_timestamp,
|
5681 - | "Unexpected value for `unix_timestamp`"
|
5682 - | );
|
5683 - | let output = crate::output::KitchenSinkOperationOutput {
|
5684 - | blob: ::std::option::Option::None,
|
5685 - | boolean: ::std::option::Option::None,
|
5686 - | double: ::std::option::Option::None,
|
5687 - | empty_struct: ::std::option::Option::None,
|
5688 - | float: ::std::option::Option::None,
|
5689 - | httpdate_timestamp: ::std::option::Option::None,
|
5690 - | integer: ::std::option::Option::None,
|
5691 - | iso8601_timestamp: ::std::option::Option::None,
|
5692 - | json_value: ::std::option::Option::None,
|
5693 - | list_of_lists: ::std::option::Option::None,
|
5694 - | list_of_maps_of_strings: ::std::option::Option::None,
|
5695 - | list_of_strings: ::std::option::Option::None,
|
5696 - | list_of_structs: ::std::option::Option::None,
|
5697 - | long: ::std::option::Option::None,
|
5698 - | map_of_lists_of_strings: ::std::option::Option::None,
|
5699 - | map_of_maps: ::std::option::Option::None,
|
5700 - | map_of_strings: ::std::option::Option::None,
|
5701 - | map_of_structs: ::std::option::Option::None,
|
5702 - | recursive_list: ::std::option::Option::None,
|
5703 - | recursive_map: ::std::option::Option::None,
|
5704 - | recursive_struct: ::std::option::Option::None,
|
5705 - | simple_struct: ::std::option::Option::None,
|
5706 - | string: ::std::option::Option::None,
|
5707 - | struct_with_json_name: ::std::option::Option::None,
|
5708 - | timestamp: ::std::option::Option::None,
|
5709 - | unix_timestamp: ::std::option::Option::None,
|
5710 - | };
|
5711 - | Ok(output)
|
5353 + | ::pretty_assertions::assert_eq!(
|
5354 + | input.blob,
|
5355 + | expected.blob,
|
5356 + | "Unexpected value for `blob`"
|
5357 + | );
|
5358 + | ::pretty_assertions::assert_eq!(
|
5359 + | input.boolean,
|
5360 + | expected.boolean,
|
5361 + | "Unexpected value for `boolean`"
|
5362 + | );
|
5363 + | assert!(
|
5364 + | input.double.float_equals(&expected.double),
|
5365 + | "Unexpected value for `double` {:?} vs. {:?}",
|
5366 + | expected.double,
|
5367 + | input.double
|
5368 + | );
|
5369 + | ::pretty_assertions::assert_eq!(
|
5370 + | input.empty_struct,
|
5371 + | expected.empty_struct,
|
5372 + | "Unexpected value for `empty_struct`"
|
5373 + | );
|
5374 + | assert!(
|
5375 + | input.float.float_equals(&expected.float),
|
5376 + | "Unexpected value for `float` {:?} vs. {:?}",
|
5377 + | expected.float,
|
5378 + | input.float
|
5379 + | );
|
5380 + | ::pretty_assertions::assert_eq!(
|
5381 + | input.httpdate_timestamp,
|
5382 + | expected.httpdate_timestamp,
|
5383 + | "Unexpected value for `httpdate_timestamp`"
|
5384 + | );
|
5385 + | ::pretty_assertions::assert_eq!(
|
5386 + | input.integer,
|
5387 + | expected.integer,
|
5388 + | "Unexpected value for `integer`"
|
5389 + | );
|
5390 + | ::pretty_assertions::assert_eq!(
|
5391 + | input.iso8601_timestamp,
|
5392 + | expected.iso8601_timestamp,
|
5393 + | "Unexpected value for `iso8601_timestamp`"
|
5394 + | );
|
5395 + | ::pretty_assertions::assert_eq!(
|
5396 + | input.json_value,
|
5397 + | expected.json_value,
|
5398 + | "Unexpected value for `json_value`"
|
5399 + | );
|
5400 + | ::pretty_assertions::assert_eq!(
|
5401 + | input.list_of_lists,
|
5402 + | expected.list_of_lists,
|
5403 + | "Unexpected value for `list_of_lists`"
|
5404 + | );
|
5405 + | ::pretty_assertions::assert_eq!(
|
5406 + | input.list_of_maps_of_strings,
|
5407 + | expected.list_of_maps_of_strings,
|
5408 + | "Unexpected value for `list_of_maps_of_strings`"
|
5409 + | );
|
5410 + | ::pretty_assertions::assert_eq!(
|
5411 + | input.list_of_strings,
|
5412 + | expected.list_of_strings,
|
5413 + | "Unexpected value for `list_of_strings`"
|
5414 + | );
|
5415 + | ::pretty_assertions::assert_eq!(
|
5416 + | input.list_of_structs,
|
5417 + | expected.list_of_structs,
|
5418 + | "Unexpected value for `list_of_structs`"
|
5419 + | );
|
5420 + | ::pretty_assertions::assert_eq!(
|
5421 + | input.long,
|
5422 + | expected.long,
|
5423 + | "Unexpected value for `long`"
|
5424 + | );
|
5425 + | ::pretty_assertions::assert_eq!(
|
5426 + | input.map_of_lists_of_strings,
|
5427 + | expected.map_of_lists_of_strings,
|
5428 + | "Unexpected value for `map_of_lists_of_strings`"
|
5429 + | );
|
5430 + | ::pretty_assertions::assert_eq!(
|
5431 + | input.map_of_maps,
|
5432 + | expected.map_of_maps,
|
5433 + | "Unexpected value for `map_of_maps`"
|
5434 + | );
|
5435 + | ::pretty_assertions::assert_eq!(
|
5436 + | input.map_of_strings,
|
5437 + | expected.map_of_strings,
|
5438 + | "Unexpected value for `map_of_strings`"
|
5439 + | );
|
5440 + | ::pretty_assertions::assert_eq!(
|
5441 + | input.map_of_structs,
|
5442 + | expected.map_of_structs,
|
5443 + | "Unexpected value for `map_of_structs`"
|
5444 + | );
|
5445 + | ::pretty_assertions::assert_eq!(
|
5446 + | input.recursive_list,
|
5447 + | expected.recursive_list,
|
5448 + | "Unexpected value for `recursive_list`"
|
5449 + | );
|
5450 + | ::pretty_assertions::assert_eq!(
|
5451 + | input.recursive_map,
|
5452 + | expected.recursive_map,
|
5453 + | "Unexpected value for `recursive_map`"
|
5454 + | );
|
5455 + | ::pretty_assertions::assert_eq!(
|
5456 + | input.recursive_struct,
|
5457 + | expected.recursive_struct,
|
5458 + | "Unexpected value for `recursive_struct`"
|
5459 + | );
|
5460 + | ::pretty_assertions::assert_eq!(
|
5461 + | input.simple_struct,
|
5462 + | expected.simple_struct,
|
5463 + | "Unexpected value for `simple_struct`"
|
5464 + | );
|
5465 + | ::pretty_assertions::assert_eq!(
|
5466 + | input.string,
|
5467 + | expected.string,
|
5468 + | "Unexpected value for `string`"
|
5469 + | );
|
5470 + | ::pretty_assertions::assert_eq!(
|
5471 + | input.struct_with_json_name,
|
5472 + | expected.struct_with_json_name,
|
5473 + | "Unexpected value for `struct_with_json_name`"
|
5474 + | );
|
5475 + | ::pretty_assertions::assert_eq!(
|
5476 + | input.timestamp,
|
5477 + | expected.timestamp,
|
5478 + | "Unexpected value for `timestamp`"
|
5479 + | );
|
5480 + | ::pretty_assertions::assert_eq!(
|
5481 + | input.unix_timestamp,
|
5482 + | expected.unix_timestamp,
|
5483 + | "Unexpected value for `unix_timestamp`"
|
5484 + | );
|
5485 + | let output = crate::output::KitchenSinkOperationOutput {
|
5486 + | blob: ::std::option::Option::None,
|
5487 + | boolean: ::std::option::Option::None,
|
5488 + | double: ::std::option::Option::None,
|
5489 + | empty_struct: ::std::option::Option::None,
|
5490 + | float: ::std::option::Option::None,
|
5491 + | httpdate_timestamp: ::std::option::Option::None,
|
5492 + | integer: ::std::option::Option::None,
|
5493 + | iso8601_timestamp: ::std::option::Option::None,
|
5494 + | json_value: ::std::option::Option::None,
|
5495 + | list_of_lists: ::std::option::Option::None,
|
5496 + | list_of_maps_of_strings: ::std::option::Option::None,
|
5497 + | list_of_strings: ::std::option::Option::None,
|
5498 + | list_of_structs: ::std::option::Option::None,
|
5499 + | long: ::std::option::Option::None,
|
5500 + | map_of_lists_of_strings: ::std::option::Option::None,
|
5501 + | map_of_maps: ::std::option::Option::None,
|
5502 + | map_of_strings: ::std::option::Option::None,
|
5503 + | map_of_structs: ::std::option::Option::None,
|
5504 + | recursive_list: ::std::option::Option::None,
|
5505 + | recursive_map: ::std::option::Option::None,
|
5506 + | recursive_struct: ::std::option::Option::None,
|
5507 + | simple_struct: ::std::option::Option::None,
|
5508 + | string: ::std::option::Option::None,
|
5509 + | struct_with_json_name: ::std::option::Option::None,
|
5510 + | timestamp: ::std::option::Option::None,
|
5511 + | unix_timestamp: ::std::option::Option::None,
|
5712 5512 | };
|
5713 - | sender.send(()).await.expect("receiver dropped early");
|
5714 - | result
|
5715 - | }
|
5716 - | })
|
5717 - | .build_unchecked();
|
5513 + | Ok(output)
|
5514 + | };
|
5515 + | sender.send(()).await.expect("receiver dropped early");
|
5516 + | result
|
5517 + | }
|
5518 + | })
|
5519 + | .build_unchecked();
|
5718 5520 | let http_response = ::tower::ServiceExt::oneshot(service, http_request)
|
5719 5521 | .await
|
5720 5522 | .expect("unable to make an HTTP request");
|
5721 5523 | assert!(
|
5722 5524 | receiver.recv().await.is_some(),
|
5723 5525 | "we expected operation handler to be invoked but it was not entered"
|
5724 5526 | );
|
5725 5527 | }
|
5726 5528 |
|
5727 - | /// Serializes timestamp shapes
|
5728 - | /// Test ID: serializes_timestamp_shapes
|
5529 + | /// Serializes boolean shapes (true)
|
5530 + | /// Test ID: serializes_boolean_shapes_true
|
5729 5531 | #[::tokio::test]
|
5730 5532 | #[::tracing_test::traced_test]
|
5731 - | async fn serializes_timestamp_shapes_request() {
|
5533 + | async fn serializes_boolean_shapes_true_request() {
|
5732 5534 | #[allow(unused_mut)]
|
5733 - | let mut http_request = http::Request::builder()
|
5535 + | let mut http_request = ::http_1x::Request::builder()
|
5734 5536 | .uri("/")
|
5735 5537 | .method("POST")
|
5736 5538 | .header("Content-Type", "application/x-amz-json-1.1")
|
5737 5539 | .header("X-Amz-Target", "JsonProtocol.KitchenSinkOperation")
|
5738 - | .body(::aws_smithy_http_server::body::Body::from(
|
5739 - | ::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
|
5740 - | "{\"Timestamp\":946845296}".as_bytes(),
|
5741 - | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
5540 + | .body(::aws_smithy_http_server::body::boxed(
|
5541 + | ::http_body_util::Full::new(::bytes::Bytes::copy_from_slice(
|
5542 + | &::aws_smithy_protocol_test::decode_body_data(
|
5543 + | "{\"Boolean\":true}".as_bytes(),
|
5544 + | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
5545 + | ),
|
5742 5546 | )),
|
5743 5547 | ))
|
5744 5548 | .unwrap();
|
5745 5549 | #[allow(unused_mut)]
|
5746 5550 | let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
|
5747 5551 | let config = crate::service::JsonProtocolConfig::builder().build();
|
5748 - | let service = crate::service::JsonProtocol::builder::<::hyper::body::Body, _, _, _>(config)
|
5749 - | .kitchen_sink_operation(move |input: crate::input::KitchenSinkOperationInput| {
|
5750 - | let sender = sender.clone();
|
5751 - | async move {
|
5752 - | let result = {
|
5753 - | use ::aws_smithy_protocol_test::FloatEquals;
|
5754 - | let expected = crate::input::KitchenSinkOperationInput {
|
5755 - | timestamp: ::std::option::Option::Some(
|
5756 - | ::aws_smithy_types::DateTime::from_fractional_secs(
|
5757 - | 946845296, 0_f64,
|
5758 - | ),
|
5759 - | ),
|
5760 - | blob: ::std::option::Option::None,
|
5761 - | boolean: ::std::option::Option::None,
|
5762 - | double: ::std::option::Option::None,
|
5763 - | empty_struct: ::std::option::Option::None,
|
5764 - | float: ::std::option::Option::None,
|
5765 - | httpdate_timestamp: ::std::option::Option::None,
|
5766 - | integer: ::std::option::Option::None,
|
5767 - | iso8601_timestamp: ::std::option::Option::None,
|
5768 - | json_value: ::std::option::Option::None,
|
5769 - | list_of_lists: ::std::option::Option::None,
|
5770 - | list_of_maps_of_strings: ::std::option::Option::None,
|
5771 - | list_of_strings: ::std::option::Option::None,
|
5772 - | list_of_structs: ::std::option::Option::None,
|
5773 - | long: ::std::option::Option::None,
|
5774 - | map_of_lists_of_strings: ::std::option::Option::None,
|
5775 - | map_of_maps: ::std::option::Option::None,
|
5776 - | map_of_strings: ::std::option::Option::None,
|
5777 - | map_of_structs: ::std::option::Option::None,
|
5778 - | recursive_list: ::std::option::Option::None,
|
5779 - | recursive_map: ::std::option::Option::None,
|
5780 - | recursive_struct: ::std::option::Option::None,
|
5781 - | simple_struct: ::std::option::Option::None,
|
5782 - | string: ::std::option::Option::None,
|
5783 - | struct_with_json_name: ::std::option::Option::None,
|
5784 - | unix_timestamp: ::std::option::Option::None,
|
5785 - | };
|
5786 - | ::pretty_assertions::assert_eq!(
|
5787 - | input.blob,
|
5788 - | expected.blob,
|
5789 - | "Unexpected value for `blob`"
|
5790 - | );
|
5791 - | ::pretty_assertions::assert_eq!(
|
5792 - | input.boolean,
|
5793 - | expected.boolean,
|
5794 - | "Unexpected value for `boolean`"
|
5795 - | );
|
5796 - | assert!(
|
5797 - | input.double.float_equals(&expected.double),
|
5798 - | "Unexpected value for `double` {:?} vs. {:?}",
|
5799 - | expected.double,
|
5800 - | input.double
|
5801 - | );
|
5802 - | ::pretty_assertions::assert_eq!(
|
5803 - | input.empty_struct,
|
5804 - | expected.empty_struct,
|
5805 - | "Unexpected value for `empty_struct`"
|
5806 - | );
|
5807 - | assert!(
|
5808 - | input.float.float_equals(&expected.float),
|
5809 - | "Unexpected value for `float` {:?} vs. {:?}",
|
5810 - | expected.float,
|
5811 - | input.float
|
5812 - | );
|
5813 - | ::pretty_assertions::assert_eq!(
|
5814 - | input.httpdate_timestamp,
|
5815 - | expected.httpdate_timestamp,
|
5816 - | "Unexpected value for `httpdate_timestamp`"
|
5817 - | );
|
5818 - | ::pretty_assertions::assert_eq!(
|
5819 - | input.integer,
|
5820 - | expected.integer,
|
5821 - | "Unexpected value for `integer`"
|
5822 - | );
|
5823 - | ::pretty_assertions::assert_eq!(
|
5824 - | input.iso8601_timestamp,
|
5825 - | expected.iso8601_timestamp,
|
5826 - | "Unexpected value for `iso8601_timestamp`"
|
5827 - | );
|
5828 - | ::pretty_assertions::assert_eq!(
|
5829 - | input.json_value,
|
5830 - | expected.json_value,
|
5831 - | "Unexpected value for `json_value`"
|
5832 - | );
|
5833 - | ::pretty_assertions::assert_eq!(
|
5834 - | input.list_of_lists,
|
5835 - | expected.list_of_lists,
|
5836 - | "Unexpected value for `list_of_lists`"
|
5837 - | );
|
5838 - | ::pretty_assertions::assert_eq!(
|
5839 - | input.list_of_maps_of_strings,
|
5840 - | expected.list_of_maps_of_strings,
|
5841 - | "Unexpected value for `list_of_maps_of_strings`"
|
5842 - | );
|
5843 - | ::pretty_assertions::assert_eq!(
|
5844 - | input.list_of_strings,
|
5845 - | expected.list_of_strings,
|
5846 - | "Unexpected value for `list_of_strings`"
|
5847 - | );
|
5848 - | ::pretty_assertions::assert_eq!(
|
5849 - | input.list_of_structs,
|
5850 - | expected.list_of_structs,
|
5851 - | "Unexpected value for `list_of_structs`"
|
5852 - | );
|
5853 - | ::pretty_assertions::assert_eq!(
|
5854 - | input.long,
|
5855 - | expected.long,
|
5856 - | "Unexpected value for `long`"
|
5857 - | );
|
5858 - | ::pretty_assertions::assert_eq!(
|
5859 - | input.map_of_lists_of_strings,
|
5860 - | expected.map_of_lists_of_strings,
|
5861 - | "Unexpected value for `map_of_lists_of_strings`"
|
5862 - | );
|
5863 - | ::pretty_assertions::assert_eq!(
|
5864 - | input.map_of_maps,
|
5865 - | expected.map_of_maps,
|
5866 - | "Unexpected value for `map_of_maps`"
|
5867 - | );
|
5868 - | ::pretty_assertions::assert_eq!(
|
5869 - | input.map_of_strings,
|
5870 - | expected.map_of_strings,
|
5871 - | "Unexpected value for `map_of_strings`"
|
5872 - | );
|
5873 - | ::pretty_assertions::assert_eq!(
|
5874 - | input.map_of_structs,
|
5875 - | expected.map_of_structs,
|
5876 - | "Unexpected value for `map_of_structs`"
|
5877 - | );
|
5878 - | ::pretty_assertions::assert_eq!(
|
5879 - | input.recursive_list,
|
5880 - | expected.recursive_list,
|
5881 - | "Unexpected value for `recursive_list`"
|
5882 - | );
|
5883 - | ::pretty_assertions::assert_eq!(
|
5884 - | input.recursive_map,
|
5885 - | expected.recursive_map,
|
5886 - | "Unexpected value for `recursive_map`"
|
5887 - | );
|
5888 - | ::pretty_assertions::assert_eq!(
|
5889 - | input.recursive_struct,
|
5890 - | expected.recursive_struct,
|
5891 - | "Unexpected value for `recursive_struct`"
|
5892 - | );
|
5893 - | ::pretty_assertions::assert_eq!(
|
5894 - | input.simple_struct,
|
5895 - | expected.simple_struct,
|
5896 - | "Unexpected value for `simple_struct`"
|
5897 - | );
|
5898 - | ::pretty_assertions::assert_eq!(
|
5899 - | input.string,
|
5900 - | expected.string,
|
5901 - | "Unexpected value for `string`"
|
5902 - | );
|
5903 - | ::pretty_assertions::assert_eq!(
|
5904 - | input.struct_with_json_name,
|
5905 - | expected.struct_with_json_name,
|
5906 - | "Unexpected value for `struct_with_json_name`"
|
5907 - | );
|
5908 - | ::pretty_assertions::assert_eq!(
|
5909 - | input.timestamp,
|
5910 - | expected.timestamp,
|
5911 - | "Unexpected value for `timestamp`"
|
5912 - | );
|
5913 - | ::pretty_assertions::assert_eq!(
|
5914 - | input.unix_timestamp,
|
5915 - | expected.unix_timestamp,
|
5916 - | "Unexpected value for `unix_timestamp`"
|
5917 - | );
|
5918 - | let output = crate::output::KitchenSinkOperationOutput {
|
5919 - | blob: ::std::option::Option::None,
|
5920 - | boolean: ::std::option::Option::None,
|
5921 - | double: ::std::option::Option::None,
|
5922 - | empty_struct: ::std::option::Option::None,
|
5923 - | float: ::std::option::Option::None,
|
5924 - | httpdate_timestamp: ::std::option::Option::None,
|
5925 - | integer: ::std::option::Option::None,
|
5926 - | iso8601_timestamp: ::std::option::Option::None,
|
5927 - | json_value: ::std::option::Option::None,
|
5928 - | list_of_lists: ::std::option::Option::None,
|
5929 - | list_of_maps_of_strings: ::std::option::Option::None,
|
5930 - | list_of_strings: ::std::option::Option::None,
|
5931 - | list_of_structs: ::std::option::Option::None,
|
5932 - | long: ::std::option::Option::None,
|
5933 - | map_of_lists_of_strings: ::std::option::Option::None,
|
5934 - | map_of_maps: ::std::option::Option::None,
|
5935 - | map_of_strings: ::std::option::Option::None,
|
5936 - | map_of_structs: ::std::option::Option::None,
|
5937 - | recursive_list: ::std::option::Option::None,
|
5938 - | recursive_map: ::std::option::Option::None,
|
5939 - | recursive_struct: ::std::option::Option::None,
|
5940 - | simple_struct: ::std::option::Option::None,
|
5941 - | string: ::std::option::Option::None,
|
5942 - | struct_with_json_name: ::std::option::Option::None,
|
5943 - | timestamp: ::std::option::Option::None,
|
5944 - | unix_timestamp: ::std::option::Option::None,
|
5945 - | };
|
5946 - | Ok(output)
|
5552 + | let service = crate::service::JsonProtocol::builder::<
|
5553 + | ::aws_smithy_http_server::body::BoxBody,
|
5554 + | _,
|
5555 + | _,
|
5556 + | _,
|
5557 + | >(config)
|
5558 + | .kitchen_sink_operation(move |input: crate::input::KitchenSinkOperationInput| {
|
5559 + | let sender = sender.clone();
|
5560 + | async move {
|
5561 + | let result = {
|
5562 + | use ::aws_smithy_protocol_test::FloatEquals;
|
5563 + | let expected = crate::input::KitchenSinkOperationInput {
|
5564 + | boolean: ::std::option::Option::Some(true),
|
5565 + | blob: ::std::option::Option::None,
|
5566 + | double: ::std::option::Option::None,
|
5567 + | empty_struct: ::std::option::Option::None,
|
5568 + | float: ::std::option::Option::None,
|
5569 + | httpdate_timestamp: ::std::option::Option::None,
|
5570 + | integer: ::std::option::Option::None,
|
5571 + | iso8601_timestamp: ::std::option::Option::None,
|
5572 + | json_value: ::std::option::Option::None,
|
5573 + | list_of_lists: ::std::option::Option::None,
|
5574 + | list_of_maps_of_strings: ::std::option::Option::None,
|
5575 + | list_of_strings: ::std::option::Option::None,
|
5576 + | list_of_structs: ::std::option::Option::None,
|
5577 + | long: ::std::option::Option::None,
|
5578 + | map_of_lists_of_strings: ::std::option::Option::None,
|
5579 + | map_of_maps: ::std::option::Option::None,
|
5580 + | map_of_strings: ::std::option::Option::None,
|
5581 + | map_of_structs: ::std::option::Option::None,
|
5582 + | recursive_list: ::std::option::Option::None,
|
5583 + | recursive_map: ::std::option::Option::None,
|
5584 + | recursive_struct: ::std::option::Option::None,
|
5585 + | simple_struct: ::std::option::Option::None,
|
5586 + | string: ::std::option::Option::None,
|
5587 + | struct_with_json_name: ::std::option::Option::None,
|
5588 + | timestamp: ::std::option::Option::None,
|
5589 + | unix_timestamp: ::std::option::Option::None,
|
5947 5590 | };
|
5948 - | sender.send(()).await.expect("receiver dropped early");
|
5949 - | result
|
5950 - | }
|
5951 - | })
|
5952 - | .build_unchecked();
|
5591 + | ::pretty_assertions::assert_eq!(
|
5592 + | input.blob,
|
5593 + | expected.blob,
|
5594 + | "Unexpected value for `blob`"
|
5595 + | );
|
5596 + | ::pretty_assertions::assert_eq!(
|
5597 + | input.boolean,
|
5598 + | expected.boolean,
|
5599 + | "Unexpected value for `boolean`"
|
5600 + | );
|
5601 + | assert!(
|
5602 + | input.double.float_equals(&expected.double),
|
5603 + | "Unexpected value for `double` {:?} vs. {:?}",
|
5604 + | expected.double,
|
5605 + | input.double
|
5606 + | );
|
5607 + | ::pretty_assertions::assert_eq!(
|
5608 + | input.empty_struct,
|
5609 + | expected.empty_struct,
|
5610 + | "Unexpected value for `empty_struct`"
|
5611 + | );
|
5612 + | assert!(
|
5613 + | input.float.float_equals(&expected.float),
|
5614 + | "Unexpected value for `float` {:?} vs. {:?}",
|
5615 + | expected.float,
|
5616 + | input.float
|
5617 + | );
|
5618 + | ::pretty_assertions::assert_eq!(
|
5619 + | input.httpdate_timestamp,
|
5620 + | expected.httpdate_timestamp,
|
5621 + | "Unexpected value for `httpdate_timestamp`"
|
5622 + | );
|
5623 + | ::pretty_assertions::assert_eq!(
|
5624 + | input.integer,
|
5625 + | expected.integer,
|
5626 + | "Unexpected value for `integer`"
|
5627 + | );
|
5628 + | ::pretty_assertions::assert_eq!(
|
5629 + | input.iso8601_timestamp,
|
5630 + | expected.iso8601_timestamp,
|
5631 + | "Unexpected value for `iso8601_timestamp`"
|
5632 + | );
|
5633 + | ::pretty_assertions::assert_eq!(
|
5634 + | input.json_value,
|
5635 + | expected.json_value,
|
5636 + | "Unexpected value for `json_value`"
|
5637 + | );
|
5638 + | ::pretty_assertions::assert_eq!(
|
5639 + | input.list_of_lists,
|
5640 + | expected.list_of_lists,
|
5641 + | "Unexpected value for `list_of_lists`"
|
5642 + | );
|
5643 + | ::pretty_assertions::assert_eq!(
|
5644 + | input.list_of_maps_of_strings,
|
5645 + | expected.list_of_maps_of_strings,
|
5646 + | "Unexpected value for `list_of_maps_of_strings`"
|
5647 + | );
|
5648 + | ::pretty_assertions::assert_eq!(
|
5649 + | input.list_of_strings,
|
5650 + | expected.list_of_strings,
|
5651 + | "Unexpected value for `list_of_strings`"
|
5652 + | );
|
5653 + | ::pretty_assertions::assert_eq!(
|
5654 + | input.list_of_structs,
|
5655 + | expected.list_of_structs,
|
5656 + | "Unexpected value for `list_of_structs`"
|
5657 + | );
|
5658 + | ::pretty_assertions::assert_eq!(
|
5659 + | input.long,
|
5660 + | expected.long,
|
5661 + | "Unexpected value for `long`"
|
5662 + | );
|
5663 + | ::pretty_assertions::assert_eq!(
|
5664 + | input.map_of_lists_of_strings,
|
5665 + | expected.map_of_lists_of_strings,
|
5666 + | "Unexpected value for `map_of_lists_of_strings`"
|
5667 + | );
|
5668 + | ::pretty_assertions::assert_eq!(
|
5669 + | input.map_of_maps,
|
5670 + | expected.map_of_maps,
|
5671 + | "Unexpected value for `map_of_maps`"
|
5672 + | );
|
5673 + | ::pretty_assertions::assert_eq!(
|
5674 + | input.map_of_strings,
|
5675 + | expected.map_of_strings,
|
5676 + | "Unexpected value for `map_of_strings`"
|
5677 + | );
|
5678 + | ::pretty_assertions::assert_eq!(
|
5679 + | input.map_of_structs,
|
5680 + | expected.map_of_structs,
|
5681 + | "Unexpected value for `map_of_structs`"
|
5682 + | );
|
5683 + | ::pretty_assertions::assert_eq!(
|
5684 + | input.recursive_list,
|
5685 + | expected.recursive_list,
|
5686 + | "Unexpected value for `recursive_list`"
|
5687 + | );
|
5688 + | ::pretty_assertions::assert_eq!(
|
5689 + | input.recursive_map,
|
5690 + | expected.recursive_map,
|
5691 + | "Unexpected value for `recursive_map`"
|
5692 + | );
|
5693 + | ::pretty_assertions::assert_eq!(
|
5694 + | input.recursive_struct,
|
5695 + | expected.recursive_struct,
|
5696 + | "Unexpected value for `recursive_struct`"
|
5697 + | );
|
5698 + | ::pretty_assertions::assert_eq!(
|
5699 + | input.simple_struct,
|
5700 + | expected.simple_struct,
|
5701 + | "Unexpected value for `simple_struct`"
|
5702 + | );
|
5703 + | ::pretty_assertions::assert_eq!(
|
5704 + | input.string,
|
5705 + | expected.string,
|
5706 + | "Unexpected value for `string`"
|
5707 + | );
|
5708 + | ::pretty_assertions::assert_eq!(
|
5709 + | input.struct_with_json_name,
|
5710 + | expected.struct_with_json_name,
|
5711 + | "Unexpected value for `struct_with_json_name`"
|
5712 + | );
|
5713 + | ::pretty_assertions::assert_eq!(
|
5714 + | input.timestamp,
|
5715 + | expected.timestamp,
|
5716 + | "Unexpected value for `timestamp`"
|
5717 + | );
|
5718 + | ::pretty_assertions::assert_eq!(
|
5719 + | input.unix_timestamp,
|
5720 + | expected.unix_timestamp,
|
5721 + | "Unexpected value for `unix_timestamp`"
|
5722 + | );
|
5723 + | let output = crate::output::KitchenSinkOperationOutput {
|
5724 + | blob: ::std::option::Option::None,
|
5725 + | boolean: ::std::option::Option::None,
|
5726 + | double: ::std::option::Option::None,
|
5727 + | empty_struct: ::std::option::Option::None,
|
5728 + | float: ::std::option::Option::None,
|
5729 + | httpdate_timestamp: ::std::option::Option::None,
|
5730 + | integer: ::std::option::Option::None,
|
5731 + | iso8601_timestamp: ::std::option::Option::None,
|
5732 + | json_value: ::std::option::Option::None,
|
5733 + | list_of_lists: ::std::option::Option::None,
|
5734 + | list_of_maps_of_strings: ::std::option::Option::None,
|
5735 + | list_of_strings: ::std::option::Option::None,
|
5736 + | list_of_structs: ::std::option::Option::None,
|
5737 + | long: ::std::option::Option::None,
|
5738 + | map_of_lists_of_strings: ::std::option::Option::None,
|
5739 + | map_of_maps: ::std::option::Option::None,
|
5740 + | map_of_strings: ::std::option::Option::None,
|
5741 + | map_of_structs: ::std::option::Option::None,
|
5742 + | recursive_list: ::std::option::Option::None,
|
5743 + | recursive_map: ::std::option::Option::None,
|
5744 + | recursive_struct: ::std::option::Option::None,
|
5745 + | simple_struct: ::std::option::Option::None,
|
5746 + | string: ::std::option::Option::None,
|
5747 + | struct_with_json_name: ::std::option::Option::None,
|
5748 + | timestamp: ::std::option::Option::None,
|
5749 + | unix_timestamp: ::std::option::Option::None,
|
5750 + | };
|
5751 + | Ok(output)
|
5752 + | };
|
5753 + | sender.send(()).await.expect("receiver dropped early");
|
5754 + | result
|
5755 + | }
|
5756 + | })
|
5757 + | .build_unchecked();
|
5953 5758 | let http_response = ::tower::ServiceExt::oneshot(service, http_request)
|
5954 5759 | .await
|
5955 5760 | .expect("unable to make an HTTP request");
|
5956 5761 | assert!(
|
5957 5762 | receiver.recv().await.is_some(),
|
5958 5763 | "we expected operation handler to be invoked but it was not entered"
|
5959 5764 | );
|
5960 5765 | }
|
5961 5766 |
|
5962 - | /// Serializes timestamp shapes with iso8601 timestampFormat
|
5963 - | /// Test ID: serializes_timestamp_shapes_with_iso8601_timestampformat
|
5767 + | /// Serializes boolean shapes (false)
|
5768 + | /// Test ID: serializes_boolean_shapes_false
|
5964 5769 | #[::tokio::test]
|
5965 5770 | #[::tracing_test::traced_test]
|
5966 - | async fn serializes_timestamp_shapes_with_iso8601_timestampformat_request() {
|
5771 + | async fn serializes_boolean_shapes_false_request() {
|
5967 5772 | #[allow(unused_mut)]
|
5968 - | let mut http_request = http::Request::builder()
|
5773 + | let mut http_request = ::http_1x::Request::builder()
|
5969 5774 | .uri("/")
|
5970 5775 | .method("POST")
|
5971 5776 | .header("Content-Type", "application/x-amz-json-1.1")
|
5972 5777 | .header("X-Amz-Target", "JsonProtocol.KitchenSinkOperation")
|
5973 - | .body(::aws_smithy_http_server::body::Body::from(
|
5974 - | ::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
|
5975 - | "{\"Iso8601Timestamp\":\"2000-01-02T20:34:56Z\"}".as_bytes(),
|
5976 - | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
5778 + | .body(::aws_smithy_http_server::body::boxed(
|
5779 + | ::http_body_util::Full::new(::bytes::Bytes::copy_from_slice(
|
5780 + | &::aws_smithy_protocol_test::decode_body_data(
|
5781 + | "{\"Boolean\":false}".as_bytes(),
|
5782 + | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
5783 + | ),
|
5977 5784 | )),
|
5978 5785 | ))
|
5979 5786 | .unwrap();
|
5980 5787 | #[allow(unused_mut)]
|
5981 5788 | let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
|
5982 5789 | let config = crate::service::JsonProtocolConfig::builder().build();
|
5983 - | let service = crate::service::JsonProtocol::builder::<::hyper::body::Body, _, _, _>(config)
|
5984 - | .kitchen_sink_operation(move |input: crate::input::KitchenSinkOperationInput| {
|
5985 - | let sender = sender.clone();
|
5986 - | async move {
|
5987 - | let result = {
|
5988 - | use ::aws_smithy_protocol_test::FloatEquals;
|
5989 - | let expected = crate::input::KitchenSinkOperationInput {
|
5990 - | iso8601_timestamp: ::std::option::Option::Some(
|
5991 - | ::aws_smithy_types::DateTime::from_fractional_secs(
|
5992 - | 946845296, 0_f64,
|
5993 - | ),
|
5994 - | ),
|
5995 - | blob: ::std::option::Option::None,
|
5996 - | boolean: ::std::option::Option::None,
|
5997 - | double: ::std::option::Option::None,
|
5998 - | empty_struct: ::std::option::Option::None,
|
5999 - | float: ::std::option::Option::None,
|
6000 - | httpdate_timestamp: ::std::option::Option::None,
|
6001 - | integer: ::std::option::Option::None,
|
6002 - | json_value: ::std::option::Option::None,
|
6003 - | list_of_lists: ::std::option::Option::None,
|
6004 - | list_of_maps_of_strings: ::std::option::Option::None,
|
6005 - | list_of_strings: ::std::option::Option::None,
|
6006 - | list_of_structs: ::std::option::Option::None,
|
6007 - | long: ::std::option::Option::None,
|
6008 - | map_of_lists_of_strings: ::std::option::Option::None,
|
6009 - | map_of_maps: ::std::option::Option::None,
|
6010 - | map_of_strings: ::std::option::Option::None,
|
6011 - | map_of_structs: ::std::option::Option::None,
|
6012 - | recursive_list: ::std::option::Option::None,
|
6013 - | recursive_map: ::std::option::Option::None,
|
6014 - | recursive_struct: ::std::option::Option::None,
|
6015 - | simple_struct: ::std::option::Option::None,
|
6016 - | string: ::std::option::Option::None,
|
6017 - | struct_with_json_name: ::std::option::Option::None,
|
6018 - | timestamp: ::std::option::Option::None,
|
6019 - | unix_timestamp: ::std::option::Option::None,
|
6020 - | };
|
6021 - | ::pretty_assertions::assert_eq!(
|
6022 - | input.blob,
|
6023 - | expected.blob,
|
6024 - | "Unexpected value for `blob`"
|
6025 - | );
|
6026 - | ::pretty_assertions::assert_eq!(
|
6027 - | input.boolean,
|
6028 - | expected.boolean,
|
6029 - | "Unexpected value for `boolean`"
|
6030 - | );
|
6031 - | assert!(
|
6032 - | input.double.float_equals(&expected.double),
|
6033 - | "Unexpected value for `double` {:?} vs. {:?}",
|
6034 - | expected.double,
|
6035 - | input.double
|
6036 - | );
|
6037 - | ::pretty_assertions::assert_eq!(
|
6038 - | input.empty_struct,
|
6039 - | expected.empty_struct,
|
6040 - | "Unexpected value for `empty_struct`"
|
6041 - | );
|
6042 - | assert!(
|
6043 - | input.float.float_equals(&expected.float),
|
6044 - | "Unexpected value for `float` {:?} vs. {:?}",
|
6045 - | expected.float,
|
6046 - | input.float
|
6047 - | );
|
6048 - | ::pretty_assertions::assert_eq!(
|
6049 - | input.httpdate_timestamp,
|
6050 - | expected.httpdate_timestamp,
|
6051 - | "Unexpected value for `httpdate_timestamp`"
|
6052 - | );
|
6053 - | ::pretty_assertions::assert_eq!(
|
6054 - | input.integer,
|
6055 - | expected.integer,
|
6056 - | "Unexpected value for `integer`"
|
6057 - | );
|
6058 - | ::pretty_assertions::assert_eq!(
|
6059 - | input.iso8601_timestamp,
|
6060 - | expected.iso8601_timestamp,
|
6061 - | "Unexpected value for `iso8601_timestamp`"
|
6062 - | );
|
6063 - | ::pretty_assertions::assert_eq!(
|
6064 - | input.json_value,
|
6065 - | expected.json_value,
|
6066 - | "Unexpected value for `json_value`"
|
6067 - | );
|
6068 - | ::pretty_assertions::assert_eq!(
|
6069 - | input.list_of_lists,
|
6070 - | expected.list_of_lists,
|
6071 - | "Unexpected value for `list_of_lists`"
|
6072 - | );
|
6073 - | ::pretty_assertions::assert_eq!(
|
6074 - | input.list_of_maps_of_strings,
|
6075 - | expected.list_of_maps_of_strings,
|
6076 - | "Unexpected value for `list_of_maps_of_strings`"
|
6077 - | );
|
6078 - | ::pretty_assertions::assert_eq!(
|
6079 - | input.list_of_strings,
|
6080 - | expected.list_of_strings,
|
6081 - | "Unexpected value for `list_of_strings`"
|
6082 - | );
|
6083 - | ::pretty_assertions::assert_eq!(
|
6084 - | input.list_of_structs,
|
6085 - | expected.list_of_structs,
|
6086 - | "Unexpected value for `list_of_structs`"
|
6087 - | );
|
6088 - | ::pretty_assertions::assert_eq!(
|
6089 - | input.long,
|
6090 - | expected.long,
|
6091 - | "Unexpected value for `long`"
|
6092 - | );
|
6093 - | ::pretty_assertions::assert_eq!(
|
6094 - | input.map_of_lists_of_strings,
|
6095 - | expected.map_of_lists_of_strings,
|
6096 - | "Unexpected value for `map_of_lists_of_strings`"
|
6097 - | );
|
6098 - | ::pretty_assertions::assert_eq!(
|
6099 - | input.map_of_maps,
|
6100 - | expected.map_of_maps,
|
6101 - | "Unexpected value for `map_of_maps`"
|
6102 - | );
|
6103 - | ::pretty_assertions::assert_eq!(
|
6104 - | input.map_of_strings,
|
6105 - | expected.map_of_strings,
|
6106 - | "Unexpected value for `map_of_strings`"
|
6107 - | );
|
6108 - | ::pretty_assertions::assert_eq!(
|
6109 - | input.map_of_structs,
|
6110 - | expected.map_of_structs,
|
6111 - | "Unexpected value for `map_of_structs`"
|
6112 - | );
|
6113 - | ::pretty_assertions::assert_eq!(
|
6114 - | input.recursive_list,
|
6115 - | expected.recursive_list,
|
6116 - | "Unexpected value for `recursive_list`"
|
6117 - | );
|
6118 - | ::pretty_assertions::assert_eq!(
|
6119 - | input.recursive_map,
|
6120 - | expected.recursive_map,
|
6121 - | "Unexpected value for `recursive_map`"
|
6122 - | );
|
6123 - | ::pretty_assertions::assert_eq!(
|
6124 - | input.recursive_struct,
|
6125 - | expected.recursive_struct,
|
6126 - | "Unexpected value for `recursive_struct`"
|
6127 - | );
|
6128 - | ::pretty_assertions::assert_eq!(
|
6129 - | input.simple_struct,
|
6130 - | expected.simple_struct,
|
6131 - | "Unexpected value for `simple_struct`"
|
6132 - | );
|
6133 - | ::pretty_assertions::assert_eq!(
|
6134 - | input.string,
|
6135 - | expected.string,
|
6136 - | "Unexpected value for `string`"
|
6137 - | );
|
6138 - | ::pretty_assertions::assert_eq!(
|
6139 - | input.struct_with_json_name,
|
6140 - | expected.struct_with_json_name,
|
6141 - | "Unexpected value for `struct_with_json_name`"
|
6142 - | );
|
6143 - | ::pretty_assertions::assert_eq!(
|
6144 - | input.timestamp,
|
6145 - | expected.timestamp,
|
6146 - | "Unexpected value for `timestamp`"
|
6147 - | );
|
6148 - | ::pretty_assertions::assert_eq!(
|
6149 - | input.unix_timestamp,
|
6150 - | expected.unix_timestamp,
|
6151 - | "Unexpected value for `unix_timestamp`"
|
6152 - | );
|
6153 - | let output = crate::output::KitchenSinkOperationOutput {
|
6154 - | blob: ::std::option::Option::None,
|
6155 - | boolean: ::std::option::Option::None,
|
6156 - | double: ::std::option::Option::None,
|
6157 - | empty_struct: ::std::option::Option::None,
|
6158 - | float: ::std::option::Option::None,
|
6159 - | httpdate_timestamp: ::std::option::Option::None,
|
6160 - | integer: ::std::option::Option::None,
|
6161 - | iso8601_timestamp: ::std::option::Option::None,
|
6162 - | json_value: ::std::option::Option::None,
|
6163 - | list_of_lists: ::std::option::Option::None,
|
6164 - | list_of_maps_of_strings: ::std::option::Option::None,
|
6165 - | list_of_strings: ::std::option::Option::None,
|
6166 - | list_of_structs: ::std::option::Option::None,
|
6167 - | long: ::std::option::Option::None,
|
6168 - | map_of_lists_of_strings: ::std::option::Option::None,
|
6169 - | map_of_maps: ::std::option::Option::None,
|
6170 - | map_of_strings: ::std::option::Option::None,
|
6171 - | map_of_structs: ::std::option::Option::None,
|
6172 - | recursive_list: ::std::option::Option::None,
|
6173 - | recursive_map: ::std::option::Option::None,
|
6174 - | recursive_struct: ::std::option::Option::None,
|
6175 - | simple_struct: ::std::option::Option::None,
|
6176 - | string: ::std::option::Option::None,
|
6177 - | struct_with_json_name: ::std::option::Option::None,
|
6178 - | timestamp: ::std::option::Option::None,
|
6179 - | unix_timestamp: ::std::option::Option::None,
|
6180 - | };
|
6181 - | Ok(output)
|
5790 + | let service = crate::service::JsonProtocol::builder::<
|
5791 + | ::aws_smithy_http_server::body::BoxBody,
|
5792 + | _,
|
5793 + | _,
|
5794 + | _,
|
5795 + | >(config)
|
5796 + | .kitchen_sink_operation(move |input: crate::input::KitchenSinkOperationInput| {
|
5797 + | let sender = sender.clone();
|
5798 + | async move {
|
5799 + | let result = {
|
5800 + | use ::aws_smithy_protocol_test::FloatEquals;
|
5801 + | let expected = crate::input::KitchenSinkOperationInput {
|
5802 + | boolean: ::std::option::Option::Some(false),
|
5803 + | blob: ::std::option::Option::None,
|
5804 + | double: ::std::option::Option::None,
|
5805 + | empty_struct: ::std::option::Option::None,
|
5806 + | float: ::std::option::Option::None,
|
5807 + | httpdate_timestamp: ::std::option::Option::None,
|
5808 + | integer: ::std::option::Option::None,
|
5809 + | iso8601_timestamp: ::std::option::Option::None,
|
5810 + | json_value: ::std::option::Option::None,
|
5811 + | list_of_lists: ::std::option::Option::None,
|
5812 + | list_of_maps_of_strings: ::std::option::Option::None,
|
5813 + | list_of_strings: ::std::option::Option::None,
|
5814 + | list_of_structs: ::std::option::Option::None,
|
5815 + | long: ::std::option::Option::None,
|
5816 + | map_of_lists_of_strings: ::std::option::Option::None,
|
5817 + | map_of_maps: ::std::option::Option::None,
|
5818 + | map_of_strings: ::std::option::Option::None,
|
5819 + | map_of_structs: ::std::option::Option::None,
|
5820 + | recursive_list: ::std::option::Option::None,
|
5821 + | recursive_map: ::std::option::Option::None,
|
5822 + | recursive_struct: ::std::option::Option::None,
|
5823 + | simple_struct: ::std::option::Option::None,
|
5824 + | string: ::std::option::Option::None,
|
5825 + | struct_with_json_name: ::std::option::Option::None,
|
5826 + | timestamp: ::std::option::Option::None,
|
5827 + | unix_timestamp: ::std::option::Option::None,
|
6182 5828 | };
|
6183 - | sender.send(()).await.expect("receiver dropped early");
|
6184 - | result
|
6185 - | }
|
6186 - | })
|
6187 - | .build_unchecked();
|
5829 + | ::pretty_assertions::assert_eq!(
|
5830 + | input.blob,
|
5831 + | expected.blob,
|
5832 + | "Unexpected value for `blob`"
|
5833 + | );
|
5834 + | ::pretty_assertions::assert_eq!(
|
5835 + | input.boolean,
|
5836 + | expected.boolean,
|
5837 + | "Unexpected value for `boolean`"
|
5838 + | );
|
5839 + | assert!(
|
5840 + | input.double.float_equals(&expected.double),
|
5841 + | "Unexpected value for `double` {:?} vs. {:?}",
|
5842 + | expected.double,
|
5843 + | input.double
|
5844 + | );
|
5845 + | ::pretty_assertions::assert_eq!(
|
5846 + | input.empty_struct,
|
5847 + | expected.empty_struct,
|
5848 + | "Unexpected value for `empty_struct`"
|
5849 + | );
|
5850 + | assert!(
|
5851 + | input.float.float_equals(&expected.float),
|
5852 + | "Unexpected value for `float` {:?} vs. {:?}",
|
5853 + | expected.float,
|
5854 + | input.float
|
5855 + | );
|
5856 + | ::pretty_assertions::assert_eq!(
|
5857 + | input.httpdate_timestamp,
|
5858 + | expected.httpdate_timestamp,
|
5859 + | "Unexpected value for `httpdate_timestamp`"
|
5860 + | );
|
5861 + | ::pretty_assertions::assert_eq!(
|
5862 + | input.integer,
|
5863 + | expected.integer,
|
5864 + | "Unexpected value for `integer`"
|
5865 + | );
|
5866 + | ::pretty_assertions::assert_eq!(
|
5867 + | input.iso8601_timestamp,
|
5868 + | expected.iso8601_timestamp,
|
5869 + | "Unexpected value for `iso8601_timestamp`"
|
5870 + | );
|
5871 + | ::pretty_assertions::assert_eq!(
|
5872 + | input.json_value,
|
5873 + | expected.json_value,
|
5874 + | "Unexpected value for `json_value`"
|
5875 + | );
|
5876 + | ::pretty_assertions::assert_eq!(
|
5877 + | input.list_of_lists,
|
5878 + | expected.list_of_lists,
|
5879 + | "Unexpected value for `list_of_lists`"
|
5880 + | );
|
5881 + | ::pretty_assertions::assert_eq!(
|
5882 + | input.list_of_maps_of_strings,
|
5883 + | expected.list_of_maps_of_strings,
|
5884 + | "Unexpected value for `list_of_maps_of_strings`"
|
5885 + | );
|
5886 + | ::pretty_assertions::assert_eq!(
|
5887 + | input.list_of_strings,
|
5888 + | expected.list_of_strings,
|
5889 + | "Unexpected value for `list_of_strings`"
|
5890 + | );
|
5891 + | ::pretty_assertions::assert_eq!(
|
5892 + | input.list_of_structs,
|
5893 + | expected.list_of_structs,
|
5894 + | "Unexpected value for `list_of_structs`"
|
5895 + | );
|
5896 + | ::pretty_assertions::assert_eq!(
|
5897 + | input.long,
|
5898 + | expected.long,
|
5899 + | "Unexpected value for `long`"
|
5900 + | );
|
5901 + | ::pretty_assertions::assert_eq!(
|
5902 + | input.map_of_lists_of_strings,
|
5903 + | expected.map_of_lists_of_strings,
|
5904 + | "Unexpected value for `map_of_lists_of_strings`"
|
5905 + | );
|
5906 + | ::pretty_assertions::assert_eq!(
|
5907 + | input.map_of_maps,
|
5908 + | expected.map_of_maps,
|
5909 + | "Unexpected value for `map_of_maps`"
|
5910 + | );
|
5911 + | ::pretty_assertions::assert_eq!(
|
5912 + | input.map_of_strings,
|
5913 + | expected.map_of_strings,
|
5914 + | "Unexpected value for `map_of_strings`"
|
5915 + | );
|
5916 + | ::pretty_assertions::assert_eq!(
|
5917 + | input.map_of_structs,
|
5918 + | expected.map_of_structs,
|
5919 + | "Unexpected value for `map_of_structs`"
|
5920 + | );
|
5921 + | ::pretty_assertions::assert_eq!(
|
5922 + | input.recursive_list,
|
5923 + | expected.recursive_list,
|
5924 + | "Unexpected value for `recursive_list`"
|
5925 + | );
|
5926 + | ::pretty_assertions::assert_eq!(
|
5927 + | input.recursive_map,
|
5928 + | expected.recursive_map,
|
5929 + | "Unexpected value for `recursive_map`"
|
5930 + | );
|
5931 + | ::pretty_assertions::assert_eq!(
|
5932 + | input.recursive_struct,
|
5933 + | expected.recursive_struct,
|
5934 + | "Unexpected value for `recursive_struct`"
|
5935 + | );
|
5936 + | ::pretty_assertions::assert_eq!(
|
5937 + | input.simple_struct,
|
5938 + | expected.simple_struct,
|
5939 + | "Unexpected value for `simple_struct`"
|
5940 + | );
|
5941 + | ::pretty_assertions::assert_eq!(
|
5942 + | input.string,
|
5943 + | expected.string,
|
5944 + | "Unexpected value for `string`"
|
5945 + | );
|
5946 + | ::pretty_assertions::assert_eq!(
|
5947 + | input.struct_with_json_name,
|
5948 + | expected.struct_with_json_name,
|
5949 + | "Unexpected value for `struct_with_json_name`"
|
5950 + | );
|
5951 + | ::pretty_assertions::assert_eq!(
|
5952 + | input.timestamp,
|
5953 + | expected.timestamp,
|
5954 + | "Unexpected value for `timestamp`"
|
5955 + | );
|
5956 + | ::pretty_assertions::assert_eq!(
|
5957 + | input.unix_timestamp,
|
5958 + | expected.unix_timestamp,
|
5959 + | "Unexpected value for `unix_timestamp`"
|
5960 + | );
|
5961 + | let output = crate::output::KitchenSinkOperationOutput {
|
5962 + | blob: ::std::option::Option::None,
|
5963 + | boolean: ::std::option::Option::None,
|
5964 + | double: ::std::option::Option::None,
|
5965 + | empty_struct: ::std::option::Option::None,
|
5966 + | float: ::std::option::Option::None,
|
5967 + | httpdate_timestamp: ::std::option::Option::None,
|
5968 + | integer: ::std::option::Option::None,
|
5969 + | iso8601_timestamp: ::std::option::Option::None,
|
5970 + | json_value: ::std::option::Option::None,
|
5971 + | list_of_lists: ::std::option::Option::None,
|
5972 + | list_of_maps_of_strings: ::std::option::Option::None,
|
5973 + | list_of_strings: ::std::option::Option::None,
|
5974 + | list_of_structs: ::std::option::Option::None,
|
5975 + | long: ::std::option::Option::None,
|
5976 + | map_of_lists_of_strings: ::std::option::Option::None,
|
5977 + | map_of_maps: ::std::option::Option::None,
|
5978 + | map_of_strings: ::std::option::Option::None,
|
5979 + | map_of_structs: ::std::option::Option::None,
|
5980 + | recursive_list: ::std::option::Option::None,
|
5981 + | recursive_map: ::std::option::Option::None,
|
5982 + | recursive_struct: ::std::option::Option::None,
|
5983 + | simple_struct: ::std::option::Option::None,
|
5984 + | string: ::std::option::Option::None,
|
5985 + | struct_with_json_name: ::std::option::Option::None,
|
5986 + | timestamp: ::std::option::Option::None,
|
5987 + | unix_timestamp: ::std::option::Option::None,
|
5988 + | };
|
5989 + | Ok(output)
|
5990 + | };
|
5991 + | sender.send(()).await.expect("receiver dropped early");
|
5992 + | result
|
5993 + | }
|
5994 + | })
|
5995 + | .build_unchecked();
|
6188 5996 | let http_response = ::tower::ServiceExt::oneshot(service, http_request)
|
6189 5997 | .await
|
6190 5998 | .expect("unable to make an HTTP request");
|
6191 5999 | assert!(
|
6192 6000 | receiver.recv().await.is_some(),
|
6193 6001 | "we expected operation handler to be invoked but it was not entered"
|
6194 6002 | );
|
6195 6003 | }
|
6196 6004 |
|
6197 - | /// Serializes timestamp shapes with httpdate timestampFormat
|
6198 - | /// Test ID: serializes_timestamp_shapes_with_httpdate_timestampformat
|
6005 + | /// Serializes timestamp shapes
|
6006 + | /// Test ID: serializes_timestamp_shapes
|
6199 6007 | #[::tokio::test]
|
6200 6008 | #[::tracing_test::traced_test]
|
6201 - | async fn serializes_timestamp_shapes_with_httpdate_timestampformat_request() {
|
6009 + | async fn serializes_timestamp_shapes_request() {
|
6202 6010 | #[allow(unused_mut)]
|
6203 - | let mut http_request = http::Request::builder()
|
6011 + | let mut http_request = ::http_1x::Request::builder()
|
6204 6012 | .uri("/")
|
6205 6013 | .method("POST")
|
6206 6014 | .header("Content-Type", "application/x-amz-json-1.1")
|
6207 6015 | .header("X-Amz-Target", "JsonProtocol.KitchenSinkOperation")
|
6208 - | .body(::aws_smithy_http_server::body::Body::from(
|
6209 - | ::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
|
6210 - | "{\"HttpdateTimestamp\":\"Sun, 02 Jan 2000 20:34:56 GMT\"}".as_bytes(),
|
6211 - | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
6016 + | .body(::aws_smithy_http_server::body::boxed(
|
6017 + | ::http_body_util::Full::new(::bytes::Bytes::copy_from_slice(
|
6018 + | &::aws_smithy_protocol_test::decode_body_data(
|
6019 + | "{\"Timestamp\":946845296}".as_bytes(),
|
6020 + | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
6021 + | ),
|
6212 6022 | )),
|
6213 6023 | ))
|
6214 6024 | .unwrap();
|
6215 6025 | #[allow(unused_mut)]
|
6216 6026 | let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
|
6217 6027 | let config = crate::service::JsonProtocolConfig::builder().build();
|
6218 - | let service = crate::service::JsonProtocol::builder::<::hyper::body::Body, _, _, _>(config)
|
6219 - | .kitchen_sink_operation(move |input: crate::input::KitchenSinkOperationInput| {
|
6220 - | let sender = sender.clone();
|
6221 - | async move {
|
6222 - | let result = {
|
6223 - | use ::aws_smithy_protocol_test::FloatEquals;
|
6224 - | let expected = crate::input::KitchenSinkOperationInput {
|
6225 - | httpdate_timestamp: ::std::option::Option::Some(
|
6226 - | ::aws_smithy_types::DateTime::from_fractional_secs(
|
6227 - | 946845296, 0_f64,
|
6228 - | ),
|
6229 - | ),
|
6230 - | blob: ::std::option::Option::None,
|
6231 - | boolean: ::std::option::Option::None,
|
6232 - | double: ::std::option::Option::None,
|
6233 - | empty_struct: ::std::option::Option::None,
|
6234 - | float: ::std::option::Option::None,
|
6235 - | integer: ::std::option::Option::None,
|
6236 - | iso8601_timestamp: ::std::option::Option::None,
|
6237 - | json_value: ::std::option::Option::None,
|
6238 - | list_of_lists: ::std::option::Option::None,
|
6239 - | list_of_maps_of_strings: ::std::option::Option::None,
|
6240 - | list_of_strings: ::std::option::Option::None,
|
6241 - | list_of_structs: ::std::option::Option::None,
|
6242 - | long: ::std::option::Option::None,
|
6243 - | map_of_lists_of_strings: ::std::option::Option::None,
|
6244 - | map_of_maps: ::std::option::Option::None,
|
6245 - | map_of_strings: ::std::option::Option::None,
|
6246 - | map_of_structs: ::std::option::Option::None,
|
6247 - | recursive_list: ::std::option::Option::None,
|
6248 - | recursive_map: ::std::option::Option::None,
|
6249 - | recursive_struct: ::std::option::Option::None,
|
6250 - | simple_struct: ::std::option::Option::None,
|
6251 - | string: ::std::option::Option::None,
|
6252 - | struct_with_json_name: ::std::option::Option::None,
|
6253 - | timestamp: ::std::option::Option::None,
|
6254 - | unix_timestamp: ::std::option::Option::None,
|
6255 - | };
|
6256 - | ::pretty_assertions::assert_eq!(
|
6257 - | input.blob,
|
6258 - | expected.blob,
|
6259 - | "Unexpected value for `blob`"
|
6260 - | );
|
6261 - | ::pretty_assertions::assert_eq!(
|
6262 - | input.boolean,
|
6263 - | expected.boolean,
|
6264 - | "Unexpected value for `boolean`"
|
6265 - | );
|
6266 - | assert!(
|
6267 - | input.double.float_equals(&expected.double),
|
6268 - | "Unexpected value for `double` {:?} vs. {:?}",
|
6269 - | expected.double,
|
6270 - | input.double
|
6271 - | );
|
6272 - | ::pretty_assertions::assert_eq!(
|
6273 - | input.empty_struct,
|
6274 - | expected.empty_struct,
|
6275 - | "Unexpected value for `empty_struct`"
|
6276 - | );
|
6277 - | assert!(
|
6278 - | input.float.float_equals(&expected.float),
|
6279 - | "Unexpected value for `float` {:?} vs. {:?}",
|
6280 - | expected.float,
|
6281 - | input.float
|
6282 - | );
|
6283 - | ::pretty_assertions::assert_eq!(
|
6284 - | input.httpdate_timestamp,
|
6285 - | expected.httpdate_timestamp,
|
6286 - | "Unexpected value for `httpdate_timestamp`"
|
6287 - | );
|
6288 - | ::pretty_assertions::assert_eq!(
|
6289 - | input.integer,
|
6290 - | expected.integer,
|
6291 - | "Unexpected value for `integer`"
|
6292 - | );
|
6293 - | ::pretty_assertions::assert_eq!(
|
6294 - | input.iso8601_timestamp,
|
6295 - | expected.iso8601_timestamp,
|
6296 - | "Unexpected value for `iso8601_timestamp`"
|
6297 - | );
|
6298 - | ::pretty_assertions::assert_eq!(
|
6299 - | input.json_value,
|
6300 - | expected.json_value,
|
6301 - | "Unexpected value for `json_value`"
|
6302 - | );
|
6303 - | ::pretty_assertions::assert_eq!(
|
6304 - | input.list_of_lists,
|
6305 - | expected.list_of_lists,
|
6306 - | "Unexpected value for `list_of_lists`"
|
6307 - | );
|
6308 - | ::pretty_assertions::assert_eq!(
|
6309 - | input.list_of_maps_of_strings,
|
6310 - | expected.list_of_maps_of_strings,
|
6311 - | "Unexpected value for `list_of_maps_of_strings`"
|
6312 - | );
|
6313 - | ::pretty_assertions::assert_eq!(
|
6314 - | input.list_of_strings,
|
6315 - | expected.list_of_strings,
|
6316 - | "Unexpected value for `list_of_strings`"
|
6317 - | );
|
6318 - | ::pretty_assertions::assert_eq!(
|
6319 - | input.list_of_structs,
|
6320 - | expected.list_of_structs,
|
6321 - | "Unexpected value for `list_of_structs`"
|
6322 - | );
|
6323 - | ::pretty_assertions::assert_eq!(
|
6324 - | input.long,
|
6325 - | expected.long,
|
6326 - | "Unexpected value for `long`"
|
6327 - | );
|
6328 - | ::pretty_assertions::assert_eq!(
|
6329 - | input.map_of_lists_of_strings,
|
6330 - | expected.map_of_lists_of_strings,
|
6331 - | "Unexpected value for `map_of_lists_of_strings`"
|
6332 - | );
|
6333 - | ::pretty_assertions::assert_eq!(
|
6334 - | input.map_of_maps,
|
6335 - | expected.map_of_maps,
|
6336 - | "Unexpected value for `map_of_maps`"
|
6337 - | );
|
6338 - | ::pretty_assertions::assert_eq!(
|
6339 - | input.map_of_strings,
|
6340 - | expected.map_of_strings,
|
6341 - | "Unexpected value for `map_of_strings`"
|
6342 - | );
|
6343 - | ::pretty_assertions::assert_eq!(
|
6344 - | input.map_of_structs,
|
6345 - | expected.map_of_structs,
|
6346 - | "Unexpected value for `map_of_structs`"
|
6347 - | );
|
6348 - | ::pretty_assertions::assert_eq!(
|
6349 - | input.recursive_list,
|
6350 - | expected.recursive_list,
|
6351 - | "Unexpected value for `recursive_list`"
|
6352 - | );
|
6353 - | ::pretty_assertions::assert_eq!(
|
6354 - | input.recursive_map,
|
6355 - | expected.recursive_map,
|
6356 - | "Unexpected value for `recursive_map`"
|
6357 - | );
|
6358 - | ::pretty_assertions::assert_eq!(
|
6359 - | input.recursive_struct,
|
6360 - | expected.recursive_struct,
|
6361 - | "Unexpected value for `recursive_struct`"
|
6362 - | );
|
6363 - | ::pretty_assertions::assert_eq!(
|
6364 - | input.simple_struct,
|
6365 - | expected.simple_struct,
|
6366 - | "Unexpected value for `simple_struct`"
|
6367 - | );
|
6368 - | ::pretty_assertions::assert_eq!(
|
6369 - | input.string,
|
6370 - | expected.string,
|
6371 - | "Unexpected value for `string`"
|
6372 - | );
|
6373 - | ::pretty_assertions::assert_eq!(
|
6374 - | input.struct_with_json_name,
|
6375 - | expected.struct_with_json_name,
|
6376 - | "Unexpected value for `struct_with_json_name`"
|
6377 - | );
|
6378 - | ::pretty_assertions::assert_eq!(
|
6379 - | input.timestamp,
|
6380 - | expected.timestamp,
|
6381 - | "Unexpected value for `timestamp`"
|
6382 - | );
|
6383 - | ::pretty_assertions::assert_eq!(
|
6384 - | input.unix_timestamp,
|
6385 - | expected.unix_timestamp,
|
6386 - | "Unexpected value for `unix_timestamp`"
|
6387 - | );
|
6388 - | let output = crate::output::KitchenSinkOperationOutput {
|
6389 - | blob: ::std::option::Option::None,
|
6390 - | boolean: ::std::option::Option::None,
|
6391 - | double: ::std::option::Option::None,
|
6392 - | empty_struct: ::std::option::Option::None,
|
6393 - | float: ::std::option::Option::None,
|
6394 - | httpdate_timestamp: ::std::option::Option::None,
|
6395 - | integer: ::std::option::Option::None,
|
6396 - | iso8601_timestamp: ::std::option::Option::None,
|
6397 - | json_value: ::std::option::Option::None,
|
6398 - | list_of_lists: ::std::option::Option::None,
|
6399 - | list_of_maps_of_strings: ::std::option::Option::None,
|
6400 - | list_of_strings: ::std::option::Option::None,
|
6401 - | list_of_structs: ::std::option::Option::None,
|
6402 - | long: ::std::option::Option::None,
|
6403 - | map_of_lists_of_strings: ::std::option::Option::None,
|
6404 - | map_of_maps: ::std::option::Option::None,
|
6405 - | map_of_strings: ::std::option::Option::None,
|
6406 - | map_of_structs: ::std::option::Option::None,
|
6407 - | recursive_list: ::std::option::Option::None,
|
6408 - | recursive_map: ::std::option::Option::None,
|
6409 - | recursive_struct: ::std::option::Option::None,
|
6410 - | simple_struct: ::std::option::Option::None,
|
6411 - | string: ::std::option::Option::None,
|
6412 - | struct_with_json_name: ::std::option::Option::None,
|
6413 - | timestamp: ::std::option::Option::None,
|
6414 - | unix_timestamp: ::std::option::Option::None,
|
6415 - | };
|
6416 - | Ok(output)
|
6028 + | let service = crate::service::JsonProtocol::builder::<
|
6029 + | ::aws_smithy_http_server::body::BoxBody,
|
6030 + | _,
|
6031 + | _,
|
6032 + | _,
|
6033 + | >(config)
|
6034 + | .kitchen_sink_operation(move |input: crate::input::KitchenSinkOperationInput| {
|
6035 + | let sender = sender.clone();
|
6036 + | async move {
|
6037 + | let result = {
|
6038 + | use ::aws_smithy_protocol_test::FloatEquals;
|
6039 + | let expected = crate::input::KitchenSinkOperationInput {
|
6040 + | timestamp: ::std::option::Option::Some(
|
6041 + | ::aws_smithy_types::DateTime::from_fractional_secs(946845296, 0_f64),
|
6042 + | ),
|
6043 + | blob: ::std::option::Option::None,
|
6044 + | boolean: ::std::option::Option::None,
|
6045 + | double: ::std::option::Option::None,
|
6046 + | empty_struct: ::std::option::Option::None,
|
6047 + | float: ::std::option::Option::None,
|
6048 + | httpdate_timestamp: ::std::option::Option::None,
|
6049 + | integer: ::std::option::Option::None,
|
6050 + | iso8601_timestamp: ::std::option::Option::None,
|
6051 + | json_value: ::std::option::Option::None,
|
6052 + | list_of_lists: ::std::option::Option::None,
|
6053 + | list_of_maps_of_strings: ::std::option::Option::None,
|
6054 + | list_of_strings: ::std::option::Option::None,
|
6055 + | list_of_structs: ::std::option::Option::None,
|
6056 + | long: ::std::option::Option::None,
|
6057 + | map_of_lists_of_strings: ::std::option::Option::None,
|
6058 + | map_of_maps: ::std::option::Option::None,
|
6059 + | map_of_strings: ::std::option::Option::None,
|
6060 + | map_of_structs: ::std::option::Option::None,
|
6061 + | recursive_list: ::std::option::Option::None,
|
6062 + | recursive_map: ::std::option::Option::None,
|
6063 + | recursive_struct: ::std::option::Option::None,
|
6064 + | simple_struct: ::std::option::Option::None,
|
6065 + | string: ::std::option::Option::None,
|
6066 + | struct_with_json_name: ::std::option::Option::None,
|
6067 + | unix_timestamp: ::std::option::Option::None,
|
6417 6068 | };
|
6418 - | sender.send(()).await.expect("receiver dropped early");
|
6419 - | result
|
6420 - | }
|
6421 - | })
|
6422 - | .build_unchecked();
|
6069 + | ::pretty_assertions::assert_eq!(
|
6070 + | input.blob,
|
6071 + | expected.blob,
|
6072 + | "Unexpected value for `blob`"
|
6073 + | );
|
6074 + | ::pretty_assertions::assert_eq!(
|
6075 + | input.boolean,
|
6076 + | expected.boolean,
|
6077 + | "Unexpected value for `boolean`"
|
6078 + | );
|
6079 + | assert!(
|
6080 + | input.double.float_equals(&expected.double),
|
6081 + | "Unexpected value for `double` {:?} vs. {:?}",
|
6082 + | expected.double,
|
6083 + | input.double
|
6084 + | );
|
6085 + | ::pretty_assertions::assert_eq!(
|
6086 + | input.empty_struct,
|
6087 + | expected.empty_struct,
|
6088 + | "Unexpected value for `empty_struct`"
|
6089 + | );
|
6090 + | assert!(
|
6091 + | input.float.float_equals(&expected.float),
|
6092 + | "Unexpected value for `float` {:?} vs. {:?}",
|
6093 + | expected.float,
|
6094 + | input.float
|
6095 + | );
|
6096 + | ::pretty_assertions::assert_eq!(
|
6097 + | input.httpdate_timestamp,
|
6098 + | expected.httpdate_timestamp,
|
6099 + | "Unexpected value for `httpdate_timestamp`"
|
6100 + | );
|
6101 + | ::pretty_assertions::assert_eq!(
|
6102 + | input.integer,
|
6103 + | expected.integer,
|
6104 + | "Unexpected value for `integer`"
|
6105 + | );
|
6106 + | ::pretty_assertions::assert_eq!(
|
6107 + | input.iso8601_timestamp,
|
6108 + | expected.iso8601_timestamp,
|
6109 + | "Unexpected value for `iso8601_timestamp`"
|
6110 + | );
|
6111 + | ::pretty_assertions::assert_eq!(
|
6112 + | input.json_value,
|
6113 + | expected.json_value,
|
6114 + | "Unexpected value for `json_value`"
|
6115 + | );
|
6116 + | ::pretty_assertions::assert_eq!(
|
6117 + | input.list_of_lists,
|
6118 + | expected.list_of_lists,
|
6119 + | "Unexpected value for `list_of_lists`"
|
6120 + | );
|
6121 + | ::pretty_assertions::assert_eq!(
|
6122 + | input.list_of_maps_of_strings,
|
6123 + | expected.list_of_maps_of_strings,
|
6124 + | "Unexpected value for `list_of_maps_of_strings`"
|
6125 + | );
|
6126 + | ::pretty_assertions::assert_eq!(
|
6127 + | input.list_of_strings,
|
6128 + | expected.list_of_strings,
|
6129 + | "Unexpected value for `list_of_strings`"
|
6130 + | );
|
6131 + | ::pretty_assertions::assert_eq!(
|
6132 + | input.list_of_structs,
|
6133 + | expected.list_of_structs,
|
6134 + | "Unexpected value for `list_of_structs`"
|
6135 + | );
|
6136 + | ::pretty_assertions::assert_eq!(
|
6137 + | input.long,
|
6138 + | expected.long,
|
6139 + | "Unexpected value for `long`"
|
6140 + | );
|
6141 + | ::pretty_assertions::assert_eq!(
|
6142 + | input.map_of_lists_of_strings,
|
6143 + | expected.map_of_lists_of_strings,
|
6144 + | "Unexpected value for `map_of_lists_of_strings`"
|
6145 + | );
|
6146 + | ::pretty_assertions::assert_eq!(
|
6147 + | input.map_of_maps,
|
6148 + | expected.map_of_maps,
|
6149 + | "Unexpected value for `map_of_maps`"
|
6150 + | );
|
6151 + | ::pretty_assertions::assert_eq!(
|
6152 + | input.map_of_strings,
|
6153 + | expected.map_of_strings,
|
6154 + | "Unexpected value for `map_of_strings`"
|
6155 + | );
|
6156 + | ::pretty_assertions::assert_eq!(
|
6157 + | input.map_of_structs,
|
6158 + | expected.map_of_structs,
|
6159 + | "Unexpected value for `map_of_structs`"
|
6160 + | );
|
6161 + | ::pretty_assertions::assert_eq!(
|
6162 + | input.recursive_list,
|
6163 + | expected.recursive_list,
|
6164 + | "Unexpected value for `recursive_list`"
|
6165 + | );
|
6166 + | ::pretty_assertions::assert_eq!(
|
6167 + | input.recursive_map,
|
6168 + | expected.recursive_map,
|
6169 + | "Unexpected value for `recursive_map`"
|
6170 + | );
|
6171 + | ::pretty_assertions::assert_eq!(
|
6172 + | input.recursive_struct,
|
6173 + | expected.recursive_struct,
|
6174 + | "Unexpected value for `recursive_struct`"
|
6175 + | );
|
6176 + | ::pretty_assertions::assert_eq!(
|
6177 + | input.simple_struct,
|
6178 + | expected.simple_struct,
|
6179 + | "Unexpected value for `simple_struct`"
|
6180 + | );
|
6181 + | ::pretty_assertions::assert_eq!(
|
6182 + | input.string,
|
6183 + | expected.string,
|
6184 + | "Unexpected value for `string`"
|
6185 + | );
|
6186 + | ::pretty_assertions::assert_eq!(
|
6187 + | input.struct_with_json_name,
|
6188 + | expected.struct_with_json_name,
|
6189 + | "Unexpected value for `struct_with_json_name`"
|
6190 + | );
|
6191 + | ::pretty_assertions::assert_eq!(
|
6192 + | input.timestamp,
|
6193 + | expected.timestamp,
|
6194 + | "Unexpected value for `timestamp`"
|
6195 + | );
|
6196 + | ::pretty_assertions::assert_eq!(
|
6197 + | input.unix_timestamp,
|
6198 + | expected.unix_timestamp,
|
6199 + | "Unexpected value for `unix_timestamp`"
|
6200 + | );
|
6201 + | let output = crate::output::KitchenSinkOperationOutput {
|
6202 + | blob: ::std::option::Option::None,
|
6203 + | boolean: ::std::option::Option::None,
|
6204 + | double: ::std::option::Option::None,
|
6205 + | empty_struct: ::std::option::Option::None,
|
6206 + | float: ::std::option::Option::None,
|
6207 + | httpdate_timestamp: ::std::option::Option::None,
|
6208 + | integer: ::std::option::Option::None,
|
6209 + | iso8601_timestamp: ::std::option::Option::None,
|
6210 + | json_value: ::std::option::Option::None,
|
6211 + | list_of_lists: ::std::option::Option::None,
|
6212 + | list_of_maps_of_strings: ::std::option::Option::None,
|
6213 + | list_of_strings: ::std::option::Option::None,
|
6214 + | list_of_structs: ::std::option::Option::None,
|
6215 + | long: ::std::option::Option::None,
|
6216 + | map_of_lists_of_strings: ::std::option::Option::None,
|
6217 + | map_of_maps: ::std::option::Option::None,
|
6218 + | map_of_strings: ::std::option::Option::None,
|
6219 + | map_of_structs: ::std::option::Option::None,
|
6220 + | recursive_list: ::std::option::Option::None,
|
6221 + | recursive_map: ::std::option::Option::None,
|
6222 + | recursive_struct: ::std::option::Option::None,
|
6223 + | simple_struct: ::std::option::Option::None,
|
6224 + | string: ::std::option::Option::None,
|
6225 + | struct_with_json_name: ::std::option::Option::None,
|
6226 + | timestamp: ::std::option::Option::None,
|
6227 + | unix_timestamp: ::std::option::Option::None,
|
6228 + | };
|
6229 + | Ok(output)
|
6230 + | };
|
6231 + | sender.send(()).await.expect("receiver dropped early");
|
6232 + | result
|
6233 + | }
|
6234 + | })
|
6235 + | .build_unchecked();
|
6423 6236 | let http_response = ::tower::ServiceExt::oneshot(service, http_request)
|
6424 6237 | .await
|
6425 6238 | .expect("unable to make an HTTP request");
|
6426 6239 | assert!(
|
6427 6240 | receiver.recv().await.is_some(),
|
6428 6241 | "we expected operation handler to be invoked but it was not entered"
|
6429 6242 | );
|
6430 6243 | }
|
6431 6244 |
|
6432 - | /// Serializes timestamp shapes with unixTimestamp timestampFormat
|
6433 - | /// Test ID: serializes_timestamp_shapes_with_unixtimestamp_timestampformat
|
6245 + | /// Serializes timestamp shapes with iso8601 timestampFormat
|
6246 + | /// Test ID: serializes_timestamp_shapes_with_iso8601_timestampformat
|
6434 6247 | #[::tokio::test]
|
6435 6248 | #[::tracing_test::traced_test]
|
6436 - | async fn serializes_timestamp_shapes_with_unixtimestamp_timestampformat_request() {
|
6249 + | async fn serializes_timestamp_shapes_with_iso8601_timestampformat_request() {
|
6437 6250 | #[allow(unused_mut)]
|
6438 - | let mut http_request = http::Request::builder()
|
6251 + | let mut http_request = ::http_1x::Request::builder()
|
6439 6252 | .uri("/")
|
6440 6253 | .method("POST")
|
6441 6254 | .header("Content-Type", "application/x-amz-json-1.1")
|
6442 6255 | .header("X-Amz-Target", "JsonProtocol.KitchenSinkOperation")
|
6443 - | .body(::aws_smithy_http_server::body::Body::from(
|
6444 - | ::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
|
6445 - | "{\"UnixTimestamp\":946845296}".as_bytes(),
|
6446 - | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
6256 + | .body(::aws_smithy_http_server::body::boxed(
|
6257 + | ::http_body_util::Full::new(::bytes::Bytes::copy_from_slice(
|
6258 + | &::aws_smithy_protocol_test::decode_body_data(
|
6259 + | "{\"Iso8601Timestamp\":\"2000-01-02T20:34:56Z\"}".as_bytes(),
|
6260 + | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
6261 + | ),
|
6447 6262 | )),
|
6448 6263 | ))
|
6449 6264 | .unwrap();
|
6450 6265 | #[allow(unused_mut)]
|
6451 6266 | let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
|
6452 6267 | let config = crate::service::JsonProtocolConfig::builder().build();
|
6453 - | let service = crate::service::JsonProtocol::builder::<::hyper::body::Body, _, _, _>(config)
|
6454 - | .kitchen_sink_operation(move |input: crate::input::KitchenSinkOperationInput| {
|
6455 - | let sender = sender.clone();
|
6456 - | async move {
|
6457 - | let result = {
|
6458 - | use ::aws_smithy_protocol_test::FloatEquals;
|
6459 - | let expected = crate::input::KitchenSinkOperationInput {
|
6460 - | unix_timestamp: ::std::option::Option::Some(
|
6461 - | ::aws_smithy_types::DateTime::from_fractional_secs(
|
6462 - | 946845296, 0_f64,
|
6463 - | ),
|
6464 - | ),
|
6465 - | blob: ::std::option::Option::None,
|
6466 - | boolean: ::std::option::Option::None,
|
6467 - | double: ::std::option::Option::None,
|
6468 - | empty_struct: ::std::option::Option::None,
|
6469 - | float: ::std::option::Option::None,
|
6470 - | httpdate_timestamp: ::std::option::Option::None,
|
6471 - | integer: ::std::option::Option::None,
|
6472 - | iso8601_timestamp: ::std::option::Option::None,
|
6473 - | json_value: ::std::option::Option::None,
|
6474 - | list_of_lists: ::std::option::Option::None,
|
6475 - | list_of_maps_of_strings: ::std::option::Option::None,
|
6476 - | list_of_strings: ::std::option::Option::None,
|
6477 - | list_of_structs: ::std::option::Option::None,
|
6478 - | long: ::std::option::Option::None,
|
6479 - | map_of_lists_of_strings: ::std::option::Option::None,
|
6480 - | map_of_maps: ::std::option::Option::None,
|
6481 - | map_of_strings: ::std::option::Option::None,
|
6482 - | map_of_structs: ::std::option::Option::None,
|
6483 - | recursive_list: ::std::option::Option::None,
|
6484 - | recursive_map: ::std::option::Option::None,
|
6485 - | recursive_struct: ::std::option::Option::None,
|
6486 - | simple_struct: ::std::option::Option::None,
|
6487 - | string: ::std::option::Option::None,
|
6488 - | struct_with_json_name: ::std::option::Option::None,
|
6489 - | timestamp: ::std::option::Option::None,
|
6490 - | };
|
6491 - | ::pretty_assertions::assert_eq!(
|
6492 - | input.blob,
|
6493 - | expected.blob,
|
6494 - | "Unexpected value for `blob`"
|
6495 - | );
|
6496 - | ::pretty_assertions::assert_eq!(
|
6497 - | input.boolean,
|
6498 - | expected.boolean,
|
6499 - | "Unexpected value for `boolean`"
|
6500 - | );
|
6501 - | assert!(
|
6502 - | input.double.float_equals(&expected.double),
|
6503 - | "Unexpected value for `double` {:?} vs. {:?}",
|
6504 - | expected.double,
|
6505 - | input.double
|
6506 - | );
|
6507 - | ::pretty_assertions::assert_eq!(
|
6508 - | input.empty_struct,
|
6509 - | expected.empty_struct,
|
6510 - | "Unexpected value for `empty_struct`"
|
6511 - | );
|
6512 - | assert!(
|
6513 - | input.float.float_equals(&expected.float),
|
6514 - | "Unexpected value for `float` {:?} vs. {:?}",
|
6515 - | expected.float,
|
6516 - | input.float
|
6517 - | );
|
6518 - | ::pretty_assertions::assert_eq!(
|
6519 - | input.httpdate_timestamp,
|
6520 - | expected.httpdate_timestamp,
|
6521 - | "Unexpected value for `httpdate_timestamp`"
|
6522 - | );
|
6523 - | ::pretty_assertions::assert_eq!(
|
6524 - | input.integer,
|
6525 - | expected.integer,
|
6526 - | "Unexpected value for `integer`"
|
6527 - | );
|
6528 - | ::pretty_assertions::assert_eq!(
|
6529 - | input.iso8601_timestamp,
|
6530 - | expected.iso8601_timestamp,
|
6531 - | "Unexpected value for `iso8601_timestamp`"
|
6532 - | );
|
6533 - | ::pretty_assertions::assert_eq!(
|
6534 - | input.json_value,
|
6535 - | expected.json_value,
|
6536 - | "Unexpected value for `json_value`"
|
6537 - | );
|
6538 - | ::pretty_assertions::assert_eq!(
|
6539 - | input.list_of_lists,
|
6540 - | expected.list_of_lists,
|
6541 - | "Unexpected value for `list_of_lists`"
|
6542 - | );
|
6543 - | ::pretty_assertions::assert_eq!(
|
6544 - | input.list_of_maps_of_strings,
|
6545 - | expected.list_of_maps_of_strings,
|
6546 - | "Unexpected value for `list_of_maps_of_strings`"
|
6547 - | );
|
6548 - | ::pretty_assertions::assert_eq!(
|
6549 - | input.list_of_strings,
|
6550 - | expected.list_of_strings,
|
6551 - | "Unexpected value for `list_of_strings`"
|
6552 - | );
|
6553 - | ::pretty_assertions::assert_eq!(
|
6554 - | input.list_of_structs,
|
6555 - | expected.list_of_structs,
|
6556 - | "Unexpected value for `list_of_structs`"
|
6557 - | );
|
6558 - | ::pretty_assertions::assert_eq!(
|
6559 - | input.long,
|
6560 - | expected.long,
|
6561 - | "Unexpected value for `long`"
|
6562 - | );
|
6563 - | ::pretty_assertions::assert_eq!(
|
6564 - | input.map_of_lists_of_strings,
|
6565 - | expected.map_of_lists_of_strings,
|
6566 - | "Unexpected value for `map_of_lists_of_strings`"
|
6567 - | );
|
6568 - | ::pretty_assertions::assert_eq!(
|
6569 - | input.map_of_maps,
|
6570 - | expected.map_of_maps,
|
6571 - | "Unexpected value for `map_of_maps`"
|
6572 - | );
|
6573 - | ::pretty_assertions::assert_eq!(
|
6574 - | input.map_of_strings,
|
6575 - | expected.map_of_strings,
|
6576 - | "Unexpected value for `map_of_strings`"
|
6577 - | );
|
6578 - | ::pretty_assertions::assert_eq!(
|
6579 - | input.map_of_structs,
|
6580 - | expected.map_of_structs,
|
6581 - | "Unexpected value for `map_of_structs`"
|
6582 - | );
|
6583 - | ::pretty_assertions::assert_eq!(
|
6584 - | input.recursive_list,
|
6585 - | expected.recursive_list,
|
6586 - | "Unexpected value for `recursive_list`"
|
6587 - | );
|
6588 - | ::pretty_assertions::assert_eq!(
|
6589 - | input.recursive_map,
|
6590 - | expected.recursive_map,
|
6591 - | "Unexpected value for `recursive_map`"
|
6592 - | );
|
6593 - | ::pretty_assertions::assert_eq!(
|
6594 - | input.recursive_struct,
|
6595 - | expected.recursive_struct,
|
6596 - | "Unexpected value for `recursive_struct`"
|
6597 - | );
|
6598 - | ::pretty_assertions::assert_eq!(
|
6599 - | input.simple_struct,
|
6600 - | expected.simple_struct,
|
6601 - | "Unexpected value for `simple_struct`"
|
6602 - | );
|
6603 - | ::pretty_assertions::assert_eq!(
|
6604 - | input.string,
|
6605 - | expected.string,
|
6606 - | "Unexpected value for `string`"
|
6607 - | );
|
6608 - | ::pretty_assertions::assert_eq!(
|
6609 - | input.struct_with_json_name,
|
6610 - | expected.struct_with_json_name,
|
6611 - | "Unexpected value for `struct_with_json_name`"
|
6612 - | );
|
6613 - | ::pretty_assertions::assert_eq!(
|
6614 - | input.timestamp,
|
6615 - | expected.timestamp,
|
6616 - | "Unexpected value for `timestamp`"
|
6617 - | );
|
6618 - | ::pretty_assertions::assert_eq!(
|
6619 - | input.unix_timestamp,
|
6620 - | expected.unix_timestamp,
|
6621 - | "Unexpected value for `unix_timestamp`"
|
6622 - | );
|
6623 - | let output = crate::output::KitchenSinkOperationOutput {
|
6624 - | blob: ::std::option::Option::None,
|
6625 - | boolean: ::std::option::Option::None,
|
6626 - | double: ::std::option::Option::None,
|
6627 - | empty_struct: ::std::option::Option::None,
|
6628 - | float: ::std::option::Option::None,
|
6629 - | httpdate_timestamp: ::std::option::Option::None,
|
6630 - | integer: ::std::option::Option::None,
|
6631 - | iso8601_timestamp: ::std::option::Option::None,
|
6632 - | json_value: ::std::option::Option::None,
|
6633 - | list_of_lists: ::std::option::Option::None,
|
6634 - | list_of_maps_of_strings: ::std::option::Option::None,
|
6635 - | list_of_strings: ::std::option::Option::None,
|
6636 - | list_of_structs: ::std::option::Option::None,
|
6637 - | long: ::std::option::Option::None,
|
6638 - | map_of_lists_of_strings: ::std::option::Option::None,
|
6639 - | map_of_maps: ::std::option::Option::None,
|
6640 - | map_of_strings: ::std::option::Option::None,
|
6641 - | map_of_structs: ::std::option::Option::None,
|
6642 - | recursive_list: ::std::option::Option::None,
|
6643 - | recursive_map: ::std::option::Option::None,
|
6644 - | recursive_struct: ::std::option::Option::None,
|
6645 - | simple_struct: ::std::option::Option::None,
|
6646 - | string: ::std::option::Option::None,
|
6647 - | struct_with_json_name: ::std::option::Option::None,
|
6648 - | timestamp: ::std::option::Option::None,
|
6649 - | unix_timestamp: ::std::option::Option::None,
|
6650 - | };
|
6651 - | Ok(output)
|
6268 + | let service = crate::service::JsonProtocol::builder::<
|
6269 + | ::aws_smithy_http_server::body::BoxBody,
|
6270 + | _,
|
6271 + | _,
|
6272 + | _,
|
6273 + | >(config)
|
6274 + | .kitchen_sink_operation(move |input: crate::input::KitchenSinkOperationInput| {
|
6275 + | let sender = sender.clone();
|
6276 + | async move {
|
6277 + | let result = {
|
6278 + | use ::aws_smithy_protocol_test::FloatEquals;
|
6279 + | let expected = crate::input::KitchenSinkOperationInput {
|
6280 + | iso8601_timestamp: ::std::option::Option::Some(
|
6281 + | ::aws_smithy_types::DateTime::from_fractional_secs(946845296, 0_f64),
|
6282 + | ),
|
6283 + | blob: ::std::option::Option::None,
|
6284 + | boolean: ::std::option::Option::None,
|
6285 + | double: ::std::option::Option::None,
|
6286 + | empty_struct: ::std::option::Option::None,
|
6287 + | float: ::std::option::Option::None,
|
6288 + | httpdate_timestamp: ::std::option::Option::None,
|
6289 + | integer: ::std::option::Option::None,
|
6290 + | json_value: ::std::option::Option::None,
|
6291 + | list_of_lists: ::std::option::Option::None,
|
6292 + | list_of_maps_of_strings: ::std::option::Option::None,
|
6293 + | list_of_strings: ::std::option::Option::None,
|
6294 + | list_of_structs: ::std::option::Option::None,
|
6295 + | long: ::std::option::Option::None,
|
6296 + | map_of_lists_of_strings: ::std::option::Option::None,
|
6297 + | map_of_maps: ::std::option::Option::None,
|
6298 + | map_of_strings: ::std::option::Option::None,
|
6299 + | map_of_structs: ::std::option::Option::None,
|
6300 + | recursive_list: ::std::option::Option::None,
|
6301 + | recursive_map: ::std::option::Option::None,
|
6302 + | recursive_struct: ::std::option::Option::None,
|
6303 + | simple_struct: ::std::option::Option::None,
|
6304 + | string: ::std::option::Option::None,
|
6305 + | struct_with_json_name: ::std::option::Option::None,
|
6306 + | timestamp: ::std::option::Option::None,
|
6307 + | unix_timestamp: ::std::option::Option::None,
|
6652 6308 | };
|
6653 - | sender.send(()).await.expect("receiver dropped early");
|
6654 - | result
|
6655 - | }
|
6656 - | })
|
6657 - | .build_unchecked();
|
6309 + | ::pretty_assertions::assert_eq!(
|
6310 + | input.blob,
|
6311 + | expected.blob,
|
6312 + | "Unexpected value for `blob`"
|
6313 + | );
|
6314 + | ::pretty_assertions::assert_eq!(
|
6315 + | input.boolean,
|
6316 + | expected.boolean,
|
6317 + | "Unexpected value for `boolean`"
|
6318 + | );
|
6319 + | assert!(
|
6320 + | input.double.float_equals(&expected.double),
|
6321 + | "Unexpected value for `double` {:?} vs. {:?}",
|
6322 + | expected.double,
|
6323 + | input.double
|
6324 + | );
|
6325 + | ::pretty_assertions::assert_eq!(
|
6326 + | input.empty_struct,
|
6327 + | expected.empty_struct,
|
6328 + | "Unexpected value for `empty_struct`"
|
6329 + | );
|
6330 + | assert!(
|
6331 + | input.float.float_equals(&expected.float),
|
6332 + | "Unexpected value for `float` {:?} vs. {:?}",
|
6333 + | expected.float,
|
6334 + | input.float
|
6335 + | );
|
6336 + | ::pretty_assertions::assert_eq!(
|
6337 + | input.httpdate_timestamp,
|
6338 + | expected.httpdate_timestamp,
|
6339 + | "Unexpected value for `httpdate_timestamp`"
|
6340 + | );
|
6341 + | ::pretty_assertions::assert_eq!(
|
6342 + | input.integer,
|
6343 + | expected.integer,
|
6344 + | "Unexpected value for `integer`"
|
6345 + | );
|
6346 + | ::pretty_assertions::assert_eq!(
|
6347 + | input.iso8601_timestamp,
|
6348 + | expected.iso8601_timestamp,
|
6349 + | "Unexpected value for `iso8601_timestamp`"
|
6350 + | );
|
6351 + | ::pretty_assertions::assert_eq!(
|
6352 + | input.json_value,
|
6353 + | expected.json_value,
|
6354 + | "Unexpected value for `json_value`"
|
6355 + | );
|
6356 + | ::pretty_assertions::assert_eq!(
|
6357 + | input.list_of_lists,
|
6358 + | expected.list_of_lists,
|
6359 + | "Unexpected value for `list_of_lists`"
|
6360 + | );
|
6361 + | ::pretty_assertions::assert_eq!(
|
6362 + | input.list_of_maps_of_strings,
|
6363 + | expected.list_of_maps_of_strings,
|
6364 + | "Unexpected value for `list_of_maps_of_strings`"
|
6365 + | );
|
6366 + | ::pretty_assertions::assert_eq!(
|
6367 + | input.list_of_strings,
|
6368 + | expected.list_of_strings,
|
6369 + | "Unexpected value for `list_of_strings`"
|
6370 + | );
|
6371 + | ::pretty_assertions::assert_eq!(
|
6372 + | input.list_of_structs,
|
6373 + | expected.list_of_structs,
|
6374 + | "Unexpected value for `list_of_structs`"
|
6375 + | );
|
6376 + | ::pretty_assertions::assert_eq!(
|
6377 + | input.long,
|
6378 + | expected.long,
|
6379 + | "Unexpected value for `long`"
|
6380 + | );
|
6381 + | ::pretty_assertions::assert_eq!(
|
6382 + | input.map_of_lists_of_strings,
|
6383 + | expected.map_of_lists_of_strings,
|
6384 + | "Unexpected value for `map_of_lists_of_strings`"
|
6385 + | );
|
6386 + | ::pretty_assertions::assert_eq!(
|
6387 + | input.map_of_maps,
|
6388 + | expected.map_of_maps,
|
6389 + | "Unexpected value for `map_of_maps`"
|
6390 + | );
|
6391 + | ::pretty_assertions::assert_eq!(
|
6392 + | input.map_of_strings,
|
6393 + | expected.map_of_strings,
|
6394 + | "Unexpected value for `map_of_strings`"
|
6395 + | );
|
6396 + | ::pretty_assertions::assert_eq!(
|
6397 + | input.map_of_structs,
|
6398 + | expected.map_of_structs,
|
6399 + | "Unexpected value for `map_of_structs`"
|
6400 + | );
|
6401 + | ::pretty_assertions::assert_eq!(
|
6402 + | input.recursive_list,
|
6403 + | expected.recursive_list,
|
6404 + | "Unexpected value for `recursive_list`"
|
6405 + | );
|
6406 + | ::pretty_assertions::assert_eq!(
|
6407 + | input.recursive_map,
|
6408 + | expected.recursive_map,
|
6409 + | "Unexpected value for `recursive_map`"
|
6410 + | );
|
6411 + | ::pretty_assertions::assert_eq!(
|
6412 + | input.recursive_struct,
|
6413 + | expected.recursive_struct,
|
6414 + | "Unexpected value for `recursive_struct`"
|
6415 + | );
|
6416 + | ::pretty_assertions::assert_eq!(
|
6417 + | input.simple_struct,
|
6418 + | expected.simple_struct,
|
6419 + | "Unexpected value for `simple_struct`"
|
6420 + | );
|
6421 + | ::pretty_assertions::assert_eq!(
|
6422 + | input.string,
|
6423 + | expected.string,
|
6424 + | "Unexpected value for `string`"
|
6425 + | );
|
6426 + | ::pretty_assertions::assert_eq!(
|
6427 + | input.struct_with_json_name,
|
6428 + | expected.struct_with_json_name,
|
6429 + | "Unexpected value for `struct_with_json_name`"
|
6430 + | );
|
6431 + | ::pretty_assertions::assert_eq!(
|
6432 + | input.timestamp,
|
6433 + | expected.timestamp,
|
6434 + | "Unexpected value for `timestamp`"
|
6435 + | );
|
6436 + | ::pretty_assertions::assert_eq!(
|
6437 + | input.unix_timestamp,
|
6438 + | expected.unix_timestamp,
|
6439 + | "Unexpected value for `unix_timestamp`"
|
6440 + | );
|
6441 + | let output = crate::output::KitchenSinkOperationOutput {
|
6442 + | blob: ::std::option::Option::None,
|
6443 + | boolean: ::std::option::Option::None,
|
6444 + | double: ::std::option::Option::None,
|
6445 + | empty_struct: ::std::option::Option::None,
|
6446 + | float: ::std::option::Option::None,
|
6447 + | httpdate_timestamp: ::std::option::Option::None,
|
6448 + | integer: ::std::option::Option::None,
|
6449 + | iso8601_timestamp: ::std::option::Option::None,
|
6450 + | json_value: ::std::option::Option::None,
|
6451 + | list_of_lists: ::std::option::Option::None,
|
6452 + | list_of_maps_of_strings: ::std::option::Option::None,
|
6453 + | list_of_strings: ::std::option::Option::None,
|
6454 + | list_of_structs: ::std::option::Option::None,
|
6455 + | long: ::std::option::Option::None,
|
6456 + | map_of_lists_of_strings: ::std::option::Option::None,
|
6457 + | map_of_maps: ::std::option::Option::None,
|
6458 + | map_of_strings: ::std::option::Option::None,
|
6459 + | map_of_structs: ::std::option::Option::None,
|
6460 + | recursive_list: ::std::option::Option::None,
|
6461 + | recursive_map: ::std::option::Option::None,
|
6462 + | recursive_struct: ::std::option::Option::None,
|
6463 + | simple_struct: ::std::option::Option::None,
|
6464 + | string: ::std::option::Option::None,
|
6465 + | struct_with_json_name: ::std::option::Option::None,
|
6466 + | timestamp: ::std::option::Option::None,
|
6467 + | unix_timestamp: ::std::option::Option::None,
|
6468 + | };
|
6469 + | Ok(output)
|
6470 + | };
|
6471 + | sender.send(()).await.expect("receiver dropped early");
|
6472 + | result
|
6473 + | }
|
6474 + | })
|
6475 + | .build_unchecked();
|
6658 6476 | let http_response = ::tower::ServiceExt::oneshot(service, http_request)
|
6659 6477 | .await
|
6660 6478 | .expect("unable to make an HTTP request");
|
6661 6479 | assert!(
|
6662 6480 | receiver.recv().await.is_some(),
|
6663 6481 | "we expected operation handler to be invoked but it was not entered"
|
6664 6482 | );
|
6665 6483 | }
|
6666 6484 |
|
6667 - | /// Serializes list shapes
|
6668 - | /// Test ID: serializes_list_shapes
|
6485 + | /// Serializes timestamp shapes with httpdate timestampFormat
|
6486 + | /// Test ID: serializes_timestamp_shapes_with_httpdate_timestampformat
|
6669 6487 | #[::tokio::test]
|
6670 6488 | #[::tracing_test::traced_test]
|
6671 - | async fn serializes_list_shapes_request() {
|
6489 + | async fn serializes_timestamp_shapes_with_httpdate_timestampformat_request() {
|
6672 6490 | #[allow(unused_mut)]
|
6673 - | let mut http_request = http::Request::builder()
|
6491 + | let mut http_request = ::http_1x::Request::builder()
|
6674 6492 | .uri("/")
|
6675 6493 | .method("POST")
|
6676 6494 | .header("Content-Type", "application/x-amz-json-1.1")
|
6677 6495 | .header("X-Amz-Target", "JsonProtocol.KitchenSinkOperation")
|
6678 - | .body(::aws_smithy_http_server::body::Body::from(
|
6679 - | ::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
|
6680 - | "{\"ListOfStrings\":[\"abc\",\"mno\",\"xyz\"]}".as_bytes(),
|
6681 - | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
6496 + | .body(::aws_smithy_http_server::body::boxed(
|
6497 + | ::http_body_util::Full::new(::bytes::Bytes::copy_from_slice(
|
6498 + | &::aws_smithy_protocol_test::decode_body_data(
|
6499 + | "{\"HttpdateTimestamp\":\"Sun, 02 Jan 2000 20:34:56 GMT\"}".as_bytes(),
|
6500 + | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
6501 + | ),
|
6682 6502 | )),
|
6683 6503 | ))
|
6684 6504 | .unwrap();
|
6685 6505 | #[allow(unused_mut)]
|
6686 6506 | let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
|
6687 6507 | let config = crate::service::JsonProtocolConfig::builder().build();
|
6688 - | let service = crate::service::JsonProtocol::builder::<::hyper::body::Body, _, _, _>(config)
|
6689 - | .kitchen_sink_operation(move |input: crate::input::KitchenSinkOperationInput| {
|
6690 - | let sender = sender.clone();
|
6691 - | async move {
|
6692 - | let result = {
|
6693 - | use ::aws_smithy_protocol_test::FloatEquals;
|
6694 - | let expected = crate::input::KitchenSinkOperationInput {
|
6695 - | list_of_strings: ::std::option::Option::Some(vec![
|
6696 - | "abc".to_owned(),
|
6697 - | "mno".to_owned(),
|
6698 - | "xyz".to_owned(),
|
6699 - | ]),
|
6700 - | blob: ::std::option::Option::None,
|
6701 - | boolean: ::std::option::Option::None,
|
6702 - | double: ::std::option::Option::None,
|
6703 - | empty_struct: ::std::option::Option::None,
|
6704 - | float: ::std::option::Option::None,
|
6705 - | httpdate_timestamp: ::std::option::Option::None,
|
6706 - | integer: ::std::option::Option::None,
|
6707 - | iso8601_timestamp: ::std::option::Option::None,
|
6708 - | json_value: ::std::option::Option::None,
|
6709 - | list_of_lists: ::std::option::Option::None,
|
6710 - | list_of_maps_of_strings: ::std::option::Option::None,
|
6711 - | list_of_structs: ::std::option::Option::None,
|
6712 - | long: ::std::option::Option::None,
|
6713 - | map_of_lists_of_strings: ::std::option::Option::None,
|
6714 - | map_of_maps: ::std::option::Option::None,
|
6715 - | map_of_strings: ::std::option::Option::None,
|
6716 - | map_of_structs: ::std::option::Option::None,
|
6717 - | recursive_list: ::std::option::Option::None,
|
6718 - | recursive_map: ::std::option::Option::None,
|
6719 - | recursive_struct: ::std::option::Option::None,
|
6720 - | simple_struct: ::std::option::Option::None,
|
6721 - | string: ::std::option::Option::None,
|
6722 - | struct_with_json_name: ::std::option::Option::None,
|
6723 - | timestamp: ::std::option::Option::None,
|
6724 - | unix_timestamp: ::std::option::Option::None,
|
6725 - | };
|
6726 - | ::pretty_assertions::assert_eq!(
|
6727 - | input.blob,
|
6728 - | expected.blob,
|
6729 - | "Unexpected value for `blob`"
|
6730 - | );
|
6731 - | ::pretty_assertions::assert_eq!(
|
6732 - | input.boolean,
|
6733 - | expected.boolean,
|
6734 - | "Unexpected value for `boolean`"
|
6735 - | );
|
6736 - | assert!(
|
6737 - | input.double.float_equals(&expected.double),
|
6738 - | "Unexpected value for `double` {:?} vs. {:?}",
|
6739 - | expected.double,
|
6740 - | input.double
|
6741 - | );
|
6742 - | ::pretty_assertions::assert_eq!(
|
6743 - | input.empty_struct,
|
6744 - | expected.empty_struct,
|
6745 - | "Unexpected value for `empty_struct`"
|
6746 - | );
|
6747 - | assert!(
|
6748 - | input.float.float_equals(&expected.float),
|
6749 - | "Unexpected value for `float` {:?} vs. {:?}",
|
6750 - | expected.float,
|
6751 - | input.float
|
6752 - | );
|
6753 - | ::pretty_assertions::assert_eq!(
|
6754 - | input.httpdate_timestamp,
|
6755 - | expected.httpdate_timestamp,
|
6756 - | "Unexpected value for `httpdate_timestamp`"
|
6757 - | );
|
6758 - | ::pretty_assertions::assert_eq!(
|
6759 - | input.integer,
|
6760 - | expected.integer,
|
6761 - | "Unexpected value for `integer`"
|
6762 - | );
|
6763 - | ::pretty_assertions::assert_eq!(
|
6764 - | input.iso8601_timestamp,
|
6765 - | expected.iso8601_timestamp,
|
6766 - | "Unexpected value for `iso8601_timestamp`"
|
6767 - | );
|
6768 - | ::pretty_assertions::assert_eq!(
|
6769 - | input.json_value,
|
6770 - | expected.json_value,
|
6771 - | "Unexpected value for `json_value`"
|
6772 - | );
|
6773 - | ::pretty_assertions::assert_eq!(
|
6774 - | input.list_of_lists,
|
6775 - | expected.list_of_lists,
|
6776 - | "Unexpected value for `list_of_lists`"
|
6777 - | );
|
6778 - | ::pretty_assertions::assert_eq!(
|
6779 - | input.list_of_maps_of_strings,
|
6780 - | expected.list_of_maps_of_strings,
|
6781 - | "Unexpected value for `list_of_maps_of_strings`"
|
6782 - | );
|
6783 - | ::pretty_assertions::assert_eq!(
|
6784 - | input.list_of_strings,
|
6785 - | expected.list_of_strings,
|
6786 - | "Unexpected value for `list_of_strings`"
|
6787 - | );
|
6788 - | ::pretty_assertions::assert_eq!(
|
6789 - | input.list_of_structs,
|
6790 - | expected.list_of_structs,
|
6791 - | "Unexpected value for `list_of_structs`"
|
6792 - | );
|
6793 - | ::pretty_assertions::assert_eq!(
|
6794 - | input.long,
|
6795 - | expected.long,
|
6796 - | "Unexpected value for `long`"
|
6797 - | );
|
6798 - | ::pretty_assertions::assert_eq!(
|
6799 - | input.map_of_lists_of_strings,
|
6800 - | expected.map_of_lists_of_strings,
|
6801 - | "Unexpected value for `map_of_lists_of_strings`"
|
6802 - | );
|
6803 - | ::pretty_assertions::assert_eq!(
|
6804 - | input.map_of_maps,
|
6805 - | expected.map_of_maps,
|
6806 - | "Unexpected value for `map_of_maps`"
|
6807 - | );
|
6808 - | ::pretty_assertions::assert_eq!(
|
6809 - | input.map_of_strings,
|
6810 - | expected.map_of_strings,
|
6811 - | "Unexpected value for `map_of_strings`"
|
6812 - | );
|
6813 - | ::pretty_assertions::assert_eq!(
|
6814 - | input.map_of_structs,
|
6815 - | expected.map_of_structs,
|
6816 - | "Unexpected value for `map_of_structs`"
|
6817 - | );
|
6818 - | ::pretty_assertions::assert_eq!(
|
6819 - | input.recursive_list,
|
6820 - | expected.recursive_list,
|
6821 - | "Unexpected value for `recursive_list`"
|
6822 - | );
|
6823 - | ::pretty_assertions::assert_eq!(
|
6824 - | input.recursive_map,
|
6825 - | expected.recursive_map,
|
6826 - | "Unexpected value for `recursive_map`"
|
6827 - | );
|
6828 - | ::pretty_assertions::assert_eq!(
|
6829 - | input.recursive_struct,
|
6830 - | expected.recursive_struct,
|
6831 - | "Unexpected value for `recursive_struct`"
|
6832 - | );
|
6833 - | ::pretty_assertions::assert_eq!(
|
6834 - | input.simple_struct,
|
6835 - | expected.simple_struct,
|
6836 - | "Unexpected value for `simple_struct`"
|
6837 - | );
|
6838 - | ::pretty_assertions::assert_eq!(
|
6839 - | input.string,
|
6840 - | expected.string,
|
6841 - | "Unexpected value for `string`"
|
6842 - | );
|
6843 - | ::pretty_assertions::assert_eq!(
|
6844 - | input.struct_with_json_name,
|
6845 - | expected.struct_with_json_name,
|
6846 - | "Unexpected value for `struct_with_json_name`"
|
6847 - | );
|
6848 - | ::pretty_assertions::assert_eq!(
|
6849 - | input.timestamp,
|
6850 - | expected.timestamp,
|
6851 - | "Unexpected value for `timestamp`"
|
6852 - | );
|
6853 - | ::pretty_assertions::assert_eq!(
|
6854 - | input.unix_timestamp,
|
6855 - | expected.unix_timestamp,
|
6856 - | "Unexpected value for `unix_timestamp`"
|
6857 - | );
|
6858 - | let output = crate::output::KitchenSinkOperationOutput {
|
6859 - | blob: ::std::option::Option::None,
|
6860 - | boolean: ::std::option::Option::None,
|
6861 - | double: ::std::option::Option::None,
|
6862 - | empty_struct: ::std::option::Option::None,
|
6863 - | float: ::std::option::Option::None,
|
6864 - | httpdate_timestamp: ::std::option::Option::None,
|
6865 - | integer: ::std::option::Option::None,
|
6866 - | iso8601_timestamp: ::std::option::Option::None,
|
6867 - | json_value: ::std::option::Option::None,
|
6868 - | list_of_lists: ::std::option::Option::None,
|
6869 - | list_of_maps_of_strings: ::std::option::Option::None,
|
6870 - | list_of_strings: ::std::option::Option::None,
|
6871 - | list_of_structs: ::std::option::Option::None,
|
6872 - | long: ::std::option::Option::None,
|
6873 - | map_of_lists_of_strings: ::std::option::Option::None,
|
6874 - | map_of_maps: ::std::option::Option::None,
|
6875 - | map_of_strings: ::std::option::Option::None,
|
6876 - | map_of_structs: ::std::option::Option::None,
|
6877 - | recursive_list: ::std::option::Option::None,
|
6878 - | recursive_map: ::std::option::Option::None,
|
6879 - | recursive_struct: ::std::option::Option::None,
|
6880 - | simple_struct: ::std::option::Option::None,
|
6881 - | string: ::std::option::Option::None,
|
6882 - | struct_with_json_name: ::std::option::Option::None,
|
6883 - | timestamp: ::std::option::Option::None,
|
6884 - | unix_timestamp: ::std::option::Option::None,
|
6885 - | };
|
6886 - | Ok(output)
|
6508 + | let service = crate::service::JsonProtocol::builder::<
|
6509 + | ::aws_smithy_http_server::body::BoxBody,
|
6510 + | _,
|
6511 + | _,
|
6512 + | _,
|
6513 + | >(config)
|
6514 + | .kitchen_sink_operation(move |input: crate::input::KitchenSinkOperationInput| {
|
6515 + | let sender = sender.clone();
|
6516 + | async move {
|
6517 + | let result = {
|
6518 + | use ::aws_smithy_protocol_test::FloatEquals;
|
6519 + | let expected = crate::input::KitchenSinkOperationInput {
|
6520 + | httpdate_timestamp: ::std::option::Option::Some(
|
6521 + | ::aws_smithy_types::DateTime::from_fractional_secs(946845296, 0_f64),
|
6522 + | ),
|
6523 + | blob: ::std::option::Option::None,
|
6524 + | boolean: ::std::option::Option::None,
|
6525 + | double: ::std::option::Option::None,
|
6526 + | empty_struct: ::std::option::Option::None,
|
6527 + | float: ::std::option::Option::None,
|
6528 + | integer: ::std::option::Option::None,
|
6529 + | iso8601_timestamp: ::std::option::Option::None,
|
6530 + | json_value: ::std::option::Option::None,
|
6531 + | list_of_lists: ::std::option::Option::None,
|
6532 + | list_of_maps_of_strings: ::std::option::Option::None,
|
6533 + | list_of_strings: ::std::option::Option::None,
|
6534 + | list_of_structs: ::std::option::Option::None,
|
6535 + | long: ::std::option::Option::None,
|
6536 + | map_of_lists_of_strings: ::std::option::Option::None,
|
6537 + | map_of_maps: ::std::option::Option::None,
|
6538 + | map_of_strings: ::std::option::Option::None,
|
6539 + | map_of_structs: ::std::option::Option::None,
|
6540 + | recursive_list: ::std::option::Option::None,
|
6541 + | recursive_map: ::std::option::Option::None,
|
6542 + | recursive_struct: ::std::option::Option::None,
|
6543 + | simple_struct: ::std::option::Option::None,
|
6544 + | string: ::std::option::Option::None,
|
6545 + | struct_with_json_name: ::std::option::Option::None,
|
6546 + | timestamp: ::std::option::Option::None,
|
6547 + | unix_timestamp: ::std::option::Option::None,
|
6887 6548 | };
|
6888 - | sender.send(()).await.expect("receiver dropped early");
|
6889 - | result
|
6890 - | }
|
6891 - | })
|
6892 - | .build_unchecked();
|
6549 + | ::pretty_assertions::assert_eq!(
|
6550 + | input.blob,
|
6551 + | expected.blob,
|
6552 + | "Unexpected value for `blob`"
|
6553 + | );
|
6554 + | ::pretty_assertions::assert_eq!(
|
6555 + | input.boolean,
|
6556 + | expected.boolean,
|
6557 + | "Unexpected value for `boolean`"
|
6558 + | );
|
6559 + | assert!(
|
6560 + | input.double.float_equals(&expected.double),
|
6561 + | "Unexpected value for `double` {:?} vs. {:?}",
|
6562 + | expected.double,
|
6563 + | input.double
|
6564 + | );
|
6565 + | ::pretty_assertions::assert_eq!(
|
6566 + | input.empty_struct,
|
6567 + | expected.empty_struct,
|
6568 + | "Unexpected value for `empty_struct`"
|
6569 + | );
|
6570 + | assert!(
|
6571 + | input.float.float_equals(&expected.float),
|
6572 + | "Unexpected value for `float` {:?} vs. {:?}",
|
6573 + | expected.float,
|
6574 + | input.float
|
6575 + | );
|
6576 + | ::pretty_assertions::assert_eq!(
|
6577 + | input.httpdate_timestamp,
|
6578 + | expected.httpdate_timestamp,
|
6579 + | "Unexpected value for `httpdate_timestamp`"
|
6580 + | );
|
6581 + | ::pretty_assertions::assert_eq!(
|
6582 + | input.integer,
|
6583 + | expected.integer,
|
6584 + | "Unexpected value for `integer`"
|
6585 + | );
|
6586 + | ::pretty_assertions::assert_eq!(
|
6587 + | input.iso8601_timestamp,
|
6588 + | expected.iso8601_timestamp,
|
6589 + | "Unexpected value for `iso8601_timestamp`"
|
6590 + | );
|
6591 + | ::pretty_assertions::assert_eq!(
|
6592 + | input.json_value,
|
6593 + | expected.json_value,
|
6594 + | "Unexpected value for `json_value`"
|
6595 + | );
|
6596 + | ::pretty_assertions::assert_eq!(
|
6597 + | input.list_of_lists,
|
6598 + | expected.list_of_lists,
|
6599 + | "Unexpected value for `list_of_lists`"
|
6600 + | );
|
6601 + | ::pretty_assertions::assert_eq!(
|
6602 + | input.list_of_maps_of_strings,
|
6603 + | expected.list_of_maps_of_strings,
|
6604 + | "Unexpected value for `list_of_maps_of_strings`"
|
6605 + | );
|
6606 + | ::pretty_assertions::assert_eq!(
|
6607 + | input.list_of_strings,
|
6608 + | expected.list_of_strings,
|
6609 + | "Unexpected value for `list_of_strings`"
|
6610 + | );
|
6611 + | ::pretty_assertions::assert_eq!(
|
6612 + | input.list_of_structs,
|
6613 + | expected.list_of_structs,
|
6614 + | "Unexpected value for `list_of_structs`"
|
6615 + | );
|
6616 + | ::pretty_assertions::assert_eq!(
|
6617 + | input.long,
|
6618 + | expected.long,
|
6619 + | "Unexpected value for `long`"
|
6620 + | );
|
6621 + | ::pretty_assertions::assert_eq!(
|
6622 + | input.map_of_lists_of_strings,
|
6623 + | expected.map_of_lists_of_strings,
|
6624 + | "Unexpected value for `map_of_lists_of_strings`"
|
6625 + | );
|
6626 + | ::pretty_assertions::assert_eq!(
|
6627 + | input.map_of_maps,
|
6628 + | expected.map_of_maps,
|
6629 + | "Unexpected value for `map_of_maps`"
|
6630 + | );
|
6631 + | ::pretty_assertions::assert_eq!(
|
6632 + | input.map_of_strings,
|
6633 + | expected.map_of_strings,
|
6634 + | "Unexpected value for `map_of_strings`"
|
6635 + | );
|
6636 + | ::pretty_assertions::assert_eq!(
|
6637 + | input.map_of_structs,
|
6638 + | expected.map_of_structs,
|
6639 + | "Unexpected value for `map_of_structs`"
|
6640 + | );
|
6641 + | ::pretty_assertions::assert_eq!(
|
6642 + | input.recursive_list,
|
6643 + | expected.recursive_list,
|
6644 + | "Unexpected value for `recursive_list`"
|
6645 + | );
|
6646 + | ::pretty_assertions::assert_eq!(
|
6647 + | input.recursive_map,
|
6648 + | expected.recursive_map,
|
6649 + | "Unexpected value for `recursive_map`"
|
6650 + | );
|
6651 + | ::pretty_assertions::assert_eq!(
|
6652 + | input.recursive_struct,
|
6653 + | expected.recursive_struct,
|
6654 + | "Unexpected value for `recursive_struct`"
|
6655 + | );
|
6656 + | ::pretty_assertions::assert_eq!(
|
6657 + | input.simple_struct,
|
6658 + | expected.simple_struct,
|
6659 + | "Unexpected value for `simple_struct`"
|
6660 + | );
|
6661 + | ::pretty_assertions::assert_eq!(
|
6662 + | input.string,
|
6663 + | expected.string,
|
6664 + | "Unexpected value for `string`"
|
6665 + | );
|
6666 + | ::pretty_assertions::assert_eq!(
|
6667 + | input.struct_with_json_name,
|
6668 + | expected.struct_with_json_name,
|
6669 + | "Unexpected value for `struct_with_json_name`"
|
6670 + | );
|
6671 + | ::pretty_assertions::assert_eq!(
|
6672 + | input.timestamp,
|
6673 + | expected.timestamp,
|
6674 + | "Unexpected value for `timestamp`"
|
6675 + | );
|
6676 + | ::pretty_assertions::assert_eq!(
|
6677 + | input.unix_timestamp,
|
6678 + | expected.unix_timestamp,
|
6679 + | "Unexpected value for `unix_timestamp`"
|
6680 + | );
|
6681 + | let output = crate::output::KitchenSinkOperationOutput {
|
6682 + | blob: ::std::option::Option::None,
|
6683 + | boolean: ::std::option::Option::None,
|
6684 + | double: ::std::option::Option::None,
|
6685 + | empty_struct: ::std::option::Option::None,
|
6686 + | float: ::std::option::Option::None,
|
6687 + | httpdate_timestamp: ::std::option::Option::None,
|
6688 + | integer: ::std::option::Option::None,
|
6689 + | iso8601_timestamp: ::std::option::Option::None,
|
6690 + | json_value: ::std::option::Option::None,
|
6691 + | list_of_lists: ::std::option::Option::None,
|
6692 + | list_of_maps_of_strings: ::std::option::Option::None,
|
6693 + | list_of_strings: ::std::option::Option::None,
|
6694 + | list_of_structs: ::std::option::Option::None,
|
6695 + | long: ::std::option::Option::None,
|
6696 + | map_of_lists_of_strings: ::std::option::Option::None,
|
6697 + | map_of_maps: ::std::option::Option::None,
|
6698 + | map_of_strings: ::std::option::Option::None,
|
6699 + | map_of_structs: ::std::option::Option::None,
|
6700 + | recursive_list: ::std::option::Option::None,
|
6701 + | recursive_map: ::std::option::Option::None,
|
6702 + | recursive_struct: ::std::option::Option::None,
|
6703 + | simple_struct: ::std::option::Option::None,
|
6704 + | string: ::std::option::Option::None,
|
6705 + | struct_with_json_name: ::std::option::Option::None,
|
6706 + | timestamp: ::std::option::Option::None,
|
6707 + | unix_timestamp: ::std::option::Option::None,
|
6708 + | };
|
6709 + | Ok(output)
|
6710 + | };
|
6711 + | sender.send(()).await.expect("receiver dropped early");
|
6712 + | result
|
6713 + | }
|
6714 + | })
|
6715 + | .build_unchecked();
|
6893 6716 | let http_response = ::tower::ServiceExt::oneshot(service, http_request)
|
6894 6717 | .await
|
6895 6718 | .expect("unable to make an HTTP request");
|
6896 6719 | assert!(
|
6897 6720 | receiver.recv().await.is_some(),
|
6898 6721 | "we expected operation handler to be invoked but it was not entered"
|
6899 6722 | );
|
6900 6723 | }
|
6901 6724 |
|
6902 - | /// Serializes empty list shapes
|
6903 - | /// Test ID: serializes_empty_list_shapes
|
6725 + | /// Serializes timestamp shapes with unixTimestamp timestampFormat
|
6726 + | /// Test ID: serializes_timestamp_shapes_with_unixtimestamp_timestampformat
|
6904 6727 | #[::tokio::test]
|
6905 6728 | #[::tracing_test::traced_test]
|
6906 - | async fn serializes_empty_list_shapes_request() {
|
6729 + | async fn serializes_timestamp_shapes_with_unixtimestamp_timestampformat_request() {
|
6907 6730 | #[allow(unused_mut)]
|
6908 - | let mut http_request = http::Request::builder()
|
6731 + | let mut http_request = ::http_1x::Request::builder()
|
6909 6732 | .uri("/")
|
6910 6733 | .method("POST")
|
6911 6734 | .header("Content-Type", "application/x-amz-json-1.1")
|
6912 6735 | .header("X-Amz-Target", "JsonProtocol.KitchenSinkOperation")
|
6913 - | .body(::aws_smithy_http_server::body::Body::from(
|
6914 - | ::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
|
6915 - | "{\"ListOfStrings\":[]}".as_bytes(),
|
6916 - | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
6736 + | .body(::aws_smithy_http_server::body::boxed(
|
6737 + | ::http_body_util::Full::new(::bytes::Bytes::copy_from_slice(
|
6738 + | &::aws_smithy_protocol_test::decode_body_data(
|
6739 + | "{\"UnixTimestamp\":946845296}".as_bytes(),
|
6740 + | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
6741 + | ),
|
6917 6742 | )),
|
6918 6743 | ))
|
6919 6744 | .unwrap();
|
6920 6745 | #[allow(unused_mut)]
|
6921 6746 | let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
|
6922 6747 | let config = crate::service::JsonProtocolConfig::builder().build();
|
6923 - | let service = crate::service::JsonProtocol::builder::<::hyper::body::Body, _, _, _>(config)
|
6924 - | .kitchen_sink_operation(move |input: crate::input::KitchenSinkOperationInput| {
|
6925 - | let sender = sender.clone();
|
6926 - | async move {
|
6927 - | let result = {
|
6928 - | use ::aws_smithy_protocol_test::FloatEquals;
|
6929 - | let expected = crate::input::KitchenSinkOperationInput {
|
6930 - | list_of_strings: ::std::option::Option::Some(vec![]),
|
6931 - | blob: ::std::option::Option::None,
|
6932 - | boolean: ::std::option::Option::None,
|
6933 - | double: ::std::option::Option::None,
|
6934 - | empty_struct: ::std::option::Option::None,
|
6935 - | float: ::std::option::Option::None,
|
6936 - | httpdate_timestamp: ::std::option::Option::None,
|
6937 - | integer: ::std::option::Option::None,
|
6938 - | iso8601_timestamp: ::std::option::Option::None,
|
6939 - | json_value: ::std::option::Option::None,
|
6940 - | list_of_lists: ::std::option::Option::None,
|
6941 - | list_of_maps_of_strings: ::std::option::Option::None,
|
6942 - | list_of_structs: ::std::option::Option::None,
|
6943 - | long: ::std::option::Option::None,
|
6944 - | map_of_lists_of_strings: ::std::option::Option::None,
|
6945 - | map_of_maps: ::std::option::Option::None,
|
6946 - | map_of_strings: ::std::option::Option::None,
|
6947 - | map_of_structs: ::std::option::Option::None,
|
6948 - | recursive_list: ::std::option::Option::None,
|
6949 - | recursive_map: ::std::option::Option::None,
|
6950 - | recursive_struct: ::std::option::Option::None,
|
6951 - | simple_struct: ::std::option::Option::None,
|
6952 - | string: ::std::option::Option::None,
|
6953 - | struct_with_json_name: ::std::option::Option::None,
|
6954 - | timestamp: ::std::option::Option::None,
|
6955 - | unix_timestamp: ::std::option::Option::None,
|
6956 - | };
|
6957 - | ::pretty_assertions::assert_eq!(
|
6958 - | input.blob,
|
6959 - | expected.blob,
|
6960 - | "Unexpected value for `blob`"
|
6961 - | );
|
6962 - | ::pretty_assertions::assert_eq!(
|
6963 - | input.boolean,
|
6964 - | expected.boolean,
|
6965 - | "Unexpected value for `boolean`"
|
6966 - | );
|
6967 - | assert!(
|
6968 - | input.double.float_equals(&expected.double),
|
6969 - | "Unexpected value for `double` {:?} vs. {:?}",
|
6970 - | expected.double,
|
6971 - | input.double
|
6972 - | );
|
6973 - | ::pretty_assertions::assert_eq!(
|
6974 - | input.empty_struct,
|
6975 - | expected.empty_struct,
|
6976 - | "Unexpected value for `empty_struct`"
|
6977 - | );
|
6978 - | assert!(
|
6979 - | input.float.float_equals(&expected.float),
|
6980 - | "Unexpected value for `float` {:?} vs. {:?}",
|
6981 - | expected.float,
|
6982 - | input.float
|
6983 - | );
|
6984 - | ::pretty_assertions::assert_eq!(
|
6985 - | input.httpdate_timestamp,
|
6986 - | expected.httpdate_timestamp,
|
6987 - | "Unexpected value for `httpdate_timestamp`"
|
6988 - | );
|
6989 - | ::pretty_assertions::assert_eq!(
|
6990 - | input.integer,
|
6991 - | expected.integer,
|
6992 - | "Unexpected value for `integer`"
|
6993 - | );
|
6994 - | ::pretty_assertions::assert_eq!(
|
6995 - | input.iso8601_timestamp,
|
6996 - | expected.iso8601_timestamp,
|
6997 - | "Unexpected value for `iso8601_timestamp`"
|
6998 - | );
|
6999 - | ::pretty_assertions::assert_eq!(
|
7000 - | input.json_value,
|
7001 - | expected.json_value,
|
7002 - | "Unexpected value for `json_value`"
|
7003 - | );
|
7004 - | ::pretty_assertions::assert_eq!(
|
7005 - | input.list_of_lists,
|
7006 - | expected.list_of_lists,
|
7007 - | "Unexpected value for `list_of_lists`"
|
7008 - | );
|
7009 - | ::pretty_assertions::assert_eq!(
|
7010 - | input.list_of_maps_of_strings,
|
7011 - | expected.list_of_maps_of_strings,
|
7012 - | "Unexpected value for `list_of_maps_of_strings`"
|
7013 - | );
|
7014 - | ::pretty_assertions::assert_eq!(
|
7015 - | input.list_of_strings,
|
7016 - | expected.list_of_strings,
|
7017 - | "Unexpected value for `list_of_strings`"
|
7018 - | );
|
7019 - | ::pretty_assertions::assert_eq!(
|
7020 - | input.list_of_structs,
|
7021 - | expected.list_of_structs,
|
7022 - | "Unexpected value for `list_of_structs`"
|
7023 - | );
|
7024 - | ::pretty_assertions::assert_eq!(
|
7025 - | input.long,
|
7026 - | expected.long,
|
7027 - | "Unexpected value for `long`"
|
7028 - | );
|
7029 - | ::pretty_assertions::assert_eq!(
|
7030 - | input.map_of_lists_of_strings,
|
7031 - | expected.map_of_lists_of_strings,
|
7032 - | "Unexpected value for `map_of_lists_of_strings`"
|
7033 - | );
|
7034 - | ::pretty_assertions::assert_eq!(
|
7035 - | input.map_of_maps,
|
7036 - | expected.map_of_maps,
|
7037 - | "Unexpected value for `map_of_maps`"
|
7038 - | );
|
7039 - | ::pretty_assertions::assert_eq!(
|
7040 - | input.map_of_strings,
|
7041 - | expected.map_of_strings,
|
7042 - | "Unexpected value for `map_of_strings`"
|
7043 - | );
|
7044 - | ::pretty_assertions::assert_eq!(
|
7045 - | input.map_of_structs,
|
7046 - | expected.map_of_structs,
|
7047 - | "Unexpected value for `map_of_structs`"
|
7048 - | );
|
7049 - | ::pretty_assertions::assert_eq!(
|
7050 - | input.recursive_list,
|
7051 - | expected.recursive_list,
|
7052 - | "Unexpected value for `recursive_list`"
|
7053 - | );
|
7054 - | ::pretty_assertions::assert_eq!(
|
7055 - | input.recursive_map,
|
7056 - | expected.recursive_map,
|
7057 - | "Unexpected value for `recursive_map`"
|
7058 - | );
|
7059 - | ::pretty_assertions::assert_eq!(
|
7060 - | input.recursive_struct,
|
7061 - | expected.recursive_struct,
|
7062 - | "Unexpected value for `recursive_struct`"
|
7063 - | );
|
7064 - | ::pretty_assertions::assert_eq!(
|
7065 - | input.simple_struct,
|
7066 - | expected.simple_struct,
|
7067 - | "Unexpected value for `simple_struct`"
|
7068 - | );
|
7069 - | ::pretty_assertions::assert_eq!(
|
7070 - | input.string,
|
7071 - | expected.string,
|
7072 - | "Unexpected value for `string`"
|
7073 - | );
|
7074 - | ::pretty_assertions::assert_eq!(
|
7075 - | input.struct_with_json_name,
|
7076 - | expected.struct_with_json_name,
|
7077 - | "Unexpected value for `struct_with_json_name`"
|
7078 - | );
|
7079 - | ::pretty_assertions::assert_eq!(
|
7080 - | input.timestamp,
|
7081 - | expected.timestamp,
|
7082 - | "Unexpected value for `timestamp`"
|
7083 - | );
|
7084 - | ::pretty_assertions::assert_eq!(
|
7085 - | input.unix_timestamp,
|
7086 - | expected.unix_timestamp,
|
7087 - | "Unexpected value for `unix_timestamp`"
|
7088 - | );
|
7089 - | let output = crate::output::KitchenSinkOperationOutput {
|
7090 - | blob: ::std::option::Option::None,
|
7091 - | boolean: ::std::option::Option::None,
|
7092 - | double: ::std::option::Option::None,
|
7093 - | empty_struct: ::std::option::Option::None,
|
7094 - | float: ::std::option::Option::None,
|
7095 - | httpdate_timestamp: ::std::option::Option::None,
|
7096 - | integer: ::std::option::Option::None,
|
7097 - | iso8601_timestamp: ::std::option::Option::None,
|
7098 - | json_value: ::std::option::Option::None,
|
7099 - | list_of_lists: ::std::option::Option::None,
|
7100 - | list_of_maps_of_strings: ::std::option::Option::None,
|
7101 - | list_of_strings: ::std::option::Option::None,
|
7102 - | list_of_structs: ::std::option::Option::None,
|
7103 - | long: ::std::option::Option::None,
|
7104 - | map_of_lists_of_strings: ::std::option::Option::None,
|
7105 - | map_of_maps: ::std::option::Option::None,
|
7106 - | map_of_strings: ::std::option::Option::None,
|
7107 - | map_of_structs: ::std::option::Option::None,
|
7108 - | recursive_list: ::std::option::Option::None,
|
7109 - | recursive_map: ::std::option::Option::None,
|
7110 - | recursive_struct: ::std::option::Option::None,
|
7111 - | simple_struct: ::std::option::Option::None,
|
7112 - | string: ::std::option::Option::None,
|
7113 - | struct_with_json_name: ::std::option::Option::None,
|
7114 - | timestamp: ::std::option::Option::None,
|
7115 - | unix_timestamp: ::std::option::Option::None,
|
7116 - | };
|
7117 - | Ok(output)
|
6748 + | let service = crate::service::JsonProtocol::builder::<
|
6749 + | ::aws_smithy_http_server::body::BoxBody,
|
6750 + | _,
|
6751 + | _,
|
6752 + | _,
|
6753 + | >(config)
|
6754 + | .kitchen_sink_operation(move |input: crate::input::KitchenSinkOperationInput| {
|
6755 + | let sender = sender.clone();
|
6756 + | async move {
|
6757 + | let result = {
|
6758 + | use ::aws_smithy_protocol_test::FloatEquals;
|
6759 + | let expected = crate::input::KitchenSinkOperationInput {
|
6760 + | unix_timestamp: ::std::option::Option::Some(
|
6761 + | ::aws_smithy_types::DateTime::from_fractional_secs(946845296, 0_f64),
|
6762 + | ),
|
6763 + | blob: ::std::option::Option::None,
|
6764 + | boolean: ::std::option::Option::None,
|
6765 + | double: ::std::option::Option::None,
|
6766 + | empty_struct: ::std::option::Option::None,
|
6767 + | float: ::std::option::Option::None,
|
6768 + | httpdate_timestamp: ::std::option::Option::None,
|
6769 + | integer: ::std::option::Option::None,
|
6770 + | iso8601_timestamp: ::std::option::Option::None,
|
6771 + | json_value: ::std::option::Option::None,
|
6772 + | list_of_lists: ::std::option::Option::None,
|
6773 + | list_of_maps_of_strings: ::std::option::Option::None,
|
6774 + | list_of_strings: ::std::option::Option::None,
|
6775 + | list_of_structs: ::std::option::Option::None,
|
6776 + | long: ::std::option::Option::None,
|
6777 + | map_of_lists_of_strings: ::std::option::Option::None,
|
6778 + | map_of_maps: ::std::option::Option::None,
|
6779 + | map_of_strings: ::std::option::Option::None,
|
6780 + | map_of_structs: ::std::option::Option::None,
|
6781 + | recursive_list: ::std::option::Option::None,
|
6782 + | recursive_map: ::std::option::Option::None,
|
6783 + | recursive_struct: ::std::option::Option::None,
|
6784 + | simple_struct: ::std::option::Option::None,
|
6785 + | string: ::std::option::Option::None,
|
6786 + | struct_with_json_name: ::std::option::Option::None,
|
6787 + | timestamp: ::std::option::Option::None,
|
7118 6788 | };
|
7119 - | sender.send(()).await.expect("receiver dropped early");
|
7120 - | result
|
7121 - | }
|
7122 - | })
|
7123 - | .build_unchecked();
|
7124 - | let http_response = ::tower::ServiceExt::oneshot(service, http_request)
|
7125 - | .await
|
7126 - | .expect("unable to make an HTTP request");
|
7127 - | assert!(
|
7128 - | receiver.recv().await.is_some(),
|
7129 - | "we expected operation handler to be invoked but it was not entered"
|
7130 - | );
|
7131 - | }
|
7132 - |
|
7133 - | /// Serializes list of map shapes
|
7134 - | /// Test ID: serializes_list_of_map_shapes
|
7135 - | #[::tokio::test]
|
7136 - | #[::tracing_test::traced_test]
|
7137 - | async fn serializes_list_of_map_shapes_request() {
|
7138 - | #[allow(unused_mut)]
|
7139 - | let mut http_request = http::Request::builder()
|
7140 - | .uri("/")
|
7141 - | .method("POST")
|
7142 - | .header("Content-Type", "application/x-amz-json-1.1")
|
7143 - | .header("X-Amz-Target", "JsonProtocol.KitchenSinkOperation")
|
7144 - | .body(::aws_smithy_http_server::body::Body::from(
|
7145 - | ::bytes::Bytes::copy_from_slice(
|
7146 - | &::aws_smithy_protocol_test::decode_body_data("{\"ListOfMapsOfStrings\":[{\"foo\":\"bar\"},{\"abc\":\"xyz\"},{\"red\":\"blue\"}]}".as_bytes(), ::aws_smithy_protocol_test::MediaType::from("application/json"))
|
7147 - | )
|
7148 - | )).unwrap();
|
7149 - | #[allow(unused_mut)]
|
7150 - | let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
|
7151 - | let config = crate::service::JsonProtocolConfig::builder().build();
|
7152 - | let service = crate::service::JsonProtocol::builder::<::hyper::body::Body, _, _, _>(config)
|
7153 - | .kitchen_sink_operation(move |input: crate::input::KitchenSinkOperationInput| {
|
7154 - | let sender = sender.clone();
|
7155 - | async move {
|
7156 - | let result = {
|
7157 - | use ::aws_smithy_protocol_test::FloatEquals;
|
7158 - | let expected = crate::input::KitchenSinkOperationInput {
|
7159 - | list_of_maps_of_strings: ::std::option::Option::Some(vec![
|
7160 - | {
|
7161 - | let mut ret = ::std::collections::HashMap::new();
|
7162 - | ret.insert("foo".to_owned(), "bar".to_owned());
|
7163 - | ret
|
7164 - | },
|
7165 - | {
|
7166 - | let mut ret = ::std::collections::HashMap::new();
|
7167 - | ret.insert("abc".to_owned(), "xyz".to_owned());
|
7168 - | ret
|
7169 - | },
|
7170 - | {
|
7171 - | let mut ret = ::std::collections::HashMap::new();
|
7172 - | ret.insert("red".to_owned(), "blue".to_owned());
|
7173 - | ret
|
7174 - | },
|
7175 - | ]),
|
7176 - | blob: ::std::option::Option::None,
|
7177 - | boolean: ::std::option::Option::None,
|
7178 - | double: ::std::option::Option::None,
|
7179 - | empty_struct: ::std::option::Option::None,
|
7180 - | float: ::std::option::Option::None,
|
7181 - | httpdate_timestamp: ::std::option::Option::None,
|
7182 - | integer: ::std::option::Option::None,
|
7183 - | iso8601_timestamp: ::std::option::Option::None,
|
7184 - | json_value: ::std::option::Option::None,
|
7185 - | list_of_lists: ::std::option::Option::None,
|
7186 - | list_of_strings: ::std::option::Option::None,
|
7187 - | list_of_structs: ::std::option::Option::None,
|
7188 - | long: ::std::option::Option::None,
|
7189 - | map_of_lists_of_strings: ::std::option::Option::None,
|
7190 - | map_of_maps: ::std::option::Option::None,
|
7191 - | map_of_strings: ::std::option::Option::None,
|
7192 - | map_of_structs: ::std::option::Option::None,
|
7193 - | recursive_list: ::std::option::Option::None,
|
7194 - | recursive_map: ::std::option::Option::None,
|
7195 - | recursive_struct: ::std::option::Option::None,
|
7196 - | simple_struct: ::std::option::Option::None,
|
7197 - | string: ::std::option::Option::None,
|
7198 - | struct_with_json_name: ::std::option::Option::None,
|
7199 - | timestamp: ::std::option::Option::None,
|
7200 - | unix_timestamp: ::std::option::Option::None,
|
7201 - | };
|
7202 - | ::pretty_assertions::assert_eq!(
|
7203 - | input.blob,
|
7204 - | expected.blob,
|
7205 - | "Unexpected value for `blob`"
|
7206 - | );
|
7207 - | ::pretty_assertions::assert_eq!(
|
7208 - | input.boolean,
|
7209 - | expected.boolean,
|
7210 - | "Unexpected value for `boolean`"
|
7211 - | );
|
7212 - | assert!(
|
7213 - | input.double.float_equals(&expected.double),
|
7214 - | "Unexpected value for `double` {:?} vs. {:?}",
|
7215 - | expected.double,
|
7216 - | input.double
|
7217 - | );
|
7218 - | ::pretty_assertions::assert_eq!(
|
7219 - | input.empty_struct,
|
7220 - | expected.empty_struct,
|
7221 - | "Unexpected value for `empty_struct`"
|
7222 - | );
|
7223 - | assert!(
|
7224 - | input.float.float_equals(&expected.float),
|
7225 - | "Unexpected value for `float` {:?} vs. {:?}",
|
7226 - | expected.float,
|
7227 - | input.float
|
7228 - | );
|
7229 - | ::pretty_assertions::assert_eq!(
|
7230 - | input.httpdate_timestamp,
|
7231 - | expected.httpdate_timestamp,
|
7232 - | "Unexpected value for `httpdate_timestamp`"
|
7233 - | );
|
7234 - | ::pretty_assertions::assert_eq!(
|
7235 - | input.integer,
|
7236 - | expected.integer,
|
7237 - | "Unexpected value for `integer`"
|
7238 - | );
|
7239 - | ::pretty_assertions::assert_eq!(
|
7240 - | input.iso8601_timestamp,
|
7241 - | expected.iso8601_timestamp,
|
7242 - | "Unexpected value for `iso8601_timestamp`"
|
7243 - | );
|
7244 - | ::pretty_assertions::assert_eq!(
|
7245 - | input.json_value,
|
7246 - | expected.json_value,
|
7247 - | "Unexpected value for `json_value`"
|
7248 - | );
|
7249 - | ::pretty_assertions::assert_eq!(
|
7250 - | input.list_of_lists,
|
7251 - | expected.list_of_lists,
|
7252 - | "Unexpected value for `list_of_lists`"
|
7253 - | );
|
7254 - | ::pretty_assertions::assert_eq!(
|
7255 - | input.list_of_maps_of_strings,
|
7256 - | expected.list_of_maps_of_strings,
|
7257 - | "Unexpected value for `list_of_maps_of_strings`"
|
7258 - | );
|
7259 - | ::pretty_assertions::assert_eq!(
|
7260 - | input.list_of_strings,
|
7261 - | expected.list_of_strings,
|
7262 - | "Unexpected value for `list_of_strings`"
|
7263 - | );
|
7264 - | ::pretty_assertions::assert_eq!(
|
7265 - | input.list_of_structs,
|
7266 - | expected.list_of_structs,
|
7267 - | "Unexpected value for `list_of_structs`"
|
7268 - | );
|
7269 - | ::pretty_assertions::assert_eq!(
|
7270 - | input.long,
|
7271 - | expected.long,
|
7272 - | "Unexpected value for `long`"
|
7273 - | );
|
7274 - | ::pretty_assertions::assert_eq!(
|
7275 - | input.map_of_lists_of_strings,
|
7276 - | expected.map_of_lists_of_strings,
|
7277 - | "Unexpected value for `map_of_lists_of_strings`"
|
7278 - | );
|
7279 - | ::pretty_assertions::assert_eq!(
|
7280 - | input.map_of_maps,
|
7281 - | expected.map_of_maps,
|
7282 - | "Unexpected value for `map_of_maps`"
|
7283 - | );
|
7284 - | ::pretty_assertions::assert_eq!(
|
7285 - | input.map_of_strings,
|
7286 - | expected.map_of_strings,
|
7287 - | "Unexpected value for `map_of_strings`"
|
7288 - | );
|
7289 - | ::pretty_assertions::assert_eq!(
|
7290 - | input.map_of_structs,
|
7291 - | expected.map_of_structs,
|
7292 - | "Unexpected value for `map_of_structs`"
|
7293 - | );
|
7294 - | ::pretty_assertions::assert_eq!(
|
7295 - | input.recursive_list,
|
7296 - | expected.recursive_list,
|
7297 - | "Unexpected value for `recursive_list`"
|
7298 - | );
|
7299 - | ::pretty_assertions::assert_eq!(
|
7300 - | input.recursive_map,
|
7301 - | expected.recursive_map,
|
7302 - | "Unexpected value for `recursive_map`"
|
7303 - | );
|
7304 - | ::pretty_assertions::assert_eq!(
|
7305 - | input.recursive_struct,
|
7306 - | expected.recursive_struct,
|
7307 - | "Unexpected value for `recursive_struct`"
|
7308 - | );
|
7309 - | ::pretty_assertions::assert_eq!(
|
7310 - | input.simple_struct,
|
7311 - | expected.simple_struct,
|
7312 - | "Unexpected value for `simple_struct`"
|
7313 - | );
|
7314 - | ::pretty_assertions::assert_eq!(
|
7315 - | input.string,
|
7316 - | expected.string,
|
7317 - | "Unexpected value for `string`"
|
7318 - | );
|
7319 - | ::pretty_assertions::assert_eq!(
|
7320 - | input.struct_with_json_name,
|
7321 - | expected.struct_with_json_name,
|
7322 - | "Unexpected value for `struct_with_json_name`"
|
7323 - | );
|
7324 - | ::pretty_assertions::assert_eq!(
|
7325 - | input.timestamp,
|
7326 - | expected.timestamp,
|
7327 - | "Unexpected value for `timestamp`"
|
7328 - | );
|
7329 - | ::pretty_assertions::assert_eq!(
|
7330 - | input.unix_timestamp,
|
7331 - | expected.unix_timestamp,
|
7332 - | "Unexpected value for `unix_timestamp`"
|
7333 - | );
|
7334 - | let output = crate::output::KitchenSinkOperationOutput {
|
7335 - | blob: ::std::option::Option::None,
|
7336 - | boolean: ::std::option::Option::None,
|
7337 - | double: ::std::option::Option::None,
|
7338 - | empty_struct: ::std::option::Option::None,
|
7339 - | float: ::std::option::Option::None,
|
7340 - | httpdate_timestamp: ::std::option::Option::None,
|
7341 - | integer: ::std::option::Option::None,
|
7342 - | iso8601_timestamp: ::std::option::Option::None,
|
7343 - | json_value: ::std::option::Option::None,
|
7344 - | list_of_lists: ::std::option::Option::None,
|
7345 - | list_of_maps_of_strings: ::std::option::Option::None,
|
7346 - | list_of_strings: ::std::option::Option::None,
|
7347 - | list_of_structs: ::std::option::Option::None,
|
7348 - | long: ::std::option::Option::None,
|
7349 - | map_of_lists_of_strings: ::std::option::Option::None,
|
7350 - | map_of_maps: ::std::option::Option::None,
|
7351 - | map_of_strings: ::std::option::Option::None,
|
7352 - | map_of_structs: ::std::option::Option::None,
|
7353 - | recursive_list: ::std::option::Option::None,
|
7354 - | recursive_map: ::std::option::Option::None,
|
7355 - | recursive_struct: ::std::option::Option::None,
|
7356 - | simple_struct: ::std::option::Option::None,
|
7357 - | string: ::std::option::Option::None,
|
7358 - | struct_with_json_name: ::std::option::Option::None,
|
7359 - | timestamp: ::std::option::Option::None,
|
7360 - | unix_timestamp: ::std::option::Option::None,
|
7361 - | };
|
7362 - | Ok(output)
|
6789 + | ::pretty_assertions::assert_eq!(
|
6790 + | input.blob,
|
6791 + | expected.blob,
|
6792 + | "Unexpected value for `blob`"
|
6793 + | );
|
6794 + | ::pretty_assertions::assert_eq!(
|
6795 + | input.boolean,
|
6796 + | expected.boolean,
|
6797 + | "Unexpected value for `boolean`"
|
6798 + | );
|
6799 + | assert!(
|
6800 + | input.double.float_equals(&expected.double),
|
6801 + | "Unexpected value for `double` {:?} vs. {:?}",
|
6802 + | expected.double,
|
6803 + | input.double
|
6804 + | );
|
6805 + | ::pretty_assertions::assert_eq!(
|
6806 + | input.empty_struct,
|
6807 + | expected.empty_struct,
|
6808 + | "Unexpected value for `empty_struct`"
|
6809 + | );
|
6810 + | assert!(
|
6811 + | input.float.float_equals(&expected.float),
|
6812 + | "Unexpected value for `float` {:?} vs. {:?}",
|
6813 + | expected.float,
|
6814 + | input.float
|
6815 + | );
|
6816 + | ::pretty_assertions::assert_eq!(
|
6817 + | input.httpdate_timestamp,
|
6818 + | expected.httpdate_timestamp,
|
6819 + | "Unexpected value for `httpdate_timestamp`"
|
6820 + | );
|
6821 + | ::pretty_assertions::assert_eq!(
|
6822 + | input.integer,
|
6823 + | expected.integer,
|
6824 + | "Unexpected value for `integer`"
|
6825 + | );
|
6826 + | ::pretty_assertions::assert_eq!(
|
6827 + | input.iso8601_timestamp,
|
6828 + | expected.iso8601_timestamp,
|
6829 + | "Unexpected value for `iso8601_timestamp`"
|
6830 + | );
|
6831 + | ::pretty_assertions::assert_eq!(
|
6832 + | input.json_value,
|
6833 + | expected.json_value,
|
6834 + | "Unexpected value for `json_value`"
|
6835 + | );
|
6836 + | ::pretty_assertions::assert_eq!(
|
6837 + | input.list_of_lists,
|
6838 + | expected.list_of_lists,
|
6839 + | "Unexpected value for `list_of_lists`"
|
6840 + | );
|
6841 + | ::pretty_assertions::assert_eq!(
|
6842 + | input.list_of_maps_of_strings,
|
6843 + | expected.list_of_maps_of_strings,
|
6844 + | "Unexpected value for `list_of_maps_of_strings`"
|
6845 + | );
|
6846 + | ::pretty_assertions::assert_eq!(
|
6847 + | input.list_of_strings,
|
6848 + | expected.list_of_strings,
|
6849 + | "Unexpected value for `list_of_strings`"
|
6850 + | );
|
6851 + | ::pretty_assertions::assert_eq!(
|
6852 + | input.list_of_structs,
|
6853 + | expected.list_of_structs,
|
6854 + | "Unexpected value for `list_of_structs`"
|
6855 + | );
|
6856 + | ::pretty_assertions::assert_eq!(
|
6857 + | input.long,
|
6858 + | expected.long,
|
6859 + | "Unexpected value for `long`"
|
6860 + | );
|
6861 + | ::pretty_assertions::assert_eq!(
|
6862 + | input.map_of_lists_of_strings,
|
6863 + | expected.map_of_lists_of_strings,
|
6864 + | "Unexpected value for `map_of_lists_of_strings`"
|
6865 + | );
|
6866 + | ::pretty_assertions::assert_eq!(
|
6867 + | input.map_of_maps,
|
6868 + | expected.map_of_maps,
|
6869 + | "Unexpected value for `map_of_maps`"
|
6870 + | );
|
6871 + | ::pretty_assertions::assert_eq!(
|
6872 + | input.map_of_strings,
|
6873 + | expected.map_of_strings,
|
6874 + | "Unexpected value for `map_of_strings`"
|
6875 + | );
|
6876 + | ::pretty_assertions::assert_eq!(
|
6877 + | input.map_of_structs,
|
6878 + | expected.map_of_structs,
|
6879 + | "Unexpected value for `map_of_structs`"
|
6880 + | );
|
6881 + | ::pretty_assertions::assert_eq!(
|
6882 + | input.recursive_list,
|
6883 + | expected.recursive_list,
|
6884 + | "Unexpected value for `recursive_list`"
|
6885 + | );
|
6886 + | ::pretty_assertions::assert_eq!(
|
6887 + | input.recursive_map,
|
6888 + | expected.recursive_map,
|
6889 + | "Unexpected value for `recursive_map`"
|
6890 + | );
|
6891 + | ::pretty_assertions::assert_eq!(
|
6892 + | input.recursive_struct,
|
6893 + | expected.recursive_struct,
|
6894 + | "Unexpected value for `recursive_struct`"
|
6895 + | );
|
6896 + | ::pretty_assertions::assert_eq!(
|
6897 + | input.simple_struct,
|
6898 + | expected.simple_struct,
|
6899 + | "Unexpected value for `simple_struct`"
|
6900 + | );
|
6901 + | ::pretty_assertions::assert_eq!(
|
6902 + | input.string,
|
6903 + | expected.string,
|
6904 + | "Unexpected value for `string`"
|
6905 + | );
|
6906 + | ::pretty_assertions::assert_eq!(
|
6907 + | input.struct_with_json_name,
|
6908 + | expected.struct_with_json_name,
|
6909 + | "Unexpected value for `struct_with_json_name`"
|
6910 + | );
|
6911 + | ::pretty_assertions::assert_eq!(
|
6912 + | input.timestamp,
|
6913 + | expected.timestamp,
|
6914 + | "Unexpected value for `timestamp`"
|
6915 + | );
|
6916 + | ::pretty_assertions::assert_eq!(
|
6917 + | input.unix_timestamp,
|
6918 + | expected.unix_timestamp,
|
6919 + | "Unexpected value for `unix_timestamp`"
|
6920 + | );
|
6921 + | let output = crate::output::KitchenSinkOperationOutput {
|
6922 + | blob: ::std::option::Option::None,
|
6923 + | boolean: ::std::option::Option::None,
|
6924 + | double: ::std::option::Option::None,
|
6925 + | empty_struct: ::std::option::Option::None,
|
6926 + | float: ::std::option::Option::None,
|
6927 + | httpdate_timestamp: ::std::option::Option::None,
|
6928 + | integer: ::std::option::Option::None,
|
6929 + | iso8601_timestamp: ::std::option::Option::None,
|
6930 + | json_value: ::std::option::Option::None,
|
6931 + | list_of_lists: ::std::option::Option::None,
|
6932 + | list_of_maps_of_strings: ::std::option::Option::None,
|
6933 + | list_of_strings: ::std::option::Option::None,
|
6934 + | list_of_structs: ::std::option::Option::None,
|
6935 + | long: ::std::option::Option::None,
|
6936 + | map_of_lists_of_strings: ::std::option::Option::None,
|
6937 + | map_of_maps: ::std::option::Option::None,
|
6938 + | map_of_strings: ::std::option::Option::None,
|
6939 + | map_of_structs: ::std::option::Option::None,
|
6940 + | recursive_list: ::std::option::Option::None,
|
6941 + | recursive_map: ::std::option::Option::None,
|
6942 + | recursive_struct: ::std::option::Option::None,
|
6943 + | simple_struct: ::std::option::Option::None,
|
6944 + | string: ::std::option::Option::None,
|
6945 + | struct_with_json_name: ::std::option::Option::None,
|
6946 + | timestamp: ::std::option::Option::None,
|
6947 + | unix_timestamp: ::std::option::Option::None,
|
7363 6948 | };
|
7364 - | sender.send(()).await.expect("receiver dropped early");
|
7365 - | result
|
7366 - | }
|
7367 - | })
|
7368 - | .build_unchecked();
|
6949 + | Ok(output)
|
6950 + | };
|
6951 + | sender.send(()).await.expect("receiver dropped early");
|
6952 + | result
|
6953 + | }
|
6954 + | })
|
6955 + | .build_unchecked();
|
7369 6956 | let http_response = ::tower::ServiceExt::oneshot(service, http_request)
|
7370 6957 | .await
|
7371 6958 | .expect("unable to make an HTTP request");
|
7372 6959 | assert!(
|
7373 6960 | receiver.recv().await.is_some(),
|
7374 6961 | "we expected operation handler to be invoked but it was not entered"
|
7375 6962 | );
|
7376 6963 | }
|
7377 6964 |
|
7378 - | /// Serializes list of structure shapes
|
7379 - | /// Test ID: serializes_list_of_structure_shapes
|
6965 + | /// Serializes list shapes
|
6966 + | /// Test ID: serializes_list_shapes
|
7380 6967 | #[::tokio::test]
|
7381 6968 | #[::tracing_test::traced_test]
|
7382 - | async fn serializes_list_of_structure_shapes_request() {
|
6969 + | async fn serializes_list_shapes_request() {
|
7383 6970 | #[allow(unused_mut)]
|
7384 - | let mut http_request = http::Request::builder()
|
7385 - | .uri("/")
|
7386 - | .method("POST")
|
7387 - | .header("Content-Type", "application/x-amz-json-1.1")
|
7388 - | .header("X-Amz-Target", "JsonProtocol.KitchenSinkOperation")
|
7389 - | .body(::aws_smithy_http_server::body::Body::from(
|
7390 - | ::bytes::Bytes::copy_from_slice(
|
7391 - | &::aws_smithy_protocol_test::decode_body_data("{\"ListOfStructs\":[{\"Value\":\"abc\"},{\"Value\":\"mno\"},{\"Value\":\"xyz\"}]}".as_bytes(), ::aws_smithy_protocol_test::MediaType::from("application/json"))
|
7392 - | )
|
7393 - | )).unwrap();
|
6971 + | let mut http_request = ::http_1x::Request::builder()
|
6972 + | .uri("/")
|
6973 + | .method("POST")
|
6974 + | .header("Content-Type", "application/x-amz-json-1.1")
|
6975 + | .header("X-Amz-Target", "JsonProtocol.KitchenSinkOperation")
|
6976 + | .body(::aws_smithy_http_server::body::boxed(
|
6977 + | ::http_body_util::Full::new(::bytes::Bytes::copy_from_slice(
|
6978 + | &::aws_smithy_protocol_test::decode_body_data(
|
6979 + | "{\"ListOfStrings\":[\"abc\",\"mno\",\"xyz\"]}".as_bytes(),
|
6980 + | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
6981 + | ),
|
6982 + | )),
|
6983 + | ))
|
6984 + | .unwrap();
|
7394 6985 | #[allow(unused_mut)]
|
7395 6986 | let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
|
7396 6987 | let config = crate::service::JsonProtocolConfig::builder().build();
|
7397 - | let service = crate::service::JsonProtocol::builder::<::hyper::body::Body, _, _, _>(config)
|
7398 - | .kitchen_sink_operation(move |input: crate::input::KitchenSinkOperationInput| {
|
7399 - | let sender = sender.clone();
|
7400 - | async move {
|
7401 - | let result = {
|
7402 - | use ::aws_smithy_protocol_test::FloatEquals;
|
7403 - | let expected = crate::input::KitchenSinkOperationInput {
|
7404 - | list_of_structs: ::std::option::Option::Some(vec![
|
7405 - | crate::model::SimpleStruct {
|
7406 - | value: ::std::option::Option::Some("abc".to_owned()),
|
7407 - | },
|
7408 - | crate::model::SimpleStruct {
|
7409 - | value: ::std::option::Option::Some("mno".to_owned()),
|
7410 - | },
|
7411 - | crate::model::SimpleStruct {
|
7412 - | value: ::std::option::Option::Some("xyz".to_owned()),
|
7413 - | },
|
7414 - | ]),
|
7415 - | blob: ::std::option::Option::None,
|
7416 - | boolean: ::std::option::Option::None,
|
7417 - | double: ::std::option::Option::None,
|
7418 - | empty_struct: ::std::option::Option::None,
|
7419 - | float: ::std::option::Option::None,
|
7420 - | httpdate_timestamp: ::std::option::Option::None,
|
7421 - | integer: ::std::option::Option::None,
|
7422 - | iso8601_timestamp: ::std::option::Option::None,
|
7423 - | json_value: ::std::option::Option::None,
|
7424 - | list_of_lists: ::std::option::Option::None,
|
7425 - | list_of_maps_of_strings: ::std::option::Option::None,
|
7426 - | list_of_strings: ::std::option::Option::None,
|
7427 - | long: ::std::option::Option::None,
|
7428 - | map_of_lists_of_strings: ::std::option::Option::None,
|
7429 - | map_of_maps: ::std::option::Option::None,
|
7430 - | map_of_strings: ::std::option::Option::None,
|
7431 - | map_of_structs: ::std::option::Option::None,
|
7432 - | recursive_list: ::std::option::Option::None,
|
7433 - | recursive_map: ::std::option::Option::None,
|
7434 - | recursive_struct: ::std::option::Option::None,
|
7435 - | simple_struct: ::std::option::Option::None,
|
7436 - | string: ::std::option::Option::None,
|
7437 - | struct_with_json_name: ::std::option::Option::None,
|
7438 - | timestamp: ::std::option::Option::None,
|
7439 - | unix_timestamp: ::std::option::Option::None,
|
7440 - | };
|
7441 - | ::pretty_assertions::assert_eq!(
|
7442 - | input.blob,
|
7443 - | expected.blob,
|
7444 - | "Unexpected value for `blob`"
|
7445 - | );
|
7446 - | ::pretty_assertions::assert_eq!(
|
7447 - | input.boolean,
|
7448 - | expected.boolean,
|
7449 - | "Unexpected value for `boolean`"
|
7450 - | );
|
7451 - | assert!(
|
7452 - | input.double.float_equals(&expected.double),
|
7453 - | "Unexpected value for `double` {:?} vs. {:?}",
|
7454 - | expected.double,
|
7455 - | input.double
|
7456 - | );
|
7457 - | ::pretty_assertions::assert_eq!(
|
7458 - | input.empty_struct,
|
7459 - | expected.empty_struct,
|
7460 - | "Unexpected value for `empty_struct`"
|
7461 - | );
|
7462 - | assert!(
|
7463 - | input.float.float_equals(&expected.float),
|
7464 - | "Unexpected value for `float` {:?} vs. {:?}",
|
7465 - | expected.float,
|
7466 - | input.float
|
7467 - | );
|
7468 - | ::pretty_assertions::assert_eq!(
|
7469 - | input.httpdate_timestamp,
|
7470 - | expected.httpdate_timestamp,
|
7471 - | "Unexpected value for `httpdate_timestamp`"
|
7472 - | );
|
7473 - | ::pretty_assertions::assert_eq!(
|
7474 - | input.integer,
|
7475 - | expected.integer,
|
7476 - | "Unexpected value for `integer`"
|
7477 - | );
|
7478 - | ::pretty_assertions::assert_eq!(
|
7479 - | input.iso8601_timestamp,
|
7480 - | expected.iso8601_timestamp,
|
7481 - | "Unexpected value for `iso8601_timestamp`"
|
7482 - | );
|
7483 - | ::pretty_assertions::assert_eq!(
|
7484 - | input.json_value,
|
7485 - | expected.json_value,
|
7486 - | "Unexpected value for `json_value`"
|
7487 - | );
|
7488 - | ::pretty_assertions::assert_eq!(
|
7489 - | input.list_of_lists,
|
7490 - | expected.list_of_lists,
|
7491 - | "Unexpected value for `list_of_lists`"
|
7492 - | );
|
7493 - | ::pretty_assertions::assert_eq!(
|
7494 - | input.list_of_maps_of_strings,
|
7495 - | expected.list_of_maps_of_strings,
|
7496 - | "Unexpected value for `list_of_maps_of_strings`"
|
7497 - | );
|
7498 - | ::pretty_assertions::assert_eq!(
|
7499 - | input.list_of_strings,
|
7500 - | expected.list_of_strings,
|
7501 - | "Unexpected value for `list_of_strings`"
|
7502 - | );
|
7503 - | ::pretty_assertions::assert_eq!(
|
7504 - | input.list_of_structs,
|
7505 - | expected.list_of_structs,
|
7506 - | "Unexpected value for `list_of_structs`"
|
7507 - | );
|
7508 - | ::pretty_assertions::assert_eq!(
|
7509 - | input.long,
|
7510 - | expected.long,
|
7511 - | "Unexpected value for `long`"
|
7512 - | );
|
7513 - | ::pretty_assertions::assert_eq!(
|
7514 - | input.map_of_lists_of_strings,
|
7515 - | expected.map_of_lists_of_strings,
|
7516 - | "Unexpected value for `map_of_lists_of_strings`"
|
7517 - | );
|
7518 - | ::pretty_assertions::assert_eq!(
|
7519 - | input.map_of_maps,
|
7520 - | expected.map_of_maps,
|
7521 - | "Unexpected value for `map_of_maps`"
|
7522 - | );
|
7523 - | ::pretty_assertions::assert_eq!(
|
7524 - | input.map_of_strings,
|
7525 - | expected.map_of_strings,
|
7526 - | "Unexpected value for `map_of_strings`"
|
7527 - | );
|
7528 - | ::pretty_assertions::assert_eq!(
|
7529 - | input.map_of_structs,
|
7530 - | expected.map_of_structs,
|
7531 - | "Unexpected value for `map_of_structs`"
|
7532 - | );
|
7533 - | ::pretty_assertions::assert_eq!(
|
7534 - | input.recursive_list,
|
7535 - | expected.recursive_list,
|
7536 - | "Unexpected value for `recursive_list`"
|
7537 - | );
|
7538 - | ::pretty_assertions::assert_eq!(
|
7539 - | input.recursive_map,
|
7540 - | expected.recursive_map,
|
7541 - | "Unexpected value for `recursive_map`"
|
7542 - | );
|
7543 - | ::pretty_assertions::assert_eq!(
|
7544 - | input.recursive_struct,
|
7545 - | expected.recursive_struct,
|
7546 - | "Unexpected value for `recursive_struct`"
|
7547 - | );
|
7548 - | ::pretty_assertions::assert_eq!(
|
7549 - | input.simple_struct,
|
7550 - | expected.simple_struct,
|
7551 - | "Unexpected value for `simple_struct`"
|
7552 - | );
|
7553 - | ::pretty_assertions::assert_eq!(
|
7554 - | input.string,
|
7555 - | expected.string,
|
7556 - | "Unexpected value for `string`"
|
7557 - | );
|
7558 - | ::pretty_assertions::assert_eq!(
|
7559 - | input.struct_with_json_name,
|
7560 - | expected.struct_with_json_name,
|
7561 - | "Unexpected value for `struct_with_json_name`"
|
7562 - | );
|
7563 - | ::pretty_assertions::assert_eq!(
|
7564 - | input.timestamp,
|
7565 - | expected.timestamp,
|
7566 - | "Unexpected value for `timestamp`"
|
7567 - | );
|
7568 - | ::pretty_assertions::assert_eq!(
|
7569 - | input.unix_timestamp,
|
7570 - | expected.unix_timestamp,
|
7571 - | "Unexpected value for `unix_timestamp`"
|
7572 - | );
|
7573 - | let output = crate::output::KitchenSinkOperationOutput {
|
7574 - | blob: ::std::option::Option::None,
|
7575 - | boolean: ::std::option::Option::None,
|
7576 - | double: ::std::option::Option::None,
|
7577 - | empty_struct: ::std::option::Option::None,
|
7578 - | float: ::std::option::Option::None,
|
7579 - | httpdate_timestamp: ::std::option::Option::None,
|
7580 - | integer: ::std::option::Option::None,
|
7581 - | iso8601_timestamp: ::std::option::Option::None,
|
7582 - | json_value: ::std::option::Option::None,
|
7583 - | list_of_lists: ::std::option::Option::None,
|
7584 - | list_of_maps_of_strings: ::std::option::Option::None,
|
7585 - | list_of_strings: ::std::option::Option::None,
|
7586 - | list_of_structs: ::std::option::Option::None,
|
7587 - | long: ::std::option::Option::None,
|
7588 - | map_of_lists_of_strings: ::std::option::Option::None,
|
7589 - | map_of_maps: ::std::option::Option::None,
|
7590 - | map_of_strings: ::std::option::Option::None,
|
7591 - | map_of_structs: ::std::option::Option::None,
|
7592 - | recursive_list: ::std::option::Option::None,
|
7593 - | recursive_map: ::std::option::Option::None,
|
7594 - | recursive_struct: ::std::option::Option::None,
|
7595 - | simple_struct: ::std::option::Option::None,
|
7596 - | string: ::std::option::Option::None,
|
7597 - | struct_with_json_name: ::std::option::Option::None,
|
7598 - | timestamp: ::std::option::Option::None,
|
7599 - | unix_timestamp: ::std::option::Option::None,
|
7600 - | };
|
7601 - | Ok(output)
|
6988 + | let service = crate::service::JsonProtocol::builder::<
|
6989 + | ::aws_smithy_http_server::body::BoxBody,
|
6990 + | _,
|
6991 + | _,
|
6992 + | _,
|
6993 + | >(config)
|
6994 + | .kitchen_sink_operation(move |input: crate::input::KitchenSinkOperationInput| {
|
6995 + | let sender = sender.clone();
|
6996 + | async move {
|
6997 + | let result = {
|
6998 + | use ::aws_smithy_protocol_test::FloatEquals;
|
6999 + | let expected = crate::input::KitchenSinkOperationInput {
|
7000 + | list_of_strings: ::std::option::Option::Some(vec![
|
7001 + | "abc".to_owned(),
|
7002 + | "mno".to_owned(),
|
7003 + | "xyz".to_owned(),
|
7004 + | ]),
|
7005 + | blob: ::std::option::Option::None,
|
7006 + | boolean: ::std::option::Option::None,
|
7007 + | double: ::std::option::Option::None,
|
7008 + | empty_struct: ::std::option::Option::None,
|
7009 + | float: ::std::option::Option::None,
|
7010 + | httpdate_timestamp: ::std::option::Option::None,
|
7011 + | integer: ::std::option::Option::None,
|
7012 + | iso8601_timestamp: ::std::option::Option::None,
|
7013 + | json_value: ::std::option::Option::None,
|
7014 + | list_of_lists: ::std::option::Option::None,
|
7015 + | list_of_maps_of_strings: ::std::option::Option::None,
|
7016 + | list_of_structs: ::std::option::Option::None,
|
7017 + | long: ::std::option::Option::None,
|
7018 + | map_of_lists_of_strings: ::std::option::Option::None,
|
7019 + | map_of_maps: ::std::option::Option::None,
|
7020 + | map_of_strings: ::std::option::Option::None,
|
7021 + | map_of_structs: ::std::option::Option::None,
|
7022 + | recursive_list: ::std::option::Option::None,
|
7023 + | recursive_map: ::std::option::Option::None,
|
7024 + | recursive_struct: ::std::option::Option::None,
|
7025 + | simple_struct: ::std::option::Option::None,
|
7026 + | string: ::std::option::Option::None,
|
7027 + | struct_with_json_name: ::std::option::Option::None,
|
7028 + | timestamp: ::std::option::Option::None,
|
7029 + | unix_timestamp: ::std::option::Option::None,
|
7602 7030 | };
|
7603 - | sender.send(()).await.expect("receiver dropped early");
|
7604 - | result
|
7605 - | }
|
7606 - | })
|
7607 - | .build_unchecked();
|
7031 + | ::pretty_assertions::assert_eq!(
|
7032 + | input.blob,
|
7033 + | expected.blob,
|
7034 + | "Unexpected value for `blob`"
|
7035 + | );
|
7036 + | ::pretty_assertions::assert_eq!(
|
7037 + | input.boolean,
|
7038 + | expected.boolean,
|
7039 + | "Unexpected value for `boolean`"
|
7040 + | );
|
7041 + | assert!(
|
7042 + | input.double.float_equals(&expected.double),
|
7043 + | "Unexpected value for `double` {:?} vs. {:?}",
|
7044 + | expected.double,
|
7045 + | input.double
|
7046 + | );
|
7047 + | ::pretty_assertions::assert_eq!(
|
7048 + | input.empty_struct,
|
7049 + | expected.empty_struct,
|
7050 + | "Unexpected value for `empty_struct`"
|
7051 + | );
|
7052 + | assert!(
|
7053 + | input.float.float_equals(&expected.float),
|
7054 + | "Unexpected value for `float` {:?} vs. {:?}",
|
7055 + | expected.float,
|
7056 + | input.float
|
7057 + | );
|
7058 + | ::pretty_assertions::assert_eq!(
|
7059 + | input.httpdate_timestamp,
|
7060 + | expected.httpdate_timestamp,
|
7061 + | "Unexpected value for `httpdate_timestamp`"
|
7062 + | );
|
7063 + | ::pretty_assertions::assert_eq!(
|
7064 + | input.integer,
|
7065 + | expected.integer,
|
7066 + | "Unexpected value for `integer`"
|
7067 + | );
|
7068 + | ::pretty_assertions::assert_eq!(
|
7069 + | input.iso8601_timestamp,
|
7070 + | expected.iso8601_timestamp,
|
7071 + | "Unexpected value for `iso8601_timestamp`"
|
7072 + | );
|
7073 + | ::pretty_assertions::assert_eq!(
|
7074 + | input.json_value,
|
7075 + | expected.json_value,
|
7076 + | "Unexpected value for `json_value`"
|
7077 + | );
|
7078 + | ::pretty_assertions::assert_eq!(
|
7079 + | input.list_of_lists,
|
7080 + | expected.list_of_lists,
|
7081 + | "Unexpected value for `list_of_lists`"
|
7082 + | );
|
7083 + | ::pretty_assertions::assert_eq!(
|
7084 + | input.list_of_maps_of_strings,
|
7085 + | expected.list_of_maps_of_strings,
|
7086 + | "Unexpected value for `list_of_maps_of_strings`"
|
7087 + | );
|
7088 + | ::pretty_assertions::assert_eq!(
|
7089 + | input.list_of_strings,
|
7090 + | expected.list_of_strings,
|
7091 + | "Unexpected value for `list_of_strings`"
|
7092 + | );
|
7093 + | ::pretty_assertions::assert_eq!(
|
7094 + | input.list_of_structs,
|
7095 + | expected.list_of_structs,
|
7096 + | "Unexpected value for `list_of_structs`"
|
7097 + | );
|
7098 + | ::pretty_assertions::assert_eq!(
|
7099 + | input.long,
|
7100 + | expected.long,
|
7101 + | "Unexpected value for `long`"
|
7102 + | );
|
7103 + | ::pretty_assertions::assert_eq!(
|
7104 + | input.map_of_lists_of_strings,
|
7105 + | expected.map_of_lists_of_strings,
|
7106 + | "Unexpected value for `map_of_lists_of_strings`"
|
7107 + | );
|
7108 + | ::pretty_assertions::assert_eq!(
|
7109 + | input.map_of_maps,
|
7110 + | expected.map_of_maps,
|
7111 + | "Unexpected value for `map_of_maps`"
|
7112 + | );
|
7113 + | ::pretty_assertions::assert_eq!(
|
7114 + | input.map_of_strings,
|
7115 + | expected.map_of_strings,
|
7116 + | "Unexpected value for `map_of_strings`"
|
7117 + | );
|
7118 + | ::pretty_assertions::assert_eq!(
|
7119 + | input.map_of_structs,
|
7120 + | expected.map_of_structs,
|
7121 + | "Unexpected value for `map_of_structs`"
|
7122 + | );
|
7123 + | ::pretty_assertions::assert_eq!(
|
7124 + | input.recursive_list,
|
7125 + | expected.recursive_list,
|
7126 + | "Unexpected value for `recursive_list`"
|
7127 + | );
|
7128 + | ::pretty_assertions::assert_eq!(
|
7129 + | input.recursive_map,
|
7130 + | expected.recursive_map,
|
7131 + | "Unexpected value for `recursive_map`"
|
7132 + | );
|
7133 + | ::pretty_assertions::assert_eq!(
|
7134 + | input.recursive_struct,
|
7135 + | expected.recursive_struct,
|
7136 + | "Unexpected value for `recursive_struct`"
|
7137 + | );
|
7138 + | ::pretty_assertions::assert_eq!(
|
7139 + | input.simple_struct,
|
7140 + | expected.simple_struct,
|
7141 + | "Unexpected value for `simple_struct`"
|
7142 + | );
|
7143 + | ::pretty_assertions::assert_eq!(
|
7144 + | input.string,
|
7145 + | expected.string,
|
7146 + | "Unexpected value for `string`"
|
7147 + | );
|
7148 + | ::pretty_assertions::assert_eq!(
|
7149 + | input.struct_with_json_name,
|
7150 + | expected.struct_with_json_name,
|
7151 + | "Unexpected value for `struct_with_json_name`"
|
7152 + | );
|
7153 + | ::pretty_assertions::assert_eq!(
|
7154 + | input.timestamp,
|
7155 + | expected.timestamp,
|
7156 + | "Unexpected value for `timestamp`"
|
7157 + | );
|
7158 + | ::pretty_assertions::assert_eq!(
|
7159 + | input.unix_timestamp,
|
7160 + | expected.unix_timestamp,
|
7161 + | "Unexpected value for `unix_timestamp`"
|
7162 + | );
|
7163 + | let output = crate::output::KitchenSinkOperationOutput {
|
7164 + | blob: ::std::option::Option::None,
|
7165 + | boolean: ::std::option::Option::None,
|
7166 + | double: ::std::option::Option::None,
|
7167 + | empty_struct: ::std::option::Option::None,
|
7168 + | float: ::std::option::Option::None,
|
7169 + | httpdate_timestamp: ::std::option::Option::None,
|
7170 + | integer: ::std::option::Option::None,
|
7171 + | iso8601_timestamp: ::std::option::Option::None,
|
7172 + | json_value: ::std::option::Option::None,
|
7173 + | list_of_lists: ::std::option::Option::None,
|
7174 + | list_of_maps_of_strings: ::std::option::Option::None,
|
7175 + | list_of_strings: ::std::option::Option::None,
|
7176 + | list_of_structs: ::std::option::Option::None,
|
7177 + | long: ::std::option::Option::None,
|
7178 + | map_of_lists_of_strings: ::std::option::Option::None,
|
7179 + | map_of_maps: ::std::option::Option::None,
|
7180 + | map_of_strings: ::std::option::Option::None,
|
7181 + | map_of_structs: ::std::option::Option::None,
|
7182 + | recursive_list: ::std::option::Option::None,
|
7183 + | recursive_map: ::std::option::Option::None,
|
7184 + | recursive_struct: ::std::option::Option::None,
|
7185 + | simple_struct: ::std::option::Option::None,
|
7186 + | string: ::std::option::Option::None,
|
7187 + | struct_with_json_name: ::std::option::Option::None,
|
7188 + | timestamp: ::std::option::Option::None,
|
7189 + | unix_timestamp: ::std::option::Option::None,
|
7190 + | };
|
7191 + | Ok(output)
|
7192 + | };
|
7193 + | sender.send(()).await.expect("receiver dropped early");
|
7194 + | result
|
7195 + | }
|
7196 + | })
|
7197 + | .build_unchecked();
|
7608 7198 | let http_response = ::tower::ServiceExt::oneshot(service, http_request)
|
7609 7199 | .await
|
7610 7200 | .expect("unable to make an HTTP request");
|
7611 7201 | assert!(
|
7612 7202 | receiver.recv().await.is_some(),
|
7613 7203 | "we expected operation handler to be invoked but it was not entered"
|
7614 7204 | );
|
7615 7205 | }
|
7616 7206 |
|
7617 - | /// Serializes list of recursive structure shapes
|
7618 - | /// Test ID: serializes_list_of_recursive_structure_shapes
|
7207 + | /// Serializes empty list shapes
|
7208 + | /// Test ID: serializes_empty_list_shapes
|
7619 7209 | #[::tokio::test]
|
7620 7210 | #[::tracing_test::traced_test]
|
7621 - | async fn serializes_list_of_recursive_structure_shapes_request() {
|
7211 + | async fn serializes_empty_list_shapes_request() {
|
7622 7212 | #[allow(unused_mut)]
|
7623 - | let mut http_request = http::Request::builder()
|
7624 - | .uri("/")
|
7625 - | .method("POST")
|
7626 - | .header("Content-Type", "application/x-amz-json-1.1")
|
7627 - | .header("X-Amz-Target", "JsonProtocol.KitchenSinkOperation")
|
7628 - | .body(::aws_smithy_http_server::body::Body::from(
|
7629 - | ::bytes::Bytes::copy_from_slice(
|
7630 - | &::aws_smithy_protocol_test::decode_body_data("{\"RecursiveList\":[{\"RecursiveList\":[{\"RecursiveList\":[{\"Integer\":123}]}]}]}".as_bytes(), ::aws_smithy_protocol_test::MediaType::from("application/json"))
|
7631 - | )
|
7632 - | )).unwrap();
|
7213 + | let mut http_request = ::http_1x::Request::builder()
|
7214 + | .uri("/")
|
7215 + | .method("POST")
|
7216 + | .header("Content-Type", "application/x-amz-json-1.1")
|
7217 + | .header("X-Amz-Target", "JsonProtocol.KitchenSinkOperation")
|
7218 + | .body(::aws_smithy_http_server::body::boxed(
|
7219 + | ::http_body_util::Full::new(::bytes::Bytes::copy_from_slice(
|
7220 + | &::aws_smithy_protocol_test::decode_body_data(
|
7221 + | "{\"ListOfStrings\":[]}".as_bytes(),
|
7222 + | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
7223 + | ),
|
7224 + | )),
|
7225 + | ))
|
7226 + | .unwrap();
|
7633 7227 | #[allow(unused_mut)]
|
7634 7228 | let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
|
7635 7229 | let config = crate::service::JsonProtocolConfig::builder().build();
|
7636 - | let service = crate::service::JsonProtocol::builder::<::hyper::body::Body, _, _, _>(config)
|
7637 - | .kitchen_sink_operation(move |input: crate::input::KitchenSinkOperationInput| {
|
7638 - | let sender = sender.clone();
|
7639 - | async move {
|
7640 - | let result = {
|
7641 - | use ::aws_smithy_protocol_test::FloatEquals;
|
7642 - | let expected = crate::input::KitchenSinkOperationInput {
|
7643 - | recursive_list: ::std::option::Option::Some(vec![
|
7644 - | crate::model::KitchenSink {
|
7645 - | recursive_list: ::std::option::Option::Some(vec![
|
7646 - | crate::model::KitchenSink {
|
7647 - | recursive_list: ::std::option::Option::Some(vec![
|
7648 - | crate::model::KitchenSink {
|
7649 - | integer: ::std::option::Option::Some(123),
|
7650 - | blob: ::std::option::Option::None,
|
7651 - | boolean: ::std::option::Option::None,
|
7652 - | double: ::std::option::Option::None,
|
7653 - | empty_struct: ::std::option::Option::None,
|
7654 - | float: ::std::option::Option::None,
|
7655 - | httpdate_timestamp: ::std::option::Option::None,
|
7656 - | iso8601_timestamp: ::std::option::Option::None,
|
7657 - | json_value: ::std::option::Option::None,
|
7658 - | list_of_lists: ::std::option::Option::None,
|
7659 - | list_of_maps_of_strings:
|
7660 - | ::std::option::Option::None,
|
7661 - | list_of_strings: ::std::option::Option::None,
|
7662 - | list_of_structs: ::std::option::Option::None,
|
7663 - | long: ::std::option::Option::None,
|
7664 - | map_of_lists_of_strings:
|
7665 - | ::std::option::Option::None,
|
7666 - | map_of_maps: ::std::option::Option::None,
|
7667 - | map_of_strings: ::std::option::Option::None,
|
7668 - | map_of_structs: ::std::option::Option::None,
|
7669 - | recursive_list: ::std::option::Option::None,
|
7670 - | recursive_map: ::std::option::Option::None,
|
7671 - | recursive_struct: ::std::option::Option::None,
|
7672 - | simple_struct: ::std::option::Option::None,
|
7673 - | string: ::std::option::Option::None,
|
7674 - | struct_with_json_name:
|
7675 - | ::std::option::Option::None,
|
7676 - | timestamp: ::std::option::Option::None,
|
7677 - | unix_timestamp: ::std::option::Option::None,
|
7678 - | },
|
7679 - | ]),
|
7680 - | blob: ::std::option::Option::None,
|
7681 - | boolean: ::std::option::Option::None,
|
7682 - | double: ::std::option::Option::None,
|
7683 - | empty_struct: ::std::option::Option::None,
|
7684 - | float: ::std::option::Option::None,
|
7685 - | httpdate_timestamp: ::std::option::Option::None,
|
7686 - | integer: ::std::option::Option::None,
|
7687 - | iso8601_timestamp: ::std::option::Option::None,
|
7688 - | json_value: ::std::option::Option::None,
|
7689 - | list_of_lists: ::std::option::Option::None,
|
7690 - | list_of_maps_of_strings: ::std::option::Option::None,
|
7691 - | list_of_strings: ::std::option::Option::None,
|
7692 - | list_of_structs: ::std::option::Option::None,
|
7693 - | long: ::std::option::Option::None,
|
7694 - | map_of_lists_of_strings: ::std::option::Option::None,
|
7695 - | map_of_maps: ::std::option::Option::None,
|
7696 - | map_of_strings: ::std::option::Option::None,
|
7697 - | map_of_structs: ::std::option::Option::None,
|
7698 - | recursive_map: ::std::option::Option::None,
|
7699 - | recursive_struct: ::std::option::Option::None,
|
7700 - | simple_struct: ::std::option::Option::None,
|
7701 - | string: ::std::option::Option::None,
|
7702 - | struct_with_json_name: ::std::option::Option::None,
|
7703 - | timestamp: ::std::option::Option::None,
|
7704 - | unix_timestamp: ::std::option::Option::None,
|
7705 - | },
|
7706 - | ]),
|
7707 - | blob: ::std::option::Option::None,
|
7708 - | boolean: ::std::option::Option::None,
|
7709 - | double: ::std::option::Option::None,
|
7710 - | empty_struct: ::std::option::Option::None,
|
7711 - | float: ::std::option::Option::None,
|
7712 - | httpdate_timestamp: ::std::option::Option::None,
|
7713 - | integer: ::std::option::Option::None,
|
7714 - | iso8601_timestamp: ::std::option::Option::None,
|
7715 - | json_value: ::std::option::Option::None,
|
7716 - | list_of_lists: ::std::option::Option::None,
|
7717 - | list_of_maps_of_strings: ::std::option::Option::None,
|
7718 - | list_of_strings: ::std::option::Option::None,
|
7719 - | list_of_structs: ::std::option::Option::None,
|
7720 - | long: ::std::option::Option::None,
|
7721 - | map_of_lists_of_strings: ::std::option::Option::None,
|
7722 - | map_of_maps: ::std::option::Option::None,
|
7723 - | map_of_strings: ::std::option::Option::None,
|
7724 - | map_of_structs: ::std::option::Option::None,
|
7725 - | recursive_map: ::std::option::Option::None,
|
7726 - | recursive_struct: ::std::option::Option::None,
|
7727 - | simple_struct: ::std::option::Option::None,
|
7728 - | string: ::std::option::Option::None,
|
7729 - | struct_with_json_name: ::std::option::Option::None,
|
7730 - | timestamp: ::std::option::Option::None,
|
7731 - | unix_timestamp: ::std::option::Option::None,
|
7732 - | },
|
7733 - | ]),
|
7734 - | blob: ::std::option::Option::None,
|
7735 - | boolean: ::std::option::Option::None,
|
7736 - | double: ::std::option::Option::None,
|
7737 - | empty_struct: ::std::option::Option::None,
|
7738 - | float: ::std::option::Option::None,
|
7739 - | httpdate_timestamp: ::std::option::Option::None,
|
7740 - | integer: ::std::option::Option::None,
|
7741 - | iso8601_timestamp: ::std::option::Option::None,
|
7742 - | json_value: ::std::option::Option::None,
|
7743 - | list_of_lists: ::std::option::Option::None,
|
7744 - | list_of_maps_of_strings: ::std::option::Option::None,
|
7745 - | list_of_strings: ::std::option::Option::None,
|
7746 - | list_of_structs: ::std::option::Option::None,
|
7747 - | long: ::std::option::Option::None,
|
7748 - | map_of_lists_of_strings: ::std::option::Option::None,
|
7749 - | map_of_maps: ::std::option::Option::None,
|
7750 - | map_of_strings: ::std::option::Option::None,
|
7751 - | map_of_structs: ::std::option::Option::None,
|
7752 - | recursive_map: ::std::option::Option::None,
|
7753 - | recursive_struct: ::std::option::Option::None,
|
7754 - | simple_struct: ::std::option::Option::None,
|
7755 - | string: ::std::option::Option::None,
|
7756 - | struct_with_json_name: ::std::option::Option::None,
|
7757 - | timestamp: ::std::option::Option::None,
|
7758 - | unix_timestamp: ::std::option::Option::None,
|
7759 - | };
|
7760 - | ::pretty_assertions::assert_eq!(
|
7761 - | input.blob,
|
7762 - | expected.blob,
|
7763 - | "Unexpected value for `blob`"
|
7764 - | );
|
7765 - | ::pretty_assertions::assert_eq!(
|
7766 - | input.boolean,
|
7767 - | expected.boolean,
|
7768 - | "Unexpected value for `boolean`"
|
7769 - | );
|
7770 - | assert!(
|
7771 - | input.double.float_equals(&expected.double),
|
7772 - | "Unexpected value for `double` {:?} vs. {:?}",
|
7773 - | expected.double,
|
7774 - | input.double
|
7775 - | );
|
7776 - | ::pretty_assertions::assert_eq!(
|
7777 - | input.empty_struct,
|
7778 - | expected.empty_struct,
|
7779 - | "Unexpected value for `empty_struct`"
|
7780 - | );
|
7781 - | assert!(
|
7782 - | input.float.float_equals(&expected.float),
|
7783 - | "Unexpected value for `float` {:?} vs. {:?}",
|
7784 - | expected.float,
|
7785 - | input.float
|
7786 - | );
|
7787 - | ::pretty_assertions::assert_eq!(
|
7788 - | input.httpdate_timestamp,
|
7789 - | expected.httpdate_timestamp,
|
7790 - | "Unexpected value for `httpdate_timestamp`"
|
7791 - | );
|
7792 - | ::pretty_assertions::assert_eq!(
|
7793 - | input.integer,
|
7794 - | expected.integer,
|
7795 - | "Unexpected value for `integer`"
|
7796 - | );
|
7797 - | ::pretty_assertions::assert_eq!(
|
7798 - | input.iso8601_timestamp,
|
7799 - | expected.iso8601_timestamp,
|
7800 - | "Unexpected value for `iso8601_timestamp`"
|
7801 - | );
|
7802 - | ::pretty_assertions::assert_eq!(
|
7803 - | input.json_value,
|
7804 - | expected.json_value,
|
7805 - | "Unexpected value for `json_value`"
|
7806 - | );
|
7807 - | ::pretty_assertions::assert_eq!(
|
7808 - | input.list_of_lists,
|
7809 - | expected.list_of_lists,
|
7810 - | "Unexpected value for `list_of_lists`"
|
7811 - | );
|
7812 - | ::pretty_assertions::assert_eq!(
|
7813 - | input.list_of_maps_of_strings,
|
7814 - | expected.list_of_maps_of_strings,
|
7815 - | "Unexpected value for `list_of_maps_of_strings`"
|
7816 - | );
|
7817 - | ::pretty_assertions::assert_eq!(
|
7818 - | input.list_of_strings,
|
7819 - | expected.list_of_strings,
|
7820 - | "Unexpected value for `list_of_strings`"
|
7821 - | );
|
7822 - | ::pretty_assertions::assert_eq!(
|
7823 - | input.list_of_structs,
|
7824 - | expected.list_of_structs,
|
7825 - | "Unexpected value for `list_of_structs`"
|
7826 - | );
|
7827 - | ::pretty_assertions::assert_eq!(
|
7828 - | input.long,
|
7829 - | expected.long,
|
7830 - | "Unexpected value for `long`"
|
7831 - | );
|
7832 - | ::pretty_assertions::assert_eq!(
|
7833 - | input.map_of_lists_of_strings,
|
7834 - | expected.map_of_lists_of_strings,
|
7835 - | "Unexpected value for `map_of_lists_of_strings`"
|
7836 - | );
|
7837 - | ::pretty_assertions::assert_eq!(
|
7838 - | input.map_of_maps,
|
7839 - | expected.map_of_maps,
|
7840 - | "Unexpected value for `map_of_maps`"
|
7841 - | );
|
7842 - | ::pretty_assertions::assert_eq!(
|
7843 - | input.map_of_strings,
|
7844 - | expected.map_of_strings,
|
7845 - | "Unexpected value for `map_of_strings`"
|
7846 - | );
|
7847 - | ::pretty_assertions::assert_eq!(
|
7848 - | input.map_of_structs,
|
7849 - | expected.map_of_structs,
|
7850 - | "Unexpected value for `map_of_structs`"
|
7851 - | );
|
7852 - | ::pretty_assertions::assert_eq!(
|
7853 - | input.recursive_list,
|
7854 - | expected.recursive_list,
|
7855 - | "Unexpected value for `recursive_list`"
|
7856 - | );
|
7857 - | ::pretty_assertions::assert_eq!(
|
7858 - | input.recursive_map,
|
7859 - | expected.recursive_map,
|
7860 - | "Unexpected value for `recursive_map`"
|
7861 - | );
|
7862 - | ::pretty_assertions::assert_eq!(
|
7863 - | input.recursive_struct,
|
7864 - | expected.recursive_struct,
|
7865 - | "Unexpected value for `recursive_struct`"
|
7866 - | );
|
7867 - | ::pretty_assertions::assert_eq!(
|
7868 - | input.simple_struct,
|
7869 - | expected.simple_struct,
|
7870 - | "Unexpected value for `simple_struct`"
|
7871 - | );
|
7872 - | ::pretty_assertions::assert_eq!(
|
7873 - | input.string,
|
7874 - | expected.string,
|
7875 - | "Unexpected value for `string`"
|
7876 - | );
|
7877 - | ::pretty_assertions::assert_eq!(
|
7878 - | input.struct_with_json_name,
|
7879 - | expected.struct_with_json_name,
|
7880 - | "Unexpected value for `struct_with_json_name`"
|
7881 - | );
|
7882 - | ::pretty_assertions::assert_eq!(
|
7883 - | input.timestamp,
|
7884 - | expected.timestamp,
|
7885 - | "Unexpected value for `timestamp`"
|
7886 - | );
|
7887 - | ::pretty_assertions::assert_eq!(
|
7888 - | input.unix_timestamp,
|
7889 - | expected.unix_timestamp,
|
7890 - | "Unexpected value for `unix_timestamp`"
|
7891 - | );
|
7892 - | let output = crate::output::KitchenSinkOperationOutput {
|
7893 - | blob: ::std::option::Option::None,
|
7894 - | boolean: ::std::option::Option::None,
|
7895 - | double: ::std::option::Option::None,
|
7896 - | empty_struct: ::std::option::Option::None,
|
7897 - | float: ::std::option::Option::None,
|
7898 - | httpdate_timestamp: ::std::option::Option::None,
|
7899 - | integer: ::std::option::Option::None,
|
7900 - | iso8601_timestamp: ::std::option::Option::None,
|
7901 - | json_value: ::std::option::Option::None,
|
7902 - | list_of_lists: ::std::option::Option::None,
|
7903 - | list_of_maps_of_strings: ::std::option::Option::None,
|
7904 - | list_of_strings: ::std::option::Option::None,
|
7905 - | list_of_structs: ::std::option::Option::None,
|
7906 - | long: ::std::option::Option::None,
|
7907 - | map_of_lists_of_strings: ::std::option::Option::None,
|
7908 - | map_of_maps: ::std::option::Option::None,
|
7909 - | map_of_strings: ::std::option::Option::None,
|
7910 - | map_of_structs: ::std::option::Option::None,
|
7911 - | recursive_list: ::std::option::Option::None,
|
7912 - | recursive_map: ::std::option::Option::None,
|
7913 - | recursive_struct: ::std::option::Option::None,
|
7914 - | simple_struct: ::std::option::Option::None,
|
7915 - | string: ::std::option::Option::None,
|
7916 - | struct_with_json_name: ::std::option::Option::None,
|
7917 - | timestamp: ::std::option::Option::None,
|
7918 - | unix_timestamp: ::std::option::Option::None,
|
7919 - | };
|
7920 - | Ok(output)
|
7230 + | let service = crate::service::JsonProtocol::builder::<
|
7231 + | ::aws_smithy_http_server::body::BoxBody,
|
7232 + | _,
|
7233 + | _,
|
7234 + | _,
|
7235 + | >(config)
|
7236 + | .kitchen_sink_operation(move |input: crate::input::KitchenSinkOperationInput| {
|
7237 + | let sender = sender.clone();
|
7238 + | async move {
|
7239 + | let result = {
|
7240 + | use ::aws_smithy_protocol_test::FloatEquals;
|
7241 + | let expected = crate::input::KitchenSinkOperationInput {
|
7242 + | list_of_strings: ::std::option::Option::Some(vec![]),
|
7243 + | blob: ::std::option::Option::None,
|
7244 + | boolean: ::std::option::Option::None,
|
7245 + | double: ::std::option::Option::None,
|
7246 + | empty_struct: ::std::option::Option::None,
|
7247 + | float: ::std::option::Option::None,
|
7248 + | httpdate_timestamp: ::std::option::Option::None,
|
7249 + | integer: ::std::option::Option::None,
|
7250 + | iso8601_timestamp: ::std::option::Option::None,
|
7251 + | json_value: ::std::option::Option::None,
|
7252 + | list_of_lists: ::std::option::Option::None,
|
7253 + | list_of_maps_of_strings: ::std::option::Option::None,
|
7254 + | list_of_structs: ::std::option::Option::None,
|
7255 + | long: ::std::option::Option::None,
|
7256 + | map_of_lists_of_strings: ::std::option::Option::None,
|
7257 + | map_of_maps: ::std::option::Option::None,
|
7258 + | map_of_strings: ::std::option::Option::None,
|
7259 + | map_of_structs: ::std::option::Option::None,
|
7260 + | recursive_list: ::std::option::Option::None,
|
7261 + | recursive_map: ::std::option::Option::None,
|
7262 + | recursive_struct: ::std::option::Option::None,
|
7263 + | simple_struct: ::std::option::Option::None,
|
7264 + | string: ::std::option::Option::None,
|
7265 + | struct_with_json_name: ::std::option::Option::None,
|
7266 + | timestamp: ::std::option::Option::None,
|
7267 + | unix_timestamp: ::std::option::Option::None,
|
7921 7268 | };
|
7922 - | sender.send(()).await.expect("receiver dropped early");
|
7923 - | result
|
7924 - | }
|
7925 - | })
|
7926 - | .build_unchecked();
|
7269 + | ::pretty_assertions::assert_eq!(
|
7270 + | input.blob,
|
7271 + | expected.blob,
|
7272 + | "Unexpected value for `blob`"
|
7273 + | );
|
7274 + | ::pretty_assertions::assert_eq!(
|
7275 + | input.boolean,
|
7276 + | expected.boolean,
|
7277 + | "Unexpected value for `boolean`"
|
7278 + | );
|
7279 + | assert!(
|
7280 + | input.double.float_equals(&expected.double),
|
7281 + | "Unexpected value for `double` {:?} vs. {:?}",
|
7282 + | expected.double,
|
7283 + | input.double
|
7284 + | );
|
7285 + | ::pretty_assertions::assert_eq!(
|
7286 + | input.empty_struct,
|
7287 + | expected.empty_struct,
|
7288 + | "Unexpected value for `empty_struct`"
|
7289 + | );
|
7290 + | assert!(
|
7291 + | input.float.float_equals(&expected.float),
|
7292 + | "Unexpected value for `float` {:?} vs. {:?}",
|
7293 + | expected.float,
|
7294 + | input.float
|
7295 + | );
|
7296 + | ::pretty_assertions::assert_eq!(
|
7297 + | input.httpdate_timestamp,
|
7298 + | expected.httpdate_timestamp,
|
7299 + | "Unexpected value for `httpdate_timestamp`"
|
7300 + | );
|
7301 + | ::pretty_assertions::assert_eq!(
|
7302 + | input.integer,
|
7303 + | expected.integer,
|
7304 + | "Unexpected value for `integer`"
|
7305 + | );
|
7306 + | ::pretty_assertions::assert_eq!(
|
7307 + | input.iso8601_timestamp,
|
7308 + | expected.iso8601_timestamp,
|
7309 + | "Unexpected value for `iso8601_timestamp`"
|
7310 + | );
|
7311 + | ::pretty_assertions::assert_eq!(
|
7312 + | input.json_value,
|
7313 + | expected.json_value,
|
7314 + | "Unexpected value for `json_value`"
|
7315 + | );
|
7316 + | ::pretty_assertions::assert_eq!(
|
7317 + | input.list_of_lists,
|
7318 + | expected.list_of_lists,
|
7319 + | "Unexpected value for `list_of_lists`"
|
7320 + | );
|
7321 + | ::pretty_assertions::assert_eq!(
|
7322 + | input.list_of_maps_of_strings,
|
7323 + | expected.list_of_maps_of_strings,
|
7324 + | "Unexpected value for `list_of_maps_of_strings`"
|
7325 + | );
|
7326 + | ::pretty_assertions::assert_eq!(
|
7327 + | input.list_of_strings,
|
7328 + | expected.list_of_strings,
|
7329 + | "Unexpected value for `list_of_strings`"
|
7330 + | );
|
7331 + | ::pretty_assertions::assert_eq!(
|
7332 + | input.list_of_structs,
|
7333 + | expected.list_of_structs,
|
7334 + | "Unexpected value for `list_of_structs`"
|
7335 + | );
|
7336 + | ::pretty_assertions::assert_eq!(
|
7337 + | input.long,
|
7338 + | expected.long,
|
7339 + | "Unexpected value for `long`"
|
7340 + | );
|
7341 + | ::pretty_assertions::assert_eq!(
|
7342 + | input.map_of_lists_of_strings,
|
7343 + | expected.map_of_lists_of_strings,
|
7344 + | "Unexpected value for `map_of_lists_of_strings`"
|
7345 + | );
|
7346 + | ::pretty_assertions::assert_eq!(
|
7347 + | input.map_of_maps,
|
7348 + | expected.map_of_maps,
|
7349 + | "Unexpected value for `map_of_maps`"
|
7350 + | );
|
7351 + | ::pretty_assertions::assert_eq!(
|
7352 + | input.map_of_strings,
|
7353 + | expected.map_of_strings,
|
7354 + | "Unexpected value for `map_of_strings`"
|
7355 + | );
|
7356 + | ::pretty_assertions::assert_eq!(
|
7357 + | input.map_of_structs,
|
7358 + | expected.map_of_structs,
|
7359 + | "Unexpected value for `map_of_structs`"
|
7360 + | );
|
7361 + | ::pretty_assertions::assert_eq!(
|
7362 + | input.recursive_list,
|
7363 + | expected.recursive_list,
|
7364 + | "Unexpected value for `recursive_list`"
|
7365 + | );
|
7366 + | ::pretty_assertions::assert_eq!(
|
7367 + | input.recursive_map,
|
7368 + | expected.recursive_map,
|
7369 + | "Unexpected value for `recursive_map`"
|
7370 + | );
|
7371 + | ::pretty_assertions::assert_eq!(
|
7372 + | input.recursive_struct,
|
7373 + | expected.recursive_struct,
|
7374 + | "Unexpected value for `recursive_struct`"
|
7375 + | );
|
7376 + | ::pretty_assertions::assert_eq!(
|
7377 + | input.simple_struct,
|
7378 + | expected.simple_struct,
|
7379 + | "Unexpected value for `simple_struct`"
|
7380 + | );
|
7381 + | ::pretty_assertions::assert_eq!(
|
7382 + | input.string,
|
7383 + | expected.string,
|
7384 + | "Unexpected value for `string`"
|
7385 + | );
|
7386 + | ::pretty_assertions::assert_eq!(
|
7387 + | input.struct_with_json_name,
|
7388 + | expected.struct_with_json_name,
|
7389 + | "Unexpected value for `struct_with_json_name`"
|
7390 + | );
|
7391 + | ::pretty_assertions::assert_eq!(
|
7392 + | input.timestamp,
|
7393 + | expected.timestamp,
|
7394 + | "Unexpected value for `timestamp`"
|
7395 + | );
|
7396 + | ::pretty_assertions::assert_eq!(
|
7397 + | input.unix_timestamp,
|
7398 + | expected.unix_timestamp,
|
7399 + | "Unexpected value for `unix_timestamp`"
|
7400 + | );
|
7401 + | let output = crate::output::KitchenSinkOperationOutput {
|
7402 + | blob: ::std::option::Option::None,
|
7403 + | boolean: ::std::option::Option::None,
|
7404 + | double: ::std::option::Option::None,
|
7405 + | empty_struct: ::std::option::Option::None,
|
7406 + | float: ::std::option::Option::None,
|
7407 + | httpdate_timestamp: ::std::option::Option::None,
|
7408 + | integer: ::std::option::Option::None,
|
7409 + | iso8601_timestamp: ::std::option::Option::None,
|
7410 + | json_value: ::std::option::Option::None,
|
7411 + | list_of_lists: ::std::option::Option::None,
|
7412 + | list_of_maps_of_strings: ::std::option::Option::None,
|
7413 + | list_of_strings: ::std::option::Option::None,
|
7414 + | list_of_structs: ::std::option::Option::None,
|
7415 + | long: ::std::option::Option::None,
|
7416 + | map_of_lists_of_strings: ::std::option::Option::None,
|
7417 + | map_of_maps: ::std::option::Option::None,
|
7418 + | map_of_strings: ::std::option::Option::None,
|
7419 + | map_of_structs: ::std::option::Option::None,
|
7420 + | recursive_list: ::std::option::Option::None,
|
7421 + | recursive_map: ::std::option::Option::None,
|
7422 + | recursive_struct: ::std::option::Option::None,
|
7423 + | simple_struct: ::std::option::Option::None,
|
7424 + | string: ::std::option::Option::None,
|
7425 + | struct_with_json_name: ::std::option::Option::None,
|
7426 + | timestamp: ::std::option::Option::None,
|
7427 + | unix_timestamp: ::std::option::Option::None,
|
7428 + | };
|
7429 + | Ok(output)
|
7430 + | };
|
7431 + | sender.send(()).await.expect("receiver dropped early");
|
7432 + | result
|
7433 + | }
|
7434 + | })
|
7435 + | .build_unchecked();
|
7927 7436 | let http_response = ::tower::ServiceExt::oneshot(service, http_request)
|
7928 7437 | .await
|
7929 7438 | .expect("unable to make an HTTP request");
|
7930 7439 | assert!(
|
7931 7440 | receiver.recv().await.is_some(),
|
7932 7441 | "we expected operation handler to be invoked but it was not entered"
|
7933 7442 | );
|
7934 7443 | }
|
7935 7444 |
|
7936 - | /// Serializes map shapes
|
7937 - | /// Test ID: serializes_map_shapes
|
7445 + | /// Serializes list of map shapes
|
7446 + | /// Test ID: serializes_list_of_map_shapes
|
7938 7447 | #[::tokio::test]
|
7939 7448 | #[::tracing_test::traced_test]
|
7940 - | async fn serializes_map_shapes_request() {
|
7449 + | async fn serializes_list_of_map_shapes_request() {
|
7941 7450 | #[allow(unused_mut)]
|
7942 - | let mut http_request = http::Request::builder()
|
7943 - | .uri("/")
|
7944 - | .method("POST")
|
7945 - | .header("Content-Type", "application/x-amz-json-1.1")
|
7946 - | .header("X-Amz-Target", "JsonProtocol.KitchenSinkOperation")
|
7947 - | .body(::aws_smithy_http_server::body::Body::from(
|
7948 - | ::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
|
7949 - | "{\"MapOfStrings\":{\"abc\":\"xyz\",\"mno\":\"hjk\"}}".as_bytes(),
|
7950 - | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
7951 - | )),
|
7952 - | ))
|
7953 - | .unwrap();
|
7451 + | let mut http_request = ::http_1x::Request::builder()
|
7452 + | .uri("/")
|
7453 + | .method("POST")
|
7454 + | .header("Content-Type", "application/x-amz-json-1.1")
|
7455 + | .header("X-Amz-Target", "JsonProtocol.KitchenSinkOperation")
|
7456 + | .body(::aws_smithy_http_server::body::boxed(::http_body_util::Full::new(
|
7457 + | ::bytes::Bytes::copy_from_slice(
|
7458 + | &::aws_smithy_protocol_test::decode_body_data("{\"ListOfMapsOfStrings\":[{\"foo\":\"bar\"},{\"abc\":\"xyz\"},{\"red\":\"blue\"}]}".as_bytes(), ::aws_smithy_protocol_test::MediaType::from("application/json"))
|
7459 + | )
|
7460 + | ))).unwrap();
|
7954 7461 | #[allow(unused_mut)]
|
7955 7462 | let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
|
7956 7463 | let config = crate::service::JsonProtocolConfig::builder().build();
|
7957 - | let service = crate::service::JsonProtocol::builder::<::hyper::body::Body, _, _, _>(config)
|
7958 - | .kitchen_sink_operation(move |input: crate::input::KitchenSinkOperationInput| {
|
7959 - | let sender = sender.clone();
|
7960 - | async move {
|
7961 - | let result = {
|
7962 - | use ::aws_smithy_protocol_test::FloatEquals;
|
7963 - | let expected = crate::input::KitchenSinkOperationInput {
|
7964 - | map_of_strings: ::std::option::Option::Some({
|
7464 + | let service = crate::service::JsonProtocol::builder::<
|
7465 + | ::aws_smithy_http_server::body::BoxBody,
|
7466 + | _,
|
7467 + | _,
|
7468 + | _,
|
7469 + | >(config)
|
7470 + | .kitchen_sink_operation(move |input: crate::input::KitchenSinkOperationInput| {
|
7471 + | let sender = sender.clone();
|
7472 + | async move {
|
7473 + | let result = {
|
7474 + | use ::aws_smithy_protocol_test::FloatEquals;
|
7475 + | let expected = crate::input::KitchenSinkOperationInput {
|
7476 + | list_of_maps_of_strings: ::std::option::Option::Some(vec![
|
7477 + | {
|
7478 + | let mut ret = ::std::collections::HashMap::new();
|
7479 + | ret.insert("foo".to_owned(), "bar".to_owned());
|
7480 + | ret
|
7481 + | },
|
7482 + | {
|
7965 7483 | let mut ret = ::std::collections::HashMap::new();
|
7966 7484 | ret.insert("abc".to_owned(), "xyz".to_owned());
|
7967 - | ret.insert("mno".to_owned(), "hjk".to_owned());
|
7968 7485 | ret
|
7969 - | }),
|
7970 - | blob: ::std::option::Option::None,
|
7971 - | boolean: ::std::option::Option::None,
|
7972 - | double: ::std::option::Option::None,
|
7973 - | empty_struct: ::std::option::Option::None,
|
7974 - | float: ::std::option::Option::None,
|
7975 - | httpdate_timestamp: ::std::option::Option::None,
|
7976 - | integer: ::std::option::Option::None,
|
7977 - | iso8601_timestamp: ::std::option::Option::None,
|
7978 - | json_value: ::std::option::Option::None,
|
7979 - | list_of_lists: ::std::option::Option::None,
|
7980 - | list_of_maps_of_strings: ::std::option::Option::None,
|
7981 - | list_of_strings: ::std::option::Option::None,
|
7982 - | list_of_structs: ::std::option::Option::None,
|
7983 - | long: ::std::option::Option::None,
|
7984 - | map_of_lists_of_strings: ::std::option::Option::None,
|
7985 - | map_of_maps: ::std::option::Option::None,
|
7986 - | map_of_structs: ::std::option::Option::None,
|
7987 - | recursive_list: ::std::option::Option::None,
|
7988 - | recursive_map: ::std::option::Option::None,
|
7989 - | recursive_struct: ::std::option::Option::None,
|
7990 - | simple_struct: ::std::option::Option::None,
|
7991 - | string: ::std::option::Option::None,
|
7992 - | struct_with_json_name: ::std::option::Option::None,
|
7993 - | timestamp: ::std::option::Option::None,
|
7994 - | unix_timestamp: ::std::option::Option::None,
|
7995 - | };
|
7996 - | ::pretty_assertions::assert_eq!(
|
7997 - | input.blob,
|
7998 - | expected.blob,
|
7999 - | "Unexpected value for `blob`"
|
8000 - | );
|
8001 - | ::pretty_assertions::assert_eq!(
|
8002 - | input.boolean,
|
8003 - | expected.boolean,
|
8004 - | "Unexpected value for `boolean`"
|
8005 - | );
|
8006 - | assert!(
|
8007 - | input.double.float_equals(&expected.double),
|
8008 - | "Unexpected value for `double` {:?} vs. {:?}",
|
8009 - | expected.double,
|
8010 - | input.double
|
8011 - | );
|
8012 - | ::pretty_assertions::assert_eq!(
|
8013 - | input.empty_struct,
|
8014 - | expected.empty_struct,
|
8015 - | "Unexpected value for `empty_struct`"
|
8016 - | );
|
8017 - | assert!(
|
8018 - | input.float.float_equals(&expected.float),
|
8019 - | "Unexpected value for `float` {:?} vs. {:?}",
|
8020 - | expected.float,
|
8021 - | input.float
|
8022 - | );
|
8023 - | ::pretty_assertions::assert_eq!(
|
8024 - | input.httpdate_timestamp,
|
8025 - | expected.httpdate_timestamp,
|
8026 - | "Unexpected value for `httpdate_timestamp`"
|
8027 - | );
|
8028 - | ::pretty_assertions::assert_eq!(
|
8029 - | input.integer,
|
8030 - | expected.integer,
|
8031 - | "Unexpected value for `integer`"
|
8032 - | );
|
8033 - | ::pretty_assertions::assert_eq!(
|
8034 - | input.iso8601_timestamp,
|
8035 - | expected.iso8601_timestamp,
|
8036 - | "Unexpected value for `iso8601_timestamp`"
|
8037 - | );
|
8038 - | ::pretty_assertions::assert_eq!(
|
8039 - | input.json_value,
|
8040 - | expected.json_value,
|
8041 - | "Unexpected value for `json_value`"
|
8042 - | );
|
8043 - | ::pretty_assertions::assert_eq!(
|
8044 - | input.list_of_lists,
|
8045 - | expected.list_of_lists,
|
8046 - | "Unexpected value for `list_of_lists`"
|
8047 - | );
|
8048 - | ::pretty_assertions::assert_eq!(
|
8049 - | input.list_of_maps_of_strings,
|
8050 - | expected.list_of_maps_of_strings,
|
8051 - | "Unexpected value for `list_of_maps_of_strings`"
|
8052 - | );
|
8053 - | ::pretty_assertions::assert_eq!(
|
8054 - | input.list_of_strings,
|
8055 - | expected.list_of_strings,
|
8056 - | "Unexpected value for `list_of_strings`"
|
8057 - | );
|
8058 - | ::pretty_assertions::assert_eq!(
|
8059 - | input.list_of_structs,
|
8060 - | expected.list_of_structs,
|
8061 - | "Unexpected value for `list_of_structs`"
|
8062 - | );
|
8063 - | ::pretty_assertions::assert_eq!(
|
8064 - | input.long,
|
8065 - | expected.long,
|
8066 - | "Unexpected value for `long`"
|
8067 - | );
|
8068 - | ::pretty_assertions::assert_eq!(
|
8069 - | input.map_of_lists_of_strings,
|
8070 - | expected.map_of_lists_of_strings,
|
8071 - | "Unexpected value for `map_of_lists_of_strings`"
|
8072 - | );
|
8073 - | ::pretty_assertions::assert_eq!(
|
8074 - | input.map_of_maps,
|
8075 - | expected.map_of_maps,
|
8076 - | "Unexpected value for `map_of_maps`"
|
8077 - | );
|
8078 - | ::pretty_assertions::assert_eq!(
|
8079 - | input.map_of_strings,
|
8080 - | expected.map_of_strings,
|
8081 - | "Unexpected value for `map_of_strings`"
|
8082 - | );
|
8083 - | ::pretty_assertions::assert_eq!(
|
8084 - | input.map_of_structs,
|
8085 - | expected.map_of_structs,
|
8086 - | "Unexpected value for `map_of_structs`"
|
8087 - | );
|
8088 - | ::pretty_assertions::assert_eq!(
|
8089 - | input.recursive_list,
|
8090 - | expected.recursive_list,
|
8091 - | "Unexpected value for `recursive_list`"
|
8092 - | );
|
8093 - | ::pretty_assertions::assert_eq!(
|
8094 - | input.recursive_map,
|
8095 - | expected.recursive_map,
|
8096 - | "Unexpected value for `recursive_map`"
|
8097 - | );
|
8098 - | ::pretty_assertions::assert_eq!(
|
8099 - | input.recursive_struct,
|
8100 - | expected.recursive_struct,
|
8101 - | "Unexpected value for `recursive_struct`"
|
8102 - | );
|
8103 - | ::pretty_assertions::assert_eq!(
|
8104 - | input.simple_struct,
|
8105 - | expected.simple_struct,
|
8106 - | "Unexpected value for `simple_struct`"
|
8107 - | );
|
8108 - | ::pretty_assertions::assert_eq!(
|
8109 - | input.string,
|
8110 - | expected.string,
|
8111 - | "Unexpected value for `string`"
|
8112 - | );
|
8113 - | ::pretty_assertions::assert_eq!(
|
8114 - | input.struct_with_json_name,
|
8115 - | expected.struct_with_json_name,
|
8116 - | "Unexpected value for `struct_with_json_name`"
|
8117 - | );
|
8118 - | ::pretty_assertions::assert_eq!(
|
8119 - | input.timestamp,
|
8120 - | expected.timestamp,
|
8121 - | "Unexpected value for `timestamp`"
|
8122 - | );
|
8123 - | ::pretty_assertions::assert_eq!(
|
8124 - | input.unix_timestamp,
|
8125 - | expected.unix_timestamp,
|
8126 - | "Unexpected value for `unix_timestamp`"
|
8127 - | );
|
8128 - | let output = crate::output::KitchenSinkOperationOutput {
|
8129 - | blob: ::std::option::Option::None,
|
8130 - | boolean: ::std::option::Option::None,
|
8131 - | double: ::std::option::Option::None,
|
8132 - | empty_struct: ::std::option::Option::None,
|
8133 - | float: ::std::option::Option::None,
|
8134 - | httpdate_timestamp: ::std::option::Option::None,
|
8135 - | integer: ::std::option::Option::None,
|
8136 - | iso8601_timestamp: ::std::option::Option::None,
|
8137 - | json_value: ::std::option::Option::None,
|
8138 - | list_of_lists: ::std::option::Option::None,
|
8139 - | list_of_maps_of_strings: ::std::option::Option::None,
|
8140 - | list_of_strings: ::std::option::Option::None,
|
8141 - | list_of_structs: ::std::option::Option::None,
|
8142 - | long: ::std::option::Option::None,
|
8143 - | map_of_lists_of_strings: ::std::option::Option::None,
|
8144 - | map_of_maps: ::std::option::Option::None,
|
8145 - | map_of_strings: ::std::option::Option::None,
|
8146 - | map_of_structs: ::std::option::Option::None,
|
8147 - | recursive_list: ::std::option::Option::None,
|
8148 - | recursive_map: ::std::option::Option::None,
|
8149 - | recursive_struct: ::std::option::Option::None,
|
8150 - | simple_struct: ::std::option::Option::None,
|
8151 - | string: ::std::option::Option::None,
|
8152 - | struct_with_json_name: ::std::option::Option::None,
|
8153 - | timestamp: ::std::option::Option::None,
|
8154 - | unix_timestamp: ::std::option::Option::None,
|
8155 - | };
|
8156 - | Ok(output)
|
8157 - | };
|
8158 - | sender.send(()).await.expect("receiver dropped early");
|
8159 - | result
|
8160 - | }
|
8161 - | })
|
8162 - | .build_unchecked();
|
8163 - | let http_response = ::tower::ServiceExt::oneshot(service, http_request)
|
8164 - | .await
|
8165 - | .expect("unable to make an HTTP request");
|
8166 - | assert!(
|
8167 - | receiver.recv().await.is_some(),
|
8168 - | "we expected operation handler to be invoked but it was not entered"
|
8169 - | );
|
8170 - | }
|
8171 - |
|
8172 - | /// Serializes empty map shapes
|
8173 - | /// Test ID: serializes_empty_map_shapes
|
8174 - | #[::tokio::test]
|
8175 - | #[::tracing_test::traced_test]
|
8176 - | async fn serializes_empty_map_shapes_request() {
|
8177 - | #[allow(unused_mut)]
|
8178 - | let mut http_request = http::Request::builder()
|
8179 - | .uri("/")
|
8180 - | .method("POST")
|
8181 - | .header("Content-Type", "application/x-amz-json-1.1")
|
8182 - | .header("X-Amz-Target", "JsonProtocol.KitchenSinkOperation")
|
8183 - | .body(::aws_smithy_http_server::body::Body::from(
|
8184 - | ::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
|
8185 - | "{\"MapOfStrings\":{}}".as_bytes(),
|
8186 - | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
8187 - | )),
|
8188 - | ))
|
8189 - | .unwrap();
|
8190 - | #[allow(unused_mut)]
|
8191 - | let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
|
8192 - | let config = crate::service::JsonProtocolConfig::builder().build();
|
8193 - | let service = crate::service::JsonProtocol::builder::<::hyper::body::Body, _, _, _>(config)
|
8194 - | .kitchen_sink_operation(move |input: crate::input::KitchenSinkOperationInput| {
|
8195 - | let sender = sender.clone();
|
8196 - | async move {
|
8197 - | let result = {
|
8198 - | use ::aws_smithy_protocol_test::FloatEquals;
|
8199 - | let expected = crate::input::KitchenSinkOperationInput {
|
8200 - | map_of_strings: ::std::option::Option::Some(
|
8201 - | ::std::collections::HashMap::new(),
|
8202 - | ),
|
8203 - | blob: ::std::option::Option::None,
|
8204 - | boolean: ::std::option::Option::None,
|
8205 - | double: ::std::option::Option::None,
|
8206 - | empty_struct: ::std::option::Option::None,
|
8207 - | float: ::std::option::Option::None,
|
8208 - | httpdate_timestamp: ::std::option::Option::None,
|
8209 - | integer: ::std::option::Option::None,
|
8210 - | iso8601_timestamp: ::std::option::Option::None,
|
8211 - | json_value: ::std::option::Option::None,
|
8212 - | list_of_lists: ::std::option::Option::None,
|
8213 - | list_of_maps_of_strings: ::std::option::Option::None,
|
8214 - | list_of_strings: ::std::option::Option::None,
|
8215 - | list_of_structs: ::std::option::Option::None,
|
8216 - | long: ::std::option::Option::None,
|
8217 - | map_of_lists_of_strings: ::std::option::Option::None,
|
8218 - | map_of_maps: ::std::option::Option::None,
|
8219 - | map_of_structs: ::std::option::Option::None,
|
8220 - | recursive_list: ::std::option::Option::None,
|
8221 - | recursive_map: ::std::option::Option::None,
|
8222 - | recursive_struct: ::std::option::Option::None,
|
8223 - | simple_struct: ::std::option::Option::None,
|
8224 - | string: ::std::option::Option::None,
|
8225 - | struct_with_json_name: ::std::option::Option::None,
|
8226 - | timestamp: ::std::option::Option::None,
|
8227 - | unix_timestamp: ::std::option::Option::None,
|
8228 - | };
|
8229 - | ::pretty_assertions::assert_eq!(
|
8230 - | input.blob,
|
8231 - | expected.blob,
|
8232 - | "Unexpected value for `blob`"
|
8233 - | );
|
8234 - | ::pretty_assertions::assert_eq!(
|
8235 - | input.boolean,
|
8236 - | expected.boolean,
|
8237 - | "Unexpected value for `boolean`"
|
8238 - | );
|
8239 - | assert!(
|
8240 - | input.double.float_equals(&expected.double),
|
8241 - | "Unexpected value for `double` {:?} vs. {:?}",
|
8242 - | expected.double,
|
8243 - | input.double
|
8244 - | );
|
8245 - | ::pretty_assertions::assert_eq!(
|
8246 - | input.empty_struct,
|
8247 - | expected.empty_struct,
|
8248 - | "Unexpected value for `empty_struct`"
|
8249 - | );
|
8250 - | assert!(
|
8251 - | input.float.float_equals(&expected.float),
|
8252 - | "Unexpected value for `float` {:?} vs. {:?}",
|
8253 - | expected.float,
|
8254 - | input.float
|
8255 - | );
|
8256 - | ::pretty_assertions::assert_eq!(
|
8257 - | input.httpdate_timestamp,
|
8258 - | expected.httpdate_timestamp,
|
8259 - | "Unexpected value for `httpdate_timestamp`"
|
8260 - | );
|
8261 - | ::pretty_assertions::assert_eq!(
|
8262 - | input.integer,
|
8263 - | expected.integer,
|
8264 - | "Unexpected value for `integer`"
|
8265 - | );
|
8266 - | ::pretty_assertions::assert_eq!(
|
8267 - | input.iso8601_timestamp,
|
8268 - | expected.iso8601_timestamp,
|
8269 - | "Unexpected value for `iso8601_timestamp`"
|
8270 - | );
|
8271 - | ::pretty_assertions::assert_eq!(
|
8272 - | input.json_value,
|
8273 - | expected.json_value,
|
8274 - | "Unexpected value for `json_value`"
|
8275 - | );
|
8276 - | ::pretty_assertions::assert_eq!(
|
8277 - | input.list_of_lists,
|
8278 - | expected.list_of_lists,
|
8279 - | "Unexpected value for `list_of_lists`"
|
8280 - | );
|
8281 - | ::pretty_assertions::assert_eq!(
|
8282 - | input.list_of_maps_of_strings,
|
8283 - | expected.list_of_maps_of_strings,
|
8284 - | "Unexpected value for `list_of_maps_of_strings`"
|
8285 - | );
|
8286 - | ::pretty_assertions::assert_eq!(
|
8287 - | input.list_of_strings,
|
8288 - | expected.list_of_strings,
|
8289 - | "Unexpected value for `list_of_strings`"
|
8290 - | );
|
8291 - | ::pretty_assertions::assert_eq!(
|
8292 - | input.list_of_structs,
|
8293 - | expected.list_of_structs,
|
8294 - | "Unexpected value for `list_of_structs`"
|
8295 - | );
|
8296 - | ::pretty_assertions::assert_eq!(
|
8297 - | input.long,
|
8298 - | expected.long,
|
8299 - | "Unexpected value for `long`"
|
8300 - | );
|
8301 - | ::pretty_assertions::assert_eq!(
|
8302 - | input.map_of_lists_of_strings,
|
8303 - | expected.map_of_lists_of_strings,
|
8304 - | "Unexpected value for `map_of_lists_of_strings`"
|
8305 - | );
|
8306 - | ::pretty_assertions::assert_eq!(
|
8307 - | input.map_of_maps,
|
8308 - | expected.map_of_maps,
|
8309 - | "Unexpected value for `map_of_maps`"
|
8310 - | );
|
8311 - | ::pretty_assertions::assert_eq!(
|
8312 - | input.map_of_strings,
|
8313 - | expected.map_of_strings,
|
8314 - | "Unexpected value for `map_of_strings`"
|
8315 - | );
|
8316 - | ::pretty_assertions::assert_eq!(
|
8317 - | input.map_of_structs,
|
8318 - | expected.map_of_structs,
|
8319 - | "Unexpected value for `map_of_structs`"
|
8320 - | );
|
8321 - | ::pretty_assertions::assert_eq!(
|
8322 - | input.recursive_list,
|
8323 - | expected.recursive_list,
|
8324 - | "Unexpected value for `recursive_list`"
|
8325 - | );
|
8326 - | ::pretty_assertions::assert_eq!(
|
8327 - | input.recursive_map,
|
8328 - | expected.recursive_map,
|
8329 - | "Unexpected value for `recursive_map`"
|
8330 - | );
|
8331 - | ::pretty_assertions::assert_eq!(
|
8332 - | input.recursive_struct,
|
8333 - | expected.recursive_struct,
|
8334 - | "Unexpected value for `recursive_struct`"
|
8335 - | );
|
8336 - | ::pretty_assertions::assert_eq!(
|
8337 - | input.simple_struct,
|
8338 - | expected.simple_struct,
|
8339 - | "Unexpected value for `simple_struct`"
|
8340 - | );
|
8341 - | ::pretty_assertions::assert_eq!(
|
8342 - | input.string,
|
8343 - | expected.string,
|
8344 - | "Unexpected value for `string`"
|
8345 - | );
|
8346 - | ::pretty_assertions::assert_eq!(
|
8347 - | input.struct_with_json_name,
|
8348 - | expected.struct_with_json_name,
|
8349 - | "Unexpected value for `struct_with_json_name`"
|
8350 - | );
|
8351 - | ::pretty_assertions::assert_eq!(
|
8352 - | input.timestamp,
|
8353 - | expected.timestamp,
|
8354 - | "Unexpected value for `timestamp`"
|
8355 - | );
|
8356 - | ::pretty_assertions::assert_eq!(
|
8357 - | input.unix_timestamp,
|
8358 - | expected.unix_timestamp,
|
8359 - | "Unexpected value for `unix_timestamp`"
|
8360 - | );
|
8361 - | let output = crate::output::KitchenSinkOperationOutput {
|
8362 - | blob: ::std::option::Option::None,
|
8363 - | boolean: ::std::option::Option::None,
|
8364 - | double: ::std::option::Option::None,
|
8365 - | empty_struct: ::std::option::Option::None,
|
8366 - | float: ::std::option::Option::None,
|
8367 - | httpdate_timestamp: ::std::option::Option::None,
|
8368 - | integer: ::std::option::Option::None,
|
8369 - | iso8601_timestamp: ::std::option::Option::None,
|
8370 - | json_value: ::std::option::Option::None,
|
8371 - | list_of_lists: ::std::option::Option::None,
|
8372 - | list_of_maps_of_strings: ::std::option::Option::None,
|
8373 - | list_of_strings: ::std::option::Option::None,
|
8374 - | list_of_structs: ::std::option::Option::None,
|
8375 - | long: ::std::option::Option::None,
|
8376 - | map_of_lists_of_strings: ::std::option::Option::None,
|
8377 - | map_of_maps: ::std::option::Option::None,
|
8378 - | map_of_strings: ::std::option::Option::None,
|
8379 - | map_of_structs: ::std::option::Option::None,
|
8380 - | recursive_list: ::std::option::Option::None,
|
8381 - | recursive_map: ::std::option::Option::None,
|
8382 - | recursive_struct: ::std::option::Option::None,
|
8383 - | simple_struct: ::std::option::Option::None,
|
8384 - | string: ::std::option::Option::None,
|
8385 - | struct_with_json_name: ::std::option::Option::None,
|
8386 - | timestamp: ::std::option::Option::None,
|
8387 - | unix_timestamp: ::std::option::Option::None,
|
8388 - | };
|
8389 - | Ok(output)
|
8390 - | };
|
8391 - | sender.send(()).await.expect("receiver dropped early");
|
8392 - | result
|
8393 - | }
|
8394 - | })
|
8395 - | .build_unchecked();
|
8396 - | let http_response = ::tower::ServiceExt::oneshot(service, http_request)
|
8397 - | .await
|
8398 - | .expect("unable to make an HTTP request");
|
8399 - | assert!(
|
8400 - | receiver.recv().await.is_some(),
|
8401 - | "we expected operation handler to be invoked but it was not entered"
|
8402 - | );
|
8403 - | }
|
8404 - |
|
8405 - | /// Serializes map of list shapes
|
8406 - | /// Test ID: serializes_map_of_list_shapes
|
8407 - | #[::tokio::test]
|
8408 - | #[::tracing_test::traced_test]
|
8409 - | async fn serializes_map_of_list_shapes_request() {
|
8410 - | #[allow(unused_mut)]
|
8411 - | let mut http_request = http::Request::builder()
|
8412 - | .uri("/")
|
8413 - | .method("POST")
|
8414 - | .header("Content-Type", "application/x-amz-json-1.1")
|
8415 - | .header("X-Amz-Target", "JsonProtocol.KitchenSinkOperation")
|
8416 - | .body(::aws_smithy_http_server::body::Body::from(
|
8417 - | ::bytes::Bytes::copy_from_slice(
|
8418 - | &::aws_smithy_protocol_test::decode_body_data("{\"MapOfListsOfStrings\":{\"abc\":[\"abc\",\"xyz\"],\"mno\":[\"xyz\",\"abc\"]}}".as_bytes(), ::aws_smithy_protocol_test::MediaType::from("application/json"))
|
8419 - | )
|
8420 - | )).unwrap();
|
8421 - | #[allow(unused_mut)]
|
8422 - | let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
|
8423 - | let config = crate::service::JsonProtocolConfig::builder().build();
|
8424 - | let service = crate::service::JsonProtocol::builder::<::hyper::body::Body, _, _, _>(config)
|
8425 - | .kitchen_sink_operation(move |input: crate::input::KitchenSinkOperationInput| {
|
8426 - | let sender = sender.clone();
|
8427 - | async move {
|
8428 - | let result = {
|
8429 - | use ::aws_smithy_protocol_test::FloatEquals;
|
8430 - | let expected = crate::input::KitchenSinkOperationInput {
|
8431 - | map_of_lists_of_strings: ::std::option::Option::Some({
|
7486 + | },
|
7487 + | {
|
8432 7488 | let mut ret = ::std::collections::HashMap::new();
|
8433 - | ret.insert(
|
8434 - | "abc".to_owned(),
|
8435 - | vec!["abc".to_owned(), "xyz".to_owned()],
|
8436 - | );
|
8437 - | ret.insert(
|
8438 - | "mno".to_owned(),
|
8439 - | vec!["xyz".to_owned(), "abc".to_owned()],
|
8440 - | );
|
7489 + | ret.insert("red".to_owned(), "blue".to_owned());
|
8441 7490 | ret
|
8442 - | }),
|
8443 - | blob: ::std::option::Option::None,
|
8444 - | boolean: ::std::option::Option::None,
|
8445 - | double: ::std::option::Option::None,
|
8446 - | empty_struct: ::std::option::Option::None,
|
8447 - | float: ::std::option::Option::None,
|
8448 - | httpdate_timestamp: ::std::option::Option::None,
|
8449 - | integer: ::std::option::Option::None,
|
8450 - | iso8601_timestamp: ::std::option::Option::None,
|
8451 - | json_value: ::std::option::Option::None,
|
8452 - | list_of_lists: ::std::option::Option::None,
|
8453 - | list_of_maps_of_strings: ::std::option::Option::None,
|
8454 - | list_of_strings: ::std::option::Option::None,
|
8455 - | list_of_structs: ::std::option::Option::None,
|
8456 - | long: ::std::option::Option::None,
|
8457 - | map_of_maps: ::std::option::Option::None,
|
8458 - | map_of_strings: ::std::option::Option::None,
|
8459 - | map_of_structs: ::std::option::Option::None,
|
8460 - | recursive_list: ::std::option::Option::None,
|
8461 - | recursive_map: ::std::option::Option::None,
|
8462 - | recursive_struct: ::std::option::Option::None,
|
8463 - | simple_struct: ::std::option::Option::None,
|
8464 - | string: ::std::option::Option::None,
|
8465 - | struct_with_json_name: ::std::option::Option::None,
|
8466 - | timestamp: ::std::option::Option::None,
|
8467 - | unix_timestamp: ::std::option::Option::None,
|
8468 - | };
|
8469 - | ::pretty_assertions::assert_eq!(
|
8470 - | input.blob,
|
8471 - | expected.blob,
|
8472 - | "Unexpected value for `blob`"
|
8473 - | );
|
8474 - | ::pretty_assertions::assert_eq!(
|
8475 - | input.boolean,
|
8476 - | expected.boolean,
|
8477 - | "Unexpected value for `boolean`"
|
8478 - | );
|
8479 - | assert!(
|
8480 - | input.double.float_equals(&expected.double),
|
8481 - | "Unexpected value for `double` {:?} vs. {:?}",
|
8482 - | expected.double,
|
8483 - | input.double
|
8484 - | );
|
8485 - | ::pretty_assertions::assert_eq!(
|
8486 - | input.empty_struct,
|
8487 - | expected.empty_struct,
|
8488 - | "Unexpected value for `empty_struct`"
|
8489 - | );
|
8490 - | assert!(
|
8491 - | input.float.float_equals(&expected.float),
|
8492 - | "Unexpected value for `float` {:?} vs. {:?}",
|
8493 - | expected.float,
|
8494 - | input.float
|
8495 - | );
|
8496 - | ::pretty_assertions::assert_eq!(
|
8497 - | input.httpdate_timestamp,
|
8498 - | expected.httpdate_timestamp,
|
8499 - | "Unexpected value for `httpdate_timestamp`"
|
8500 - | );
|
8501 - | ::pretty_assertions::assert_eq!(
|
8502 - | input.integer,
|
8503 - | expected.integer,
|
8504 - | "Unexpected value for `integer`"
|
8505 - | );
|
8506 - | ::pretty_assertions::assert_eq!(
|
8507 - | input.iso8601_timestamp,
|
8508 - | expected.iso8601_timestamp,
|
8509 - | "Unexpected value for `iso8601_timestamp`"
|
8510 - | );
|
8511 - | ::pretty_assertions::assert_eq!(
|
8512 - | input.json_value,
|
8513 - | expected.json_value,
|
8514 - | "Unexpected value for `json_value`"
|
8515 - | );
|
8516 - | ::pretty_assertions::assert_eq!(
|
8517 - | input.list_of_lists,
|
8518 - | expected.list_of_lists,
|
8519 - | "Unexpected value for `list_of_lists`"
|
8520 - | );
|
8521 - | ::pretty_assertions::assert_eq!(
|
8522 - | input.list_of_maps_of_strings,
|
8523 - | expected.list_of_maps_of_strings,
|
8524 - | "Unexpected value for `list_of_maps_of_strings`"
|
8525 - | );
|
8526 - | ::pretty_assertions::assert_eq!(
|
8527 - | input.list_of_strings,
|
8528 - | expected.list_of_strings,
|
8529 - | "Unexpected value for `list_of_strings`"
|
8530 - | );
|
8531 - | ::pretty_assertions::assert_eq!(
|
8532 - | input.list_of_structs,
|
8533 - | expected.list_of_structs,
|
8534 - | "Unexpected value for `list_of_structs`"
|
8535 - | );
|
8536 - | ::pretty_assertions::assert_eq!(
|
8537 - | input.long,
|
8538 - | expected.long,
|
8539 - | "Unexpected value for `long`"
|
8540 - | );
|
8541 - | ::pretty_assertions::assert_eq!(
|
8542 - | input.map_of_lists_of_strings,
|
8543 - | expected.map_of_lists_of_strings,
|
8544 - | "Unexpected value for `map_of_lists_of_strings`"
|
8545 - | );
|
8546 - | ::pretty_assertions::assert_eq!(
|
8547 - | input.map_of_maps,
|
8548 - | expected.map_of_maps,
|
8549 - | "Unexpected value for `map_of_maps`"
|
8550 - | );
|
8551 - | ::pretty_assertions::assert_eq!(
|
8552 - | input.map_of_strings,
|
8553 - | expected.map_of_strings,
|
8554 - | "Unexpected value for `map_of_strings`"
|
8555 - | );
|
8556 - | ::pretty_assertions::assert_eq!(
|
8557 - | input.map_of_structs,
|
8558 - | expected.map_of_structs,
|
8559 - | "Unexpected value for `map_of_structs`"
|
8560 - | );
|
8561 - | ::pretty_assertions::assert_eq!(
|
8562 - | input.recursive_list,
|
8563 - | expected.recursive_list,
|
8564 - | "Unexpected value for `recursive_list`"
|
8565 - | );
|
8566 - | ::pretty_assertions::assert_eq!(
|
8567 - | input.recursive_map,
|
8568 - | expected.recursive_map,
|
8569 - | "Unexpected value for `recursive_map`"
|
8570 - | );
|
8571 - | ::pretty_assertions::assert_eq!(
|
8572 - | input.recursive_struct,
|
8573 - | expected.recursive_struct,
|
8574 - | "Unexpected value for `recursive_struct`"
|
8575 - | );
|
8576 - | ::pretty_assertions::assert_eq!(
|
8577 - | input.simple_struct,
|
8578 - | expected.simple_struct,
|
8579 - | "Unexpected value for `simple_struct`"
|
8580 - | );
|
8581 - | ::pretty_assertions::assert_eq!(
|
8582 - | input.string,
|
8583 - | expected.string,
|
8584 - | "Unexpected value for `string`"
|
8585 - | );
|
8586 - | ::pretty_assertions::assert_eq!(
|
8587 - | input.struct_with_json_name,
|
8588 - | expected.struct_with_json_name,
|
8589 - | "Unexpected value for `struct_with_json_name`"
|
8590 - | );
|
8591 - | ::pretty_assertions::assert_eq!(
|
8592 - | input.timestamp,
|
8593 - | expected.timestamp,
|
8594 - | "Unexpected value for `timestamp`"
|
8595 - | );
|
8596 - | ::pretty_assertions::assert_eq!(
|
8597 - | input.unix_timestamp,
|
8598 - | expected.unix_timestamp,
|
8599 - | "Unexpected value for `unix_timestamp`"
|
8600 - | );
|
8601 - | let output = crate::output::KitchenSinkOperationOutput {
|
8602 - | blob: ::std::option::Option::None,
|
8603 - | boolean: ::std::option::Option::None,
|
8604 - | double: ::std::option::Option::None,
|
8605 - | empty_struct: ::std::option::Option::None,
|
8606 - | float: ::std::option::Option::None,
|
8607 - | httpdate_timestamp: ::std::option::Option::None,
|
8608 - | integer: ::std::option::Option::None,
|
8609 - | iso8601_timestamp: ::std::option::Option::None,
|
8610 - | json_value: ::std::option::Option::None,
|
8611 - | list_of_lists: ::std::option::Option::None,
|
8612 - | list_of_maps_of_strings: ::std::option::Option::None,
|
8613 - | list_of_strings: ::std::option::Option::None,
|
8614 - | list_of_structs: ::std::option::Option::None,
|
8615 - | long: ::std::option::Option::None,
|
8616 - | map_of_lists_of_strings: ::std::option::Option::None,
|
8617 - | map_of_maps: ::std::option::Option::None,
|
8618 - | map_of_strings: ::std::option::Option::None,
|
8619 - | map_of_structs: ::std::option::Option::None,
|
8620 - | recursive_list: ::std::option::Option::None,
|
8621 - | recursive_map: ::std::option::Option::None,
|
8622 - | recursive_struct: ::std::option::Option::None,
|
8623 - | simple_struct: ::std::option::Option::None,
|
8624 - | string: ::std::option::Option::None,
|
8625 - | struct_with_json_name: ::std::option::Option::None,
|
8626 - | timestamp: ::std::option::Option::None,
|
8627 - | unix_timestamp: ::std::option::Option::None,
|
8628 - | };
|
8629 - | Ok(output)
|
7491 + | },
|
7492 + | ]),
|
7493 + | blob: ::std::option::Option::None,
|
7494 + | boolean: ::std::option::Option::None,
|
7495 + | double: ::std::option::Option::None,
|
7496 + | empty_struct: ::std::option::Option::None,
|
7497 + | float: ::std::option::Option::None,
|
7498 + | httpdate_timestamp: ::std::option::Option::None,
|
7499 + | integer: ::std::option::Option::None,
|
7500 + | iso8601_timestamp: ::std::option::Option::None,
|
7501 + | json_value: ::std::option::Option::None,
|
7502 + | list_of_lists: ::std::option::Option::None,
|
7503 + | list_of_strings: ::std::option::Option::None,
|
7504 + | list_of_structs: ::std::option::Option::None,
|
7505 + | long: ::std::option::Option::None,
|
7506 + | map_of_lists_of_strings: ::std::option::Option::None,
|
7507 + | map_of_maps: ::std::option::Option::None,
|
7508 + | map_of_strings: ::std::option::Option::None,
|
7509 + | map_of_structs: ::std::option::Option::None,
|
7510 + | recursive_list: ::std::option::Option::None,
|
7511 + | recursive_map: ::std::option::Option::None,
|
7512 + | recursive_struct: ::std::option::Option::None,
|
7513 + | simple_struct: ::std::option::Option::None,
|
7514 + | string: ::std::option::Option::None,
|
7515 + | struct_with_json_name: ::std::option::Option::None,
|
7516 + | timestamp: ::std::option::Option::None,
|
7517 + | unix_timestamp: ::std::option::Option::None,
|
8630 7518 | };
|
8631 - | sender.send(()).await.expect("receiver dropped early");
|
8632 - | result
|
8633 - | }
|
8634 - | })
|
8635 - | .build_unchecked();
|
7519 + | ::pretty_assertions::assert_eq!(
|
7520 + | input.blob,
|
7521 + | expected.blob,
|
7522 + | "Unexpected value for `blob`"
|
7523 + | );
|
7524 + | ::pretty_assertions::assert_eq!(
|
7525 + | input.boolean,
|
7526 + | expected.boolean,
|
7527 + | "Unexpected value for `boolean`"
|
7528 + | );
|
7529 + | assert!(
|
7530 + | input.double.float_equals(&expected.double),
|
7531 + | "Unexpected value for `double` {:?} vs. {:?}",
|
7532 + | expected.double,
|
7533 + | input.double
|
7534 + | );
|
7535 + | ::pretty_assertions::assert_eq!(
|
7536 + | input.empty_struct,
|
7537 + | expected.empty_struct,
|
7538 + | "Unexpected value for `empty_struct`"
|
7539 + | );
|
7540 + | assert!(
|
7541 + | input.float.float_equals(&expected.float),
|
7542 + | "Unexpected value for `float` {:?} vs. {:?}",
|
7543 + | expected.float,
|
7544 + | input.float
|
7545 + | );
|
7546 + | ::pretty_assertions::assert_eq!(
|
7547 + | input.httpdate_timestamp,
|
7548 + | expected.httpdate_timestamp,
|
7549 + | "Unexpected value for `httpdate_timestamp`"
|
7550 + | );
|
7551 + | ::pretty_assertions::assert_eq!(
|
7552 + | input.integer,
|
7553 + | expected.integer,
|
7554 + | "Unexpected value for `integer`"
|
7555 + | );
|
7556 + | ::pretty_assertions::assert_eq!(
|
7557 + | input.iso8601_timestamp,
|
7558 + | expected.iso8601_timestamp,
|
7559 + | "Unexpected value for `iso8601_timestamp`"
|
7560 + | );
|
7561 + | ::pretty_assertions::assert_eq!(
|
7562 + | input.json_value,
|
7563 + | expected.json_value,
|
7564 + | "Unexpected value for `json_value`"
|
7565 + | );
|
7566 + | ::pretty_assertions::assert_eq!(
|
7567 + | input.list_of_lists,
|
7568 + | expected.list_of_lists,
|
7569 + | "Unexpected value for `list_of_lists`"
|
7570 + | );
|
7571 + | ::pretty_assertions::assert_eq!(
|
7572 + | input.list_of_maps_of_strings,
|
7573 + | expected.list_of_maps_of_strings,
|
7574 + | "Unexpected value for `list_of_maps_of_strings`"
|
7575 + | );
|
7576 + | ::pretty_assertions::assert_eq!(
|
7577 + | input.list_of_strings,
|
7578 + | expected.list_of_strings,
|
7579 + | "Unexpected value for `list_of_strings`"
|
7580 + | );
|
7581 + | ::pretty_assertions::assert_eq!(
|
7582 + | input.list_of_structs,
|
7583 + | expected.list_of_structs,
|
7584 + | "Unexpected value for `list_of_structs`"
|
7585 + | );
|
7586 + | ::pretty_assertions::assert_eq!(
|
7587 + | input.long,
|
7588 + | expected.long,
|
7589 + | "Unexpected value for `long`"
|
7590 + | );
|
7591 + | ::pretty_assertions::assert_eq!(
|
7592 + | input.map_of_lists_of_strings,
|
7593 + | expected.map_of_lists_of_strings,
|
7594 + | "Unexpected value for `map_of_lists_of_strings`"
|
7595 + | );
|
7596 + | ::pretty_assertions::assert_eq!(
|
7597 + | input.map_of_maps,
|
7598 + | expected.map_of_maps,
|
7599 + | "Unexpected value for `map_of_maps`"
|
7600 + | );
|
7601 + | ::pretty_assertions::assert_eq!(
|
7602 + | input.map_of_strings,
|
7603 + | expected.map_of_strings,
|
7604 + | "Unexpected value for `map_of_strings`"
|
7605 + | );
|
7606 + | ::pretty_assertions::assert_eq!(
|
7607 + | input.map_of_structs,
|
7608 + | expected.map_of_structs,
|
7609 + | "Unexpected value for `map_of_structs`"
|
7610 + | );
|
7611 + | ::pretty_assertions::assert_eq!(
|
7612 + | input.recursive_list,
|
7613 + | expected.recursive_list,
|
7614 + | "Unexpected value for `recursive_list`"
|
7615 + | );
|
7616 + | ::pretty_assertions::assert_eq!(
|
7617 + | input.recursive_map,
|
7618 + | expected.recursive_map,
|
7619 + | "Unexpected value for `recursive_map`"
|
7620 + | );
|
7621 + | ::pretty_assertions::assert_eq!(
|
7622 + | input.recursive_struct,
|
7623 + | expected.recursive_struct,
|
7624 + | "Unexpected value for `recursive_struct`"
|
7625 + | );
|
7626 + | ::pretty_assertions::assert_eq!(
|
7627 + | input.simple_struct,
|
7628 + | expected.simple_struct,
|
7629 + | "Unexpected value for `simple_struct`"
|
7630 + | );
|
7631 + | ::pretty_assertions::assert_eq!(
|
7632 + | input.string,
|
7633 + | expected.string,
|
7634 + | "Unexpected value for `string`"
|
7635 + | );
|
7636 + | ::pretty_assertions::assert_eq!(
|
7637 + | input.struct_with_json_name,
|
7638 + | expected.struct_with_json_name,
|
7639 + | "Unexpected value for `struct_with_json_name`"
|
7640 + | );
|
7641 + | ::pretty_assertions::assert_eq!(
|
7642 + | input.timestamp,
|
7643 + | expected.timestamp,
|
7644 + | "Unexpected value for `timestamp`"
|
7645 + | );
|
7646 + | ::pretty_assertions::assert_eq!(
|
7647 + | input.unix_timestamp,
|
7648 + | expected.unix_timestamp,
|
7649 + | "Unexpected value for `unix_timestamp`"
|
7650 + | );
|
7651 + | let output = crate::output::KitchenSinkOperationOutput {
|
7652 + | blob: ::std::option::Option::None,
|
7653 + | boolean: ::std::option::Option::None,
|
7654 + | double: ::std::option::Option::None,
|
7655 + | empty_struct: ::std::option::Option::None,
|
7656 + | float: ::std::option::Option::None,
|
7657 + | httpdate_timestamp: ::std::option::Option::None,
|
7658 + | integer: ::std::option::Option::None,
|
7659 + | iso8601_timestamp: ::std::option::Option::None,
|
7660 + | json_value: ::std::option::Option::None,
|
7661 + | list_of_lists: ::std::option::Option::None,
|
7662 + | list_of_maps_of_strings: ::std::option::Option::None,
|
7663 + | list_of_strings: ::std::option::Option::None,
|
7664 + | list_of_structs: ::std::option::Option::None,
|
7665 + | long: ::std::option::Option::None,
|
7666 + | map_of_lists_of_strings: ::std::option::Option::None,
|
7667 + | map_of_maps: ::std::option::Option::None,
|
7668 + | map_of_strings: ::std::option::Option::None,
|
7669 + | map_of_structs: ::std::option::Option::None,
|
7670 + | recursive_list: ::std::option::Option::None,
|
7671 + | recursive_map: ::std::option::Option::None,
|
7672 + | recursive_struct: ::std::option::Option::None,
|
7673 + | simple_struct: ::std::option::Option::None,
|
7674 + | string: ::std::option::Option::None,
|
7675 + | struct_with_json_name: ::std::option::Option::None,
|
7676 + | timestamp: ::std::option::Option::None,
|
7677 + | unix_timestamp: ::std::option::Option::None,
|
7678 + | };
|
7679 + | Ok(output)
|
7680 + | };
|
7681 + | sender.send(()).await.expect("receiver dropped early");
|
7682 + | result
|
7683 + | }
|
7684 + | })
|
7685 + | .build_unchecked();
|
8636 7686 | let http_response = ::tower::ServiceExt::oneshot(service, http_request)
|
8637 7687 | .await
|
8638 7688 | .expect("unable to make an HTTP request");
|
8639 7689 | assert!(
|
8640 7690 | receiver.recv().await.is_some(),
|
8641 7691 | "we expected operation handler to be invoked but it was not entered"
|
8642 7692 | );
|
8643 7693 | }
|
8644 7694 |
|
8645 - | /// Serializes map of structure shapes
|
8646 - | /// Test ID: serializes_map_of_structure_shapes
|
7695 + | /// Serializes list of structure shapes
|
7696 + | /// Test ID: serializes_list_of_structure_shapes
|
8647 7697 | #[::tokio::test]
|
8648 7698 | #[::tracing_test::traced_test]
|
8649 - | async fn serializes_map_of_structure_shapes_request() {
|
7699 + | async fn serializes_list_of_structure_shapes_request() {
|
8650 7700 | #[allow(unused_mut)]
|
8651 - | let mut http_request = http::Request::builder()
|
7701 + | let mut http_request = ::http_1x::Request::builder()
|
8652 7702 | .uri("/")
|
8653 7703 | .method("POST")
|
8654 7704 | .header("Content-Type", "application/x-amz-json-1.1")
|
8655 7705 | .header("X-Amz-Target", "JsonProtocol.KitchenSinkOperation")
|
8656 - | .body(::aws_smithy_http_server::body::Body::from(
|
8657 - | ::bytes::Bytes::copy_from_slice(
|
8658 - | &::aws_smithy_protocol_test::decode_body_data("{\"MapOfStructs\":{\"key1\":{\"Value\":\"value-1\"},\"key2\":{\"Value\":\"value-2\"}}}".as_bytes(), ::aws_smithy_protocol_test::MediaType::from("application/json"))
|
8659 - | )
|
8660 - | )).unwrap();
|
7706 + | .body(::aws_smithy_http_server::body::boxed(::http_body_util::Full::new(
|
7707 + | ::bytes::Bytes::copy_from_slice(
|
7708 + | &::aws_smithy_protocol_test::decode_body_data("{\"ListOfStructs\":[{\"Value\":\"abc\"},{\"Value\":\"mno\"},{\"Value\":\"xyz\"}]}".as_bytes(), ::aws_smithy_protocol_test::MediaType::from("application/json"))
|
7709 + | )
|
7710 + | ))).unwrap();
|
8661 7711 | #[allow(unused_mut)]
|
8662 7712 | let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
|
8663 7713 | let config = crate::service::JsonProtocolConfig::builder().build();
|
8664 - | let service = crate::service::JsonProtocol::builder::<::hyper::body::Body, _, _, _>(config)
|
8665 - | .kitchen_sink_operation(move |input: crate::input::KitchenSinkOperationInput| {
|
8666 - | let sender = sender.clone();
|
8667 - | async move {
|
8668 - | let result = {
|
8669 - | use ::aws_smithy_protocol_test::FloatEquals;
|
8670 - | let expected = crate::input::KitchenSinkOperationInput {
|
8671 - | map_of_structs: ::std::option::Option::Some({
|
8672 - | let mut ret = ::std::collections::HashMap::new();
|
8673 - | ret.insert(
|
8674 - | "key1".to_owned(),
|
8675 - | crate::model::SimpleStruct {
|
8676 - | value: ::std::option::Option::Some("value-1".to_owned()),
|
8677 - | },
|
8678 - | );
|
8679 - | ret.insert(
|
8680 - | "key2".to_owned(),
|
8681 - | crate::model::SimpleStruct {
|
8682 - | value: ::std::option::Option::Some("value-2".to_owned()),
|
8683 - | },
|
8684 - | );
|
8685 - | ret
|
8686 - | }),
|
8687 - | blob: ::std::option::Option::None,
|
8688 - | boolean: ::std::option::Option::None,
|
8689 - | double: ::std::option::Option::None,
|
8690 - | empty_struct: ::std::option::Option::None,
|
8691 - | float: ::std::option::Option::None,
|
8692 - | httpdate_timestamp: ::std::option::Option::None,
|
8693 - | integer: ::std::option::Option::None,
|
8694 - | iso8601_timestamp: ::std::option::Option::None,
|
8695 - | json_value: ::std::option::Option::None,
|
8696 - | list_of_lists: ::std::option::Option::None,
|
8697 - | list_of_maps_of_strings: ::std::option::Option::None,
|
8698 - | list_of_strings: ::std::option::Option::None,
|
8699 - | list_of_structs: ::std::option::Option::None,
|
8700 - | long: ::std::option::Option::None,
|
8701 - | map_of_lists_of_strings: ::std::option::Option::None,
|
8702 - | map_of_maps: ::std::option::Option::None,
|
8703 - | map_of_strings: ::std::option::Option::None,
|
8704 - | recursive_list: ::std::option::Option::None,
|
8705 - | recursive_map: ::std::option::Option::None,
|
8706 - | recursive_struct: ::std::option::Option::None,
|
8707 - | simple_struct: ::std::option::Option::None,
|
8708 - | string: ::std::option::Option::None,
|
8709 - | struct_with_json_name: ::std::option::Option::None,
|
8710 - | timestamp: ::std::option::Option::None,
|
8711 - | unix_timestamp: ::std::option::Option::None,
|
8712 - | };
|
8713 - | ::pretty_assertions::assert_eq!(
|
8714 - | input.blob,
|
8715 - | expected.blob,
|
8716 - | "Unexpected value for `blob`"
|
8717 - | );
|
8718 - | ::pretty_assertions::assert_eq!(
|
8719 - | input.boolean,
|
8720 - | expected.boolean,
|
8721 - | "Unexpected value for `boolean`"
|
8722 - | );
|
8723 - | assert!(
|
8724 - | input.double.float_equals(&expected.double),
|
8725 - | "Unexpected value for `double` {:?} vs. {:?}",
|
8726 - | expected.double,
|
8727 - | input.double
|
8728 - | );
|
8729 - | ::pretty_assertions::assert_eq!(
|
8730 - | input.empty_struct,
|
8731 - | expected.empty_struct,
|
8732 - | "Unexpected value for `empty_struct`"
|
8733 - | );
|
8734 - | assert!(
|
8735 - | input.float.float_equals(&expected.float),
|
8736 - | "Unexpected value for `float` {:?} vs. {:?}",
|
8737 - | expected.float,
|
8738 - | input.float
|
8739 - | );
|
8740 - | ::pretty_assertions::assert_eq!(
|
8741 - | input.httpdate_timestamp,
|
8742 - | expected.httpdate_timestamp,
|
8743 - | "Unexpected value for `httpdate_timestamp`"
|
8744 - | );
|
8745 - | ::pretty_assertions::assert_eq!(
|
8746 - | input.integer,
|
8747 - | expected.integer,
|
8748 - | "Unexpected value for `integer`"
|
8749 - | );
|
8750 - | ::pretty_assertions::assert_eq!(
|
8751 - | input.iso8601_timestamp,
|
8752 - | expected.iso8601_timestamp,
|
8753 - | "Unexpected value for `iso8601_timestamp`"
|
8754 - | );
|
8755 - | ::pretty_assertions::assert_eq!(
|
8756 - | input.json_value,
|
8757 - | expected.json_value,
|
8758 - | "Unexpected value for `json_value`"
|
8759 - | );
|
8760 - | ::pretty_assertions::assert_eq!(
|
8761 - | input.list_of_lists,
|
8762 - | expected.list_of_lists,
|
8763 - | "Unexpected value for `list_of_lists`"
|
8764 - | );
|
8765 - | ::pretty_assertions::assert_eq!(
|
8766 - | input.list_of_maps_of_strings,
|
8767 - | expected.list_of_maps_of_strings,
|
8768 - | "Unexpected value for `list_of_maps_of_strings`"
|
8769 - | );
|
8770 - | ::pretty_assertions::assert_eq!(
|
8771 - | input.list_of_strings,
|
8772 - | expected.list_of_strings,
|
8773 - | "Unexpected value for `list_of_strings`"
|
8774 - | );
|
8775 - | ::pretty_assertions::assert_eq!(
|
8776 - | input.list_of_structs,
|
8777 - | expected.list_of_structs,
|
8778 - | "Unexpected value for `list_of_structs`"
|
8779 - | );
|
8780 - | ::pretty_assertions::assert_eq!(
|
8781 - | input.long,
|
8782 - | expected.long,
|
8783 - | "Unexpected value for `long`"
|
8784 - | );
|
8785 - | ::pretty_assertions::assert_eq!(
|
8786 - | input.map_of_lists_of_strings,
|
8787 - | expected.map_of_lists_of_strings,
|
8788 - | "Unexpected value for `map_of_lists_of_strings`"
|
8789 - | );
|
8790 - | ::pretty_assertions::assert_eq!(
|
8791 - | input.map_of_maps,
|
8792 - | expected.map_of_maps,
|
8793 - | "Unexpected value for `map_of_maps`"
|
8794 - | );
|
8795 - | ::pretty_assertions::assert_eq!(
|
8796 - | input.map_of_strings,
|
8797 - | expected.map_of_strings,
|
8798 - | "Unexpected value for `map_of_strings`"
|
8799 - | );
|
8800 - | ::pretty_assertions::assert_eq!(
|
8801 - | input.map_of_structs,
|
8802 - | expected.map_of_structs,
|
8803 - | "Unexpected value for `map_of_structs`"
|
8804 - | );
|
8805 - | ::pretty_assertions::assert_eq!(
|
8806 - | input.recursive_list,
|
8807 - | expected.recursive_list,
|
8808 - | "Unexpected value for `recursive_list`"
|
8809 - | );
|
8810 - | ::pretty_assertions::assert_eq!(
|
8811 - | input.recursive_map,
|
8812 - | expected.recursive_map,
|
8813 - | "Unexpected value for `recursive_map`"
|
8814 - | );
|
8815 - | ::pretty_assertions::assert_eq!(
|
8816 - | input.recursive_struct,
|
8817 - | expected.recursive_struct,
|
8818 - | "Unexpected value for `recursive_struct`"
|
8819 - | );
|
8820 - | ::pretty_assertions::assert_eq!(
|
8821 - | input.simple_struct,
|
8822 - | expected.simple_struct,
|
8823 - | "Unexpected value for `simple_struct`"
|
8824 - | );
|
8825 - | ::pretty_assertions::assert_eq!(
|
8826 - | input.string,
|
8827 - | expected.string,
|
8828 - | "Unexpected value for `string`"
|
8829 - | );
|
8830 - | ::pretty_assertions::assert_eq!(
|
8831 - | input.struct_with_json_name,
|
8832 - | expected.struct_with_json_name,
|
8833 - | "Unexpected value for `struct_with_json_name`"
|
8834 - | );
|
8835 - | ::pretty_assertions::assert_eq!(
|
8836 - | input.timestamp,
|
8837 - | expected.timestamp,
|
8838 - | "Unexpected value for `timestamp`"
|
8839 - | );
|
8840 - | ::pretty_assertions::assert_eq!(
|
8841 - | input.unix_timestamp,
|
8842 - | expected.unix_timestamp,
|
8843 - | "Unexpected value for `unix_timestamp`"
|
8844 - | );
|
8845 - | let output = crate::output::KitchenSinkOperationOutput {
|
8846 - | blob: ::std::option::Option::None,
|
8847 - | boolean: ::std::option::Option::None,
|
8848 - | double: ::std::option::Option::None,
|
8849 - | empty_struct: ::std::option::Option::None,
|
8850 - | float: ::std::option::Option::None,
|
8851 - | httpdate_timestamp: ::std::option::Option::None,
|
8852 - | integer: ::std::option::Option::None,
|
8853 - | iso8601_timestamp: ::std::option::Option::None,
|
8854 - | json_value: ::std::option::Option::None,
|
8855 - | list_of_lists: ::std::option::Option::None,
|
8856 - | list_of_maps_of_strings: ::std::option::Option::None,
|
8857 - | list_of_strings: ::std::option::Option::None,
|
8858 - | list_of_structs: ::std::option::Option::None,
|
8859 - | long: ::std::option::Option::None,
|
8860 - | map_of_lists_of_strings: ::std::option::Option::None,
|
8861 - | map_of_maps: ::std::option::Option::None,
|
8862 - | map_of_strings: ::std::option::Option::None,
|
8863 - | map_of_structs: ::std::option::Option::None,
|
8864 - | recursive_list: ::std::option::Option::None,
|
8865 - | recursive_map: ::std::option::Option::None,
|
8866 - | recursive_struct: ::std::option::Option::None,
|
8867 - | simple_struct: ::std::option::Option::None,
|
8868 - | string: ::std::option::Option::None,
|
8869 - | struct_with_json_name: ::std::option::Option::None,
|
8870 - | timestamp: ::std::option::Option::None,
|
8871 - | unix_timestamp: ::std::option::Option::None,
|
8872 - | };
|
8873 - | Ok(output)
|
7714 + | let service = crate::service::JsonProtocol::builder::<
|
7715 + | ::aws_smithy_http_server::body::BoxBody,
|
7716 + | _,
|
7717 + | _,
|
7718 + | _,
|
7719 + | >(config)
|
7720 + | .kitchen_sink_operation(move |input: crate::input::KitchenSinkOperationInput| {
|
7721 + | let sender = sender.clone();
|
7722 + | async move {
|
7723 + | let result = {
|
7724 + | use ::aws_smithy_protocol_test::FloatEquals;
|
7725 + | let expected = crate::input::KitchenSinkOperationInput {
|
7726 + | list_of_structs: ::std::option::Option::Some(vec![
|
7727 + | crate::model::SimpleStruct {
|
7728 + | value: ::std::option::Option::Some("abc".to_owned()),
|
7729 + | },
|
7730 + | crate::model::SimpleStruct {
|
7731 + | value: ::std::option::Option::Some("mno".to_owned()),
|
7732 + | },
|
7733 + | crate::model::SimpleStruct {
|
7734 + | value: ::std::option::Option::Some("xyz".to_owned()),
|
7735 + | },
|
7736 + | ]),
|
7737 + | blob: ::std::option::Option::None,
|
7738 + | boolean: ::std::option::Option::None,
|
7739 + | double: ::std::option::Option::None,
|
7740 + | empty_struct: ::std::option::Option::None,
|
7741 + | float: ::std::option::Option::None,
|
7742 + | httpdate_timestamp: ::std::option::Option::None,
|
7743 + | integer: ::std::option::Option::None,
|
7744 + | iso8601_timestamp: ::std::option::Option::None,
|
7745 + | json_value: ::std::option::Option::None,
|
7746 + | list_of_lists: ::std::option::Option::None,
|
7747 + | list_of_maps_of_strings: ::std::option::Option::None,
|
7748 + | list_of_strings: ::std::option::Option::None,
|
7749 + | long: ::std::option::Option::None,
|
7750 + | map_of_lists_of_strings: ::std::option::Option::None,
|
7751 + | map_of_maps: ::std::option::Option::None,
|
7752 + | map_of_strings: ::std::option::Option::None,
|
7753 + | map_of_structs: ::std::option::Option::None,
|
7754 + | recursive_list: ::std::option::Option::None,
|
7755 + | recursive_map: ::std::option::Option::None,
|
7756 + | recursive_struct: ::std::option::Option::None,
|
7757 + | simple_struct: ::std::option::Option::None,
|
7758 + | string: ::std::option::Option::None,
|
7759 + | struct_with_json_name: ::std::option::Option::None,
|
7760 + | timestamp: ::std::option::Option::None,
|
7761 + | unix_timestamp: ::std::option::Option::None,
|
8874 7762 | };
|
8875 - | sender.send(()).await.expect("receiver dropped early");
|
8876 - | result
|
8877 - | }
|
8878 - | })
|
8879 - | .build_unchecked();
|
7763 + | ::pretty_assertions::assert_eq!(
|
7764 + | input.blob,
|
7765 + | expected.blob,
|
7766 + | "Unexpected value for `blob`"
|
7767 + | );
|
7768 + | ::pretty_assertions::assert_eq!(
|
7769 + | input.boolean,
|
7770 + | expected.boolean,
|
7771 + | "Unexpected value for `boolean`"
|
7772 + | );
|
7773 + | assert!(
|
7774 + | input.double.float_equals(&expected.double),
|
7775 + | "Unexpected value for `double` {:?} vs. {:?}",
|
7776 + | expected.double,
|
7777 + | input.double
|
7778 + | );
|
7779 + | ::pretty_assertions::assert_eq!(
|
7780 + | input.empty_struct,
|
7781 + | expected.empty_struct,
|
7782 + | "Unexpected value for `empty_struct`"
|
7783 + | );
|
7784 + | assert!(
|
7785 + | input.float.float_equals(&expected.float),
|
7786 + | "Unexpected value for `float` {:?} vs. {:?}",
|
7787 + | expected.float,
|
7788 + | input.float
|
7789 + | );
|
7790 + | ::pretty_assertions::assert_eq!(
|
7791 + | input.httpdate_timestamp,
|
7792 + | expected.httpdate_timestamp,
|
7793 + | "Unexpected value for `httpdate_timestamp`"
|
7794 + | );
|
7795 + | ::pretty_assertions::assert_eq!(
|
7796 + | input.integer,
|
7797 + | expected.integer,
|
7798 + | "Unexpected value for `integer`"
|
7799 + | );
|
7800 + | ::pretty_assertions::assert_eq!(
|
7801 + | input.iso8601_timestamp,
|
7802 + | expected.iso8601_timestamp,
|
7803 + | "Unexpected value for `iso8601_timestamp`"
|
7804 + | );
|
7805 + | ::pretty_assertions::assert_eq!(
|
7806 + | input.json_value,
|
7807 + | expected.json_value,
|
7808 + | "Unexpected value for `json_value`"
|
7809 + | );
|
7810 + | ::pretty_assertions::assert_eq!(
|
7811 + | input.list_of_lists,
|
7812 + | expected.list_of_lists,
|
7813 + | "Unexpected value for `list_of_lists`"
|
7814 + | );
|
7815 + | ::pretty_assertions::assert_eq!(
|
7816 + | input.list_of_maps_of_strings,
|
7817 + | expected.list_of_maps_of_strings,
|
7818 + | "Unexpected value for `list_of_maps_of_strings`"
|
7819 + | );
|
7820 + | ::pretty_assertions::assert_eq!(
|
7821 + | input.list_of_strings,
|
7822 + | expected.list_of_strings,
|
7823 + | "Unexpected value for `list_of_strings`"
|
7824 + | );
|
7825 + | ::pretty_assertions::assert_eq!(
|
7826 + | input.list_of_structs,
|
7827 + | expected.list_of_structs,
|
7828 + | "Unexpected value for `list_of_structs`"
|
7829 + | );
|
7830 + | ::pretty_assertions::assert_eq!(
|
7831 + | input.long,
|
7832 + | expected.long,
|
7833 + | "Unexpected value for `long`"
|
7834 + | );
|
7835 + | ::pretty_assertions::assert_eq!(
|
7836 + | input.map_of_lists_of_strings,
|
7837 + | expected.map_of_lists_of_strings,
|
7838 + | "Unexpected value for `map_of_lists_of_strings`"
|
7839 + | );
|
7840 + | ::pretty_assertions::assert_eq!(
|
7841 + | input.map_of_maps,
|
7842 + | expected.map_of_maps,
|
7843 + | "Unexpected value for `map_of_maps`"
|
7844 + | );
|
7845 + | ::pretty_assertions::assert_eq!(
|
7846 + | input.map_of_strings,
|
7847 + | expected.map_of_strings,
|
7848 + | "Unexpected value for `map_of_strings`"
|
7849 + | );
|
7850 + | ::pretty_assertions::assert_eq!(
|
7851 + | input.map_of_structs,
|
7852 + | expected.map_of_structs,
|
7853 + | "Unexpected value for `map_of_structs`"
|
7854 + | );
|
7855 + | ::pretty_assertions::assert_eq!(
|
7856 + | input.recursive_list,
|
7857 + | expected.recursive_list,
|
7858 + | "Unexpected value for `recursive_list`"
|
7859 + | );
|
7860 + | ::pretty_assertions::assert_eq!(
|
7861 + | input.recursive_map,
|
7862 + | expected.recursive_map,
|
7863 + | "Unexpected value for `recursive_map`"
|
7864 + | );
|
7865 + | ::pretty_assertions::assert_eq!(
|
7866 + | input.recursive_struct,
|
7867 + | expected.recursive_struct,
|
7868 + | "Unexpected value for `recursive_struct`"
|
7869 + | );
|
7870 + | ::pretty_assertions::assert_eq!(
|
7871 + | input.simple_struct,
|
7872 + | expected.simple_struct,
|
7873 + | "Unexpected value for `simple_struct`"
|
7874 + | );
|
7875 + | ::pretty_assertions::assert_eq!(
|
7876 + | input.string,
|
7877 + | expected.string,
|
7878 + | "Unexpected value for `string`"
|
7879 + | );
|
7880 + | ::pretty_assertions::assert_eq!(
|
7881 + | input.struct_with_json_name,
|
7882 + | expected.struct_with_json_name,
|
7883 + | "Unexpected value for `struct_with_json_name`"
|
7884 + | );
|
7885 + | ::pretty_assertions::assert_eq!(
|
7886 + | input.timestamp,
|
7887 + | expected.timestamp,
|
7888 + | "Unexpected value for `timestamp`"
|
7889 + | );
|
7890 + | ::pretty_assertions::assert_eq!(
|
7891 + | input.unix_timestamp,
|
7892 + | expected.unix_timestamp,
|
7893 + | "Unexpected value for `unix_timestamp`"
|
7894 + | );
|
7895 + | let output = crate::output::KitchenSinkOperationOutput {
|
7896 + | blob: ::std::option::Option::None,
|
7897 + | boolean: ::std::option::Option::None,
|
7898 + | double: ::std::option::Option::None,
|
7899 + | empty_struct: ::std::option::Option::None,
|
7900 + | float: ::std::option::Option::None,
|
7901 + | httpdate_timestamp: ::std::option::Option::None,
|
7902 + | integer: ::std::option::Option::None,
|
7903 + | iso8601_timestamp: ::std::option::Option::None,
|
7904 + | json_value: ::std::option::Option::None,
|
7905 + | list_of_lists: ::std::option::Option::None,
|
7906 + | list_of_maps_of_strings: ::std::option::Option::None,
|
7907 + | list_of_strings: ::std::option::Option::None,
|
7908 + | list_of_structs: ::std::option::Option::None,
|
7909 + | long: ::std::option::Option::None,
|
7910 + | map_of_lists_of_strings: ::std::option::Option::None,
|
7911 + | map_of_maps: ::std::option::Option::None,
|
7912 + | map_of_strings: ::std::option::Option::None,
|
7913 + | map_of_structs: ::std::option::Option::None,
|
7914 + | recursive_list: ::std::option::Option::None,
|
7915 + | recursive_map: ::std::option::Option::None,
|
7916 + | recursive_struct: ::std::option::Option::None,
|
7917 + | simple_struct: ::std::option::Option::None,
|
7918 + | string: ::std::option::Option::None,
|
7919 + | struct_with_json_name: ::std::option::Option::None,
|
7920 + | timestamp: ::std::option::Option::None,
|
7921 + | unix_timestamp: ::std::option::Option::None,
|
7922 + | };
|
7923 + | Ok(output)
|
7924 + | };
|
7925 + | sender.send(()).await.expect("receiver dropped early");
|
7926 + | result
|
7927 + | }
|
7928 + | })
|
7929 + | .build_unchecked();
|
8880 7930 | let http_response = ::tower::ServiceExt::oneshot(service, http_request)
|
8881 7931 | .await
|
8882 7932 | .expect("unable to make an HTTP request");
|
8883 7933 | assert!(
|
8884 7934 | receiver.recv().await.is_some(),
|
8885 7935 | "we expected operation handler to be invoked but it was not entered"
|
8886 7936 | );
|
8887 7937 | }
|
8888 7938 |
|
8889 - | /// Serializes map of recursive structure shapes
|
8890 - | /// Test ID: serializes_map_of_recursive_structure_shapes
|
7939 + | /// Serializes list of recursive structure shapes
|
7940 + | /// Test ID: serializes_list_of_recursive_structure_shapes
|
8891 7941 | #[::tokio::test]
|
8892 7942 | #[::tracing_test::traced_test]
|
8893 - | async fn serializes_map_of_recursive_structure_shapes_request() {
|
7943 + | async fn serializes_list_of_recursive_structure_shapes_request() {
|
8894 7944 | #[allow(unused_mut)]
|
8895 - | let mut http_request = http::Request::builder()
|
7945 + | let mut http_request = ::http_1x::Request::builder()
|
8896 7946 | .uri("/")
|
8897 7947 | .method("POST")
|
8898 7948 | .header("Content-Type", "application/x-amz-json-1.1")
|
8899 7949 | .header("X-Amz-Target", "JsonProtocol.KitchenSinkOperation")
|
8900 - | .body(::aws_smithy_http_server::body::Body::from(
|
8901 - | ::bytes::Bytes::copy_from_slice(
|
8902 - | &::aws_smithy_protocol_test::decode_body_data("{\"RecursiveMap\":{\"key1\":{\"RecursiveMap\":{\"key2\":{\"RecursiveMap\":{\"key3\":{\"Boolean\":false}}}}}}}".as_bytes(), ::aws_smithy_protocol_test::MediaType::from("application/json"))
|
8903 - | )
|
8904 - | )).unwrap();
|
7950 + | .body(::aws_smithy_http_server::body::boxed(::http_body_util::Full::new(
|
7951 + | ::bytes::Bytes::copy_from_slice(
|
7952 + | &::aws_smithy_protocol_test::decode_body_data("{\"RecursiveList\":[{\"RecursiveList\":[{\"RecursiveList\":[{\"Integer\":123}]}]}]}".as_bytes(), ::aws_smithy_protocol_test::MediaType::from("application/json"))
|
7953 + | )
|
7954 + | ))).unwrap();
|
8905 7955 | #[allow(unused_mut)]
|
8906 7956 | let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
|
8907 7957 | let config = crate::service::JsonProtocolConfig::builder().build();
|
8908 - | let service = crate::service::JsonProtocol::builder::<::hyper::body::Body, _, _, _>(config)
|
8909 - | .kitchen_sink_operation(move |input: crate::input::KitchenSinkOperationInput| {
|
8910 - | let sender = sender.clone();
|
8911 - | async move {
|
8912 - | let result = {
|
8913 - | use ::aws_smithy_protocol_test::FloatEquals;
|
8914 - | let expected = crate::input::KitchenSinkOperationInput {
|
8915 - | recursive_map: ::std::option::Option::Some({
|
8916 - | let mut ret = ::std::collections::HashMap::new();
|
8917 - | ret.insert(
|
8918 - | "key1".to_owned(),
|
7958 + | let service = crate::service::JsonProtocol::builder::<
|
7959 + | ::aws_smithy_http_server::body::BoxBody,
|
7960 + | _,
|
7961 + | _,
|
7962 + | _,
|
7963 + | >(config)
|
7964 + | .kitchen_sink_operation(move |input: crate::input::KitchenSinkOperationInput| {
|
7965 + | let sender = sender.clone();
|
7966 + | async move {
|
7967 + | let result = {
|
7968 + | use ::aws_smithy_protocol_test::FloatEquals;
|
7969 + | let expected = crate::input::KitchenSinkOperationInput {
|
7970 + | recursive_list: ::std::option::Option::Some(vec![
|
7971 + | crate::model::KitchenSink {
|
7972 + | recursive_list: ::std::option::Option::Some(vec![
|
8919 7973 | crate::model::KitchenSink {
|
8920 - | recursive_map: ::std::option::Option::Some({
|
8921 - | let mut ret = ::std::collections::HashMap::new();
|
8922 - | ret.insert(
|
8923 - | "key2".to_owned(),
|
8924 - | crate::model::KitchenSink {
|
8925 - | recursive_map: ::std::option::Option::Some({
|
8926 - | let mut ret =
|
8927 - | ::std::collections::HashMap::new();
|
8928 - | ret.insert(
|
8929 - | "key3".to_owned(),
|
8930 - | crate::model::KitchenSink {
|
8931 - | boolean:
|
8932 - | ::std::option::Option::Some(
|
8933 - | false,
|
8934 - | ),
|
8935 - | blob: ::std::option::Option::None,
|
8936 - | double: ::std::option::Option::None,
|
8937 - | empty_struct:
|
8938 - | ::std::option::Option::None,
|
8939 - | float: ::std::option::Option::None,
|
8940 - | httpdate_timestamp:
|
8941 - | ::std::option::Option::None,
|
8942 - | integer:
|
8943 - | ::std::option::Option::None,
|
8944 - | iso8601_timestamp:
|
8945 - | ::std::option::Option::None,
|
8946 - | json_value:
|
8947 - | ::std::option::Option::None,
|
8948 - | list_of_lists:
|
8949 - | ::std::option::Option::None,
|
8950 - | list_of_maps_of_strings:
|
8951 - | ::std::option::Option::None,
|
8952 - | list_of_strings:
|
8953 - | ::std::option::Option::None,
|
8954 - | list_of_structs:
|
8955 - | ::std::option::Option::None,
|
8956 - | long: ::std::option::Option::None,
|
8957 - | map_of_lists_of_strings:
|
8958 - | ::std::option::Option::None,
|
8959 - | map_of_maps:
|
8960 - | ::std::option::Option::None,
|
8961 - | map_of_strings:
|
8962 - | ::std::option::Option::None,
|
8963 - | map_of_structs:
|
8964 - | ::std::option::Option::None,
|
8965 - | recursive_list:
|
8966 - | ::std::option::Option::None,
|
8967 - | recursive_map:
|
8968 - | ::std::option::Option::None,
|
8969 - | recursive_struct:
|
8970 - | ::std::option::Option::None,
|
8971 - | simple_struct:
|
8972 - | ::std::option::Option::None,
|
8973 - | string: ::std::option::Option::None,
|
8974 - | struct_with_json_name:
|
8975 - | ::std::option::Option::None,
|
8976 - | timestamp:
|
8977 - | ::std::option::Option::None,
|
8978 - | unix_timestamp:
|
8979 - | ::std::option::Option::None,
|
8980 - | },
|
8981 - | );
|
8982 - | ret
|
8983 - | }),
|
8984 - | blob: ::std::option::Option::None,
|
8985 - | boolean: ::std::option::Option::None,
|
8986 - | double: ::std::option::Option::None,
|
8987 - | empty_struct: ::std::option::Option::None,
|
8988 - | float: ::std::option::Option::None,
|
8989 - | httpdate_timestamp: ::std::option::Option::None,
|
8990 - | integer: ::std::option::Option::None,
|
8991 - | iso8601_timestamp: ::std::option::Option::None,
|
8992 - | json_value: ::std::option::Option::None,
|
8993 - | list_of_lists: ::std::option::Option::None,
|
8994 - | list_of_maps_of_strings:
|
8995 - | ::std::option::Option::None,
|
8996 - | list_of_strings: ::std::option::Option::None,
|
8997 - | list_of_structs: ::std::option::Option::None,
|
8998 - | long: ::std::option::Option::None,
|
8999 - | map_of_lists_of_strings:
|
9000 - | ::std::option::Option::None,
|
9001 - | map_of_maps: ::std::option::Option::None,
|
9002 - | map_of_strings: ::std::option::Option::None,
|
9003 - | map_of_structs: ::std::option::Option::None,
|
9004 - | recursive_list: ::std::option::Option::None,
|
9005 - | recursive_struct: ::std::option::Option::None,
|
9006 - | simple_struct: ::std::option::Option::None,
|
9007 - | string: ::std::option::Option::None,
|
9008 - | struct_with_json_name:
|
9009 - | ::std::option::Option::None,
|
9010 - | timestamp: ::std::option::Option::None,
|
9011 - | unix_timestamp: ::std::option::Option::None,
|
9012 - | },
|
9013 - | );
|
9014 - | ret
|
9015 - | }),
|
7974 + | recursive_list: ::std::option::Option::Some(vec![
|
7975 + | crate::model::KitchenSink {
|
7976 + | integer: ::std::option::Option::Some(123),
|
7977 + | blob: ::std::option::Option::None,
|
7978 + | boolean: ::std::option::Option::None,
|
7979 + | double: ::std::option::Option::None,
|
7980 + | empty_struct: ::std::option::Option::None,
|
7981 + | float: ::std::option::Option::None,
|
7982 + | httpdate_timestamp: ::std::option::Option::None,
|
7983 + | iso8601_timestamp: ::std::option::Option::None,
|
7984 + | json_value: ::std::option::Option::None,
|
7985 + | list_of_lists: ::std::option::Option::None,
|
7986 + | list_of_maps_of_strings:
|
7987 + | ::std::option::Option::None,
|
7988 + | list_of_strings: ::std::option::Option::None,
|
7989 + | list_of_structs: ::std::option::Option::None,
|
7990 + | long: ::std::option::Option::None,
|
7991 + | map_of_lists_of_strings:
|
7992 + | ::std::option::Option::None,
|
7993 + | map_of_maps: ::std::option::Option::None,
|
7994 + | map_of_strings: ::std::option::Option::None,
|
7995 + | map_of_structs: ::std::option::Option::None,
|
7996 + | recursive_list: ::std::option::Option::None,
|
7997 + | recursive_map: ::std::option::Option::None,
|
7998 + | recursive_struct: ::std::option::Option::None,
|
7999 + | simple_struct: ::std::option::Option::None,
|
8000 + | string: ::std::option::Option::None,
|
8001 + | struct_with_json_name: ::std::option::Option::None,
|
8002 + | timestamp: ::std::option::Option::None,
|
8003 + | unix_timestamp: ::std::option::Option::None,
|
8004 + | },
|
8005 + | ]),
|
9016 8006 | blob: ::std::option::Option::None,
|
9017 8007 | boolean: ::std::option::Option::None,
|
9018 8008 | double: ::std::option::Option::None,
|
9019 8009 | empty_struct: ::std::option::Option::None,
|
9020 8010 | float: ::std::option::Option::None,
|
9021 8011 | httpdate_timestamp: ::std::option::Option::None,
|
9022 8012 | integer: ::std::option::Option::None,
|
9023 8013 | iso8601_timestamp: ::std::option::Option::None,
|
9024 8014 | json_value: ::std::option::Option::None,
|
9025 8015 | list_of_lists: ::std::option::Option::None,
|
9026 8016 | list_of_maps_of_strings: ::std::option::Option::None,
|
9027 8017 | list_of_strings: ::std::option::Option::None,
|
9028 8018 | list_of_structs: ::std::option::Option::None,
|
9029 8019 | long: ::std::option::Option::None,
|
9030 8020 | map_of_lists_of_strings: ::std::option::Option::None,
|
9031 8021 | map_of_maps: ::std::option::Option::None,
|
9032 8022 | map_of_strings: ::std::option::Option::None,
|
9033 8023 | map_of_structs: ::std::option::Option::None,
|
9034 - | recursive_list: ::std::option::Option::None,
|
8024 + | recursive_map: ::std::option::Option::None,
|
9035 8025 | recursive_struct: ::std::option::Option::None,
|
9036 8026 | simple_struct: ::std::option::Option::None,
|
9037 8027 | string: ::std::option::Option::None,
|
9038 8028 | struct_with_json_name: ::std::option::Option::None,
|
9039 8029 | timestamp: ::std::option::Option::None,
|
9040 8030 | unix_timestamp: ::std::option::Option::None,
|
9041 8031 | },
|
9042 - | );
|
9043 - | ret
|
9044 - | }),
|
9045 - | blob: ::std::option::Option::None,
|
9046 - | boolean: ::std::option::Option::None,
|
9047 - | double: ::std::option::Option::None,
|
9048 - | empty_struct: ::std::option::Option::None,
|
9049 - | float: ::std::option::Option::None,
|
9050 - | httpdate_timestamp: ::std::option::Option::None,
|
9051 - | integer: ::std::option::Option::None,
|
9052 - | iso8601_timestamp: ::std::option::Option::None,
|
9053 - | json_value: ::std::option::Option::None,
|
9054 - | list_of_lists: ::std::option::Option::None,
|
9055 - | list_of_maps_of_strings: ::std::option::Option::None,
|
9056 - | list_of_strings: ::std::option::Option::None,
|
9057 - | list_of_structs: ::std::option::Option::None,
|
9058 - | long: ::std::option::Option::None,
|
9059 - | map_of_lists_of_strings: ::std::option::Option::None,
|
9060 - | map_of_maps: ::std::option::Option::None,
|
9061 - | map_of_strings: ::std::option::Option::None,
|
9062 - | map_of_structs: ::std::option::Option::None,
|
9063 - | recursive_list: ::std::option::Option::None,
|
9064 - | recursive_struct: ::std::option::Option::None,
|
9065 - | simple_struct: ::std::option::Option::None,
|
9066 - | string: ::std::option::Option::None,
|
9067 - | struct_with_json_name: ::std::option::Option::None,
|
9068 - | timestamp: ::std::option::Option::None,
|
9069 - | unix_timestamp: ::std::option::Option::None,
|
9070 - | };
|
9071 - | ::pretty_assertions::assert_eq!(
|
9072 - | input.blob,
|
9073 - | expected.blob,
|
9074 - | "Unexpected value for `blob`"
|
9075 - | );
|
9076 - | ::pretty_assertions::assert_eq!(
|
9077 - | input.boolean,
|
9078 - | expected.boolean,
|
9079 - | "Unexpected value for `boolean`"
|
9080 - | );
|
9081 - | assert!(
|
9082 - | input.double.float_equals(&expected.double),
|
9083 - | "Unexpected value for `double` {:?} vs. {:?}",
|
9084 - | expected.double,
|
9085 - | input.double
|
9086 - | );
|
9087 - | ::pretty_assertions::assert_eq!(
|
9088 - | input.empty_struct,
|
9089 - | expected.empty_struct,
|
9090 - | "Unexpected value for `empty_struct`"
|
9091 - | );
|
9092 - | assert!(
|
9093 - | input.float.float_equals(&expected.float),
|
9094 - | "Unexpected value for `float` {:?} vs. {:?}",
|
9095 - | expected.float,
|
9096 - | input.float
|
9097 - | );
|
9098 - | ::pretty_assertions::assert_eq!(
|
9099 - | input.httpdate_timestamp,
|
9100 - | expected.httpdate_timestamp,
|
9101 - | "Unexpected value for `httpdate_timestamp`"
|
9102 - | );
|
9103 - | ::pretty_assertions::assert_eq!(
|
9104 - | input.integer,
|
9105 - | expected.integer,
|
9106 - | "Unexpected value for `integer`"
|
9107 - | );
|
9108 - | ::pretty_assertions::assert_eq!(
|
9109 - | input.iso8601_timestamp,
|
9110 - | expected.iso8601_timestamp,
|
9111 - | "Unexpected value for `iso8601_timestamp`"
|
9112 - | );
|
9113 - | ::pretty_assertions::assert_eq!(
|
9114 - | input.json_value,
|
9115 - | expected.json_value,
|
9116 - | "Unexpected value for `json_value`"
|
9117 - | );
|
9118 - | ::pretty_assertions::assert_eq!(
|
9119 - | input.list_of_lists,
|
9120 - | expected.list_of_lists,
|
9121 - | "Unexpected value for `list_of_lists`"
|
9122 - | );
|
9123 - | ::pretty_assertions::assert_eq!(
|
9124 - | input.list_of_maps_of_strings,
|
9125 - | expected.list_of_maps_of_strings,
|
9126 - | "Unexpected value for `list_of_maps_of_strings`"
|
9127 - | );
|
9128 - | ::pretty_assertions::assert_eq!(
|
9129 - | input.list_of_strings,
|
9130 - | expected.list_of_strings,
|
9131 - | "Unexpected value for `list_of_strings`"
|
9132 - | );
|
9133 - | ::pretty_assertions::assert_eq!(
|
9134 - | input.list_of_structs,
|
9135 - | expected.list_of_structs,
|
9136 - | "Unexpected value for `list_of_structs`"
|
9137 - | );
|
9138 - | ::pretty_assertions::assert_eq!(
|
9139 - | input.long,
|
9140 - | expected.long,
|
9141 - | "Unexpected value for `long`"
|
9142 - | );
|
9143 - | ::pretty_assertions::assert_eq!(
|
9144 - | input.map_of_lists_of_strings,
|
9145 - | expected.map_of_lists_of_strings,
|
9146 - | "Unexpected value for `map_of_lists_of_strings`"
|
9147 - | );
|
9148 - | ::pretty_assertions::assert_eq!(
|
9149 - | input.map_of_maps,
|
9150 - | expected.map_of_maps,
|
9151 - | "Unexpected value for `map_of_maps`"
|
9152 - | );
|
9153 - | ::pretty_assertions::assert_eq!(
|
9154 - | input.map_of_strings,
|
9155 - | expected.map_of_strings,
|
9156 - | "Unexpected value for `map_of_strings`"
|
9157 - | );
|
9158 - | ::pretty_assertions::assert_eq!(
|
9159 - | input.map_of_structs,
|
9160 - | expected.map_of_structs,
|
9161 - | "Unexpected value for `map_of_structs`"
|
9162 - | );
|
9163 - | ::pretty_assertions::assert_eq!(
|
9164 - | input.recursive_list,
|
9165 - | expected.recursive_list,
|
9166 - | "Unexpected value for `recursive_list`"
|
9167 - | );
|
9168 - | ::pretty_assertions::assert_eq!(
|
9169 - | input.recursive_map,
|
9170 - | expected.recursive_map,
|
9171 - | "Unexpected value for `recursive_map`"
|
9172 - | );
|
9173 - | ::pretty_assertions::assert_eq!(
|
9174 - | input.recursive_struct,
|
9175 - | expected.recursive_struct,
|
9176 - | "Unexpected value for `recursive_struct`"
|
9177 - | );
|
9178 - | ::pretty_assertions::assert_eq!(
|
9179 - | input.simple_struct,
|
9180 - | expected.simple_struct,
|
9181 - | "Unexpected value for `simple_struct`"
|
9182 - | );
|
9183 - | ::pretty_assertions::assert_eq!(
|
9184 - | input.string,
|
9185 - | expected.string,
|
9186 - | "Unexpected value for `string`"
|
9187 - | );
|
9188 - | ::pretty_assertions::assert_eq!(
|
9189 - | input.struct_with_json_name,
|
9190 - | expected.struct_with_json_name,
|
9191 - | "Unexpected value for `struct_with_json_name`"
|
9192 - | );
|
9193 - | ::pretty_assertions::assert_eq!(
|
9194 - | input.timestamp,
|
9195 - | expected.timestamp,
|
9196 - | "Unexpected value for `timestamp`"
|
9197 - | );
|
9198 - | ::pretty_assertions::assert_eq!(
|
9199 - | input.unix_timestamp,
|
9200 - | expected.unix_timestamp,
|
9201 - | "Unexpected value for `unix_timestamp`"
|
9202 - | );
|
9203 - | let output = crate::output::KitchenSinkOperationOutput {
|
9204 - | blob: ::std::option::Option::None,
|
9205 - | boolean: ::std::option::Option::None,
|
9206 - | double: ::std::option::Option::None,
|
9207 - | empty_struct: ::std::option::Option::None,
|
9208 - | float: ::std::option::Option::None,
|
9209 - | httpdate_timestamp: ::std::option::Option::None,
|
9210 - | integer: ::std::option::Option::None,
|
9211 - | iso8601_timestamp: ::std::option::Option::None,
|
9212 - | json_value: ::std::option::Option::None,
|
9213 - | list_of_lists: ::std::option::Option::None,
|
9214 - | list_of_maps_of_strings: ::std::option::Option::None,
|
9215 - | list_of_strings: ::std::option::Option::None,
|
9216 - | list_of_structs: ::std::option::Option::None,
|
9217 - | long: ::std::option::Option::None,
|
9218 - | map_of_lists_of_strings: ::std::option::Option::None,
|
9219 - | map_of_maps: ::std::option::Option::None,
|
9220 - | map_of_strings: ::std::option::Option::None,
|
9221 - | map_of_structs: ::std::option::Option::None,
|
9222 - | recursive_list: ::std::option::Option::None,
|
9223 - | recursive_map: ::std::option::Option::None,
|
9224 - | recursive_struct: ::std::option::Option::None,
|
9225 - | simple_struct: ::std::option::Option::None,
|
9226 - | string: ::std::option::Option::None,
|
9227 - | struct_with_json_name: ::std::option::Option::None,
|
9228 - | timestamp: ::std::option::Option::None,
|
9229 - | unix_timestamp: ::std::option::Option::None,
|
9230 - | };
|
9231 - | Ok(output)
|
8032 + | ]),
|
8033 + | blob: ::std::option::Option::None,
|
8034 + | boolean: ::std::option::Option::None,
|
8035 + | double: ::std::option::Option::None,
|
8036 + | empty_struct: ::std::option::Option::None,
|
8037 + | float: ::std::option::Option::None,
|
8038 + | httpdate_timestamp: ::std::option::Option::None,
|
8039 + | integer: ::std::option::Option::None,
|
8040 + | iso8601_timestamp: ::std::option::Option::None,
|
8041 + | json_value: ::std::option::Option::None,
|
8042 + | list_of_lists: ::std::option::Option::None,
|
8043 + | list_of_maps_of_strings: ::std::option::Option::None,
|
8044 + | list_of_strings: ::std::option::Option::None,
|
8045 + | list_of_structs: ::std::option::Option::None,
|
8046 + | long: ::std::option::Option::None,
|
8047 + | map_of_lists_of_strings: ::std::option::Option::None,
|
8048 + | map_of_maps: ::std::option::Option::None,
|
8049 + | map_of_strings: ::std::option::Option::None,
|
8050 + | map_of_structs: ::std::option::Option::None,
|
8051 + | recursive_map: ::std::option::Option::None,
|
8052 + | recursive_struct: ::std::option::Option::None,
|
8053 + | simple_struct: ::std::option::Option::None,
|
8054 + | string: ::std::option::Option::None,
|
8055 + | struct_with_json_name: ::std::option::Option::None,
|
8056 + | timestamp: ::std::option::Option::None,
|
8057 + | unix_timestamp: ::std::option::Option::None,
|
8058 + | },
|
8059 + | ]),
|
8060 + | blob: ::std::option::Option::None,
|
8061 + | boolean: ::std::option::Option::None,
|
8062 + | double: ::std::option::Option::None,
|
8063 + | empty_struct: ::std::option::Option::None,
|
8064 + | float: ::std::option::Option::None,
|
8065 + | httpdate_timestamp: ::std::option::Option::None,
|
8066 + | integer: ::std::option::Option::None,
|
8067 + | iso8601_timestamp: ::std::option::Option::None,
|
8068 + | json_value: ::std::option::Option::None,
|
8069 + | list_of_lists: ::std::option::Option::None,
|
8070 + | list_of_maps_of_strings: ::std::option::Option::None,
|
8071 + | list_of_strings: ::std::option::Option::None,
|
8072 + | list_of_structs: ::std::option::Option::None,
|
8073 + | long: ::std::option::Option::None,
|
8074 + | map_of_lists_of_strings: ::std::option::Option::None,
|
8075 + | map_of_maps: ::std::option::Option::None,
|
8076 + | map_of_strings: ::std::option::Option::None,
|
8077 + | map_of_structs: ::std::option::Option::None,
|
8078 + | recursive_map: ::std::option::Option::None,
|
8079 + | recursive_struct: ::std::option::Option::None,
|
8080 + | simple_struct: ::std::option::Option::None,
|
8081 + | string: ::std::option::Option::None,
|
8082 + | struct_with_json_name: ::std::option::Option::None,
|
8083 + | timestamp: ::std::option::Option::None,
|
8084 + | unix_timestamp: ::std::option::Option::None,
|
8085 + | };
|
8086 + | ::pretty_assertions::assert_eq!(
|
8087 + | input.blob,
|
8088 + | expected.blob,
|
8089 + | "Unexpected value for `blob`"
|
8090 + | );
|
8091 + | ::pretty_assertions::assert_eq!(
|
8092 + | input.boolean,
|
8093 + | expected.boolean,
|
8094 + | "Unexpected value for `boolean`"
|
8095 + | );
|
8096 + | assert!(
|
8097 + | input.double.float_equals(&expected.double),
|
8098 + | "Unexpected value for `double` {:?} vs. {:?}",
|
8099 + | expected.double,
|
8100 + | input.double
|
8101 + | );
|
8102 + | ::pretty_assertions::assert_eq!(
|
8103 + | input.empty_struct,
|
8104 + | expected.empty_struct,
|
8105 + | "Unexpected value for `empty_struct`"
|
8106 + | );
|
8107 + | assert!(
|
8108 + | input.float.float_equals(&expected.float),
|
8109 + | "Unexpected value for `float` {:?} vs. {:?}",
|
8110 + | expected.float,
|
8111 + | input.float
|
8112 + | );
|
8113 + | ::pretty_assertions::assert_eq!(
|
8114 + | input.httpdate_timestamp,
|
8115 + | expected.httpdate_timestamp,
|
8116 + | "Unexpected value for `httpdate_timestamp`"
|
8117 + | );
|
8118 + | ::pretty_assertions::assert_eq!(
|
8119 + | input.integer,
|
8120 + | expected.integer,
|
8121 + | "Unexpected value for `integer`"
|
8122 + | );
|
8123 + | ::pretty_assertions::assert_eq!(
|
8124 + | input.iso8601_timestamp,
|
8125 + | expected.iso8601_timestamp,
|
8126 + | "Unexpected value for `iso8601_timestamp`"
|
8127 + | );
|
8128 + | ::pretty_assertions::assert_eq!(
|
8129 + | input.json_value,
|
8130 + | expected.json_value,
|
8131 + | "Unexpected value for `json_value`"
|
8132 + | );
|
8133 + | ::pretty_assertions::assert_eq!(
|
8134 + | input.list_of_lists,
|
8135 + | expected.list_of_lists,
|
8136 + | "Unexpected value for `list_of_lists`"
|
8137 + | );
|
8138 + | ::pretty_assertions::assert_eq!(
|
8139 + | input.list_of_maps_of_strings,
|
8140 + | expected.list_of_maps_of_strings,
|
8141 + | "Unexpected value for `list_of_maps_of_strings`"
|
8142 + | );
|
8143 + | ::pretty_assertions::assert_eq!(
|
8144 + | input.list_of_strings,
|
8145 + | expected.list_of_strings,
|
8146 + | "Unexpected value for `list_of_strings`"
|
8147 + | );
|
8148 + | ::pretty_assertions::assert_eq!(
|
8149 + | input.list_of_structs,
|
8150 + | expected.list_of_structs,
|
8151 + | "Unexpected value for `list_of_structs`"
|
8152 + | );
|
8153 + | ::pretty_assertions::assert_eq!(
|
8154 + | input.long,
|
8155 + | expected.long,
|
8156 + | "Unexpected value for `long`"
|
8157 + | );
|
8158 + | ::pretty_assertions::assert_eq!(
|
8159 + | input.map_of_lists_of_strings,
|
8160 + | expected.map_of_lists_of_strings,
|
8161 + | "Unexpected value for `map_of_lists_of_strings`"
|
8162 + | );
|
8163 + | ::pretty_assertions::assert_eq!(
|
8164 + | input.map_of_maps,
|
8165 + | expected.map_of_maps,
|
8166 + | "Unexpected value for `map_of_maps`"
|
8167 + | );
|
8168 + | ::pretty_assertions::assert_eq!(
|
8169 + | input.map_of_strings,
|
8170 + | expected.map_of_strings,
|
8171 + | "Unexpected value for `map_of_strings`"
|
8172 + | );
|
8173 + | ::pretty_assertions::assert_eq!(
|
8174 + | input.map_of_structs,
|
8175 + | expected.map_of_structs,
|
8176 + | "Unexpected value for `map_of_structs`"
|
8177 + | );
|
8178 + | ::pretty_assertions::assert_eq!(
|
8179 + | input.recursive_list,
|
8180 + | expected.recursive_list,
|
8181 + | "Unexpected value for `recursive_list`"
|
8182 + | );
|
8183 + | ::pretty_assertions::assert_eq!(
|
8184 + | input.recursive_map,
|
8185 + | expected.recursive_map,
|
8186 + | "Unexpected value for `recursive_map`"
|
8187 + | );
|
8188 + | ::pretty_assertions::assert_eq!(
|
8189 + | input.recursive_struct,
|
8190 + | expected.recursive_struct,
|
8191 + | "Unexpected value for `recursive_struct`"
|
8192 + | );
|
8193 + | ::pretty_assertions::assert_eq!(
|
8194 + | input.simple_struct,
|
8195 + | expected.simple_struct,
|
8196 + | "Unexpected value for `simple_struct`"
|
8197 + | );
|
8198 + | ::pretty_assertions::assert_eq!(
|
8199 + | input.string,
|
8200 + | expected.string,
|
8201 + | "Unexpected value for `string`"
|
8202 + | );
|
8203 + | ::pretty_assertions::assert_eq!(
|
8204 + | input.struct_with_json_name,
|
8205 + | expected.struct_with_json_name,
|
8206 + | "Unexpected value for `struct_with_json_name`"
|
8207 + | );
|
8208 + | ::pretty_assertions::assert_eq!(
|
8209 + | input.timestamp,
|
8210 + | expected.timestamp,
|
8211 + | "Unexpected value for `timestamp`"
|
8212 + | );
|
8213 + | ::pretty_assertions::assert_eq!(
|
8214 + | input.unix_timestamp,
|
8215 + | expected.unix_timestamp,
|
8216 + | "Unexpected value for `unix_timestamp`"
|
8217 + | );
|
8218 + | let output = crate::output::KitchenSinkOperationOutput {
|
8219 + | blob: ::std::option::Option::None,
|
8220 + | boolean: ::std::option::Option::None,
|
8221 + | double: ::std::option::Option::None,
|
8222 + | empty_struct: ::std::option::Option::None,
|
8223 + | float: ::std::option::Option::None,
|
8224 + | httpdate_timestamp: ::std::option::Option::None,
|
8225 + | integer: ::std::option::Option::None,
|
8226 + | iso8601_timestamp: ::std::option::Option::None,
|
8227 + | json_value: ::std::option::Option::None,
|
8228 + | list_of_lists: ::std::option::Option::None,
|
8229 + | list_of_maps_of_strings: ::std::option::Option::None,
|
8230 + | list_of_strings: ::std::option::Option::None,
|
8231 + | list_of_structs: ::std::option::Option::None,
|
8232 + | long: ::std::option::Option::None,
|
8233 + | map_of_lists_of_strings: ::std::option::Option::None,
|
8234 + | map_of_maps: ::std::option::Option::None,
|
8235 + | map_of_strings: ::std::option::Option::None,
|
8236 + | map_of_structs: ::std::option::Option::None,
|
8237 + | recursive_list: ::std::option::Option::None,
|
8238 + | recursive_map: ::std::option::Option::None,
|
8239 + | recursive_struct: ::std::option::Option::None,
|
8240 + | simple_struct: ::std::option::Option::None,
|
8241 + | string: ::std::option::Option::None,
|
8242 + | struct_with_json_name: ::std::option::Option::None,
|
8243 + | timestamp: ::std::option::Option::None,
|
8244 + | unix_timestamp: ::std::option::Option::None,
|
8245 + | };
|
8246 + | Ok(output)
|
8247 + | };
|
8248 + | sender.send(()).await.expect("receiver dropped early");
|
8249 + | result
|
8250 + | }
|
8251 + | })
|
8252 + | .build_unchecked();
|
8253 + | let http_response = ::tower::ServiceExt::oneshot(service, http_request)
|
8254 + | .await
|
8255 + | .expect("unable to make an HTTP request");
|
8256 + | assert!(
|
8257 + | receiver.recv().await.is_some(),
|
8258 + | "we expected operation handler to be invoked but it was not entered"
|
8259 + | );
|
8260 + | }
|
8261 + |
|
8262 + | /// Serializes map shapes
|
8263 + | /// Test ID: serializes_map_shapes
|
8264 + | #[::tokio::test]
|
8265 + | #[::tracing_test::traced_test]
|
8266 + | async fn serializes_map_shapes_request() {
|
8267 + | #[allow(unused_mut)]
|
8268 + | let mut http_request = ::http_1x::Request::builder()
|
8269 + | .uri("/")
|
8270 + | .method("POST")
|
8271 + | .header("Content-Type", "application/x-amz-json-1.1")
|
8272 + | .header("X-Amz-Target", "JsonProtocol.KitchenSinkOperation")
|
8273 + | .body(::aws_smithy_http_server::body::boxed(
|
8274 + | ::http_body_util::Full::new(::bytes::Bytes::copy_from_slice(
|
8275 + | &::aws_smithy_protocol_test::decode_body_data(
|
8276 + | "{\"MapOfStrings\":{\"abc\":\"xyz\",\"mno\":\"hjk\"}}".as_bytes(),
|
8277 + | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
8278 + | ),
|
8279 + | )),
|
8280 + | ))
|
8281 + | .unwrap();
|
8282 + | #[allow(unused_mut)]
|
8283 + | let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
|
8284 + | let config = crate::service::JsonProtocolConfig::builder().build();
|
8285 + | let service = crate::service::JsonProtocol::builder::<
|
8286 + | ::aws_smithy_http_server::body::BoxBody,
|
8287 + | _,
|
8288 + | _,
|
8289 + | _,
|
8290 + | >(config)
|
8291 + | .kitchen_sink_operation(move |input: crate::input::KitchenSinkOperationInput| {
|
8292 + | let sender = sender.clone();
|
8293 + | async move {
|
8294 + | let result = {
|
8295 + | use ::aws_smithy_protocol_test::FloatEquals;
|
8296 + | let expected = crate::input::KitchenSinkOperationInput {
|
8297 + | map_of_strings: ::std::option::Option::Some({
|
8298 + | let mut ret = ::std::collections::HashMap::new();
|
8299 + | ret.insert("abc".to_owned(), "xyz".to_owned());
|
8300 + | ret.insert("mno".to_owned(), "hjk".to_owned());
|
8301 + | ret
|
8302 + | }),
|
8303 + | blob: ::std::option::Option::None,
|
8304 + | boolean: ::std::option::Option::None,
|
8305 + | double: ::std::option::Option::None,
|
8306 + | empty_struct: ::std::option::Option::None,
|
8307 + | float: ::std::option::Option::None,
|
8308 + | httpdate_timestamp: ::std::option::Option::None,
|
8309 + | integer: ::std::option::Option::None,
|
8310 + | iso8601_timestamp: ::std::option::Option::None,
|
8311 + | json_value: ::std::option::Option::None,
|
8312 + | list_of_lists: ::std::option::Option::None,
|
8313 + | list_of_maps_of_strings: ::std::option::Option::None,
|
8314 + | list_of_strings: ::std::option::Option::None,
|
8315 + | list_of_structs: ::std::option::Option::None,
|
8316 + | long: ::std::option::Option::None,
|
8317 + | map_of_lists_of_strings: ::std::option::Option::None,
|
8318 + | map_of_maps: ::std::option::Option::None,
|
8319 + | map_of_structs: ::std::option::Option::None,
|
8320 + | recursive_list: ::std::option::Option::None,
|
8321 + | recursive_map: ::std::option::Option::None,
|
8322 + | recursive_struct: ::std::option::Option::None,
|
8323 + | simple_struct: ::std::option::Option::None,
|
8324 + | string: ::std::option::Option::None,
|
8325 + | struct_with_json_name: ::std::option::Option::None,
|
8326 + | timestamp: ::std::option::Option::None,
|
8327 + | unix_timestamp: ::std::option::Option::None,
|
8328 + | };
|
8329 + | ::pretty_assertions::assert_eq!(
|
8330 + | input.blob,
|
8331 + | expected.blob,
|
8332 + | "Unexpected value for `blob`"
|
8333 + | );
|
8334 + | ::pretty_assertions::assert_eq!(
|
8335 + | input.boolean,
|
8336 + | expected.boolean,
|
8337 + | "Unexpected value for `boolean`"
|
8338 + | );
|
8339 + | assert!(
|
8340 + | input.double.float_equals(&expected.double),
|
8341 + | "Unexpected value for `double` {:?} vs. {:?}",
|
8342 + | expected.double,
|
8343 + | input.double
|
8344 + | );
|
8345 + | ::pretty_assertions::assert_eq!(
|
8346 + | input.empty_struct,
|
8347 + | expected.empty_struct,
|
8348 + | "Unexpected value for `empty_struct`"
|
8349 + | );
|
8350 + | assert!(
|
8351 + | input.float.float_equals(&expected.float),
|
8352 + | "Unexpected value for `float` {:?} vs. {:?}",
|
8353 + | expected.float,
|
8354 + | input.float
|
8355 + | );
|
8356 + | ::pretty_assertions::assert_eq!(
|
8357 + | input.httpdate_timestamp,
|
8358 + | expected.httpdate_timestamp,
|
8359 + | "Unexpected value for `httpdate_timestamp`"
|
8360 + | );
|
8361 + | ::pretty_assertions::assert_eq!(
|
8362 + | input.integer,
|
8363 + | expected.integer,
|
8364 + | "Unexpected value for `integer`"
|
8365 + | );
|
8366 + | ::pretty_assertions::assert_eq!(
|
8367 + | input.iso8601_timestamp,
|
8368 + | expected.iso8601_timestamp,
|
8369 + | "Unexpected value for `iso8601_timestamp`"
|
8370 + | );
|
8371 + | ::pretty_assertions::assert_eq!(
|
8372 + | input.json_value,
|
8373 + | expected.json_value,
|
8374 + | "Unexpected value for `json_value`"
|
8375 + | );
|
8376 + | ::pretty_assertions::assert_eq!(
|
8377 + | input.list_of_lists,
|
8378 + | expected.list_of_lists,
|
8379 + | "Unexpected value for `list_of_lists`"
|
8380 + | );
|
8381 + | ::pretty_assertions::assert_eq!(
|
8382 + | input.list_of_maps_of_strings,
|
8383 + | expected.list_of_maps_of_strings,
|
8384 + | "Unexpected value for `list_of_maps_of_strings`"
|
8385 + | );
|
8386 + | ::pretty_assertions::assert_eq!(
|
8387 + | input.list_of_strings,
|
8388 + | expected.list_of_strings,
|
8389 + | "Unexpected value for `list_of_strings`"
|
8390 + | );
|
8391 + | ::pretty_assertions::assert_eq!(
|
8392 + | input.list_of_structs,
|
8393 + | expected.list_of_structs,
|
8394 + | "Unexpected value for `list_of_structs`"
|
8395 + | );
|
8396 + | ::pretty_assertions::assert_eq!(
|
8397 + | input.long,
|
8398 + | expected.long,
|
8399 + | "Unexpected value for `long`"
|
8400 + | );
|
8401 + | ::pretty_assertions::assert_eq!(
|
8402 + | input.map_of_lists_of_strings,
|
8403 + | expected.map_of_lists_of_strings,
|
8404 + | "Unexpected value for `map_of_lists_of_strings`"
|
8405 + | );
|
8406 + | ::pretty_assertions::assert_eq!(
|
8407 + | input.map_of_maps,
|
8408 + | expected.map_of_maps,
|
8409 + | "Unexpected value for `map_of_maps`"
|
8410 + | );
|
8411 + | ::pretty_assertions::assert_eq!(
|
8412 + | input.map_of_strings,
|
8413 + | expected.map_of_strings,
|
8414 + | "Unexpected value for `map_of_strings`"
|
8415 + | );
|
8416 + | ::pretty_assertions::assert_eq!(
|
8417 + | input.map_of_structs,
|
8418 + | expected.map_of_structs,
|
8419 + | "Unexpected value for `map_of_structs`"
|
8420 + | );
|
8421 + | ::pretty_assertions::assert_eq!(
|
8422 + | input.recursive_list,
|
8423 + | expected.recursive_list,
|
8424 + | "Unexpected value for `recursive_list`"
|
8425 + | );
|
8426 + | ::pretty_assertions::assert_eq!(
|
8427 + | input.recursive_map,
|
8428 + | expected.recursive_map,
|
8429 + | "Unexpected value for `recursive_map`"
|
8430 + | );
|
8431 + | ::pretty_assertions::assert_eq!(
|
8432 + | input.recursive_struct,
|
8433 + | expected.recursive_struct,
|
8434 + | "Unexpected value for `recursive_struct`"
|
8435 + | );
|
8436 + | ::pretty_assertions::assert_eq!(
|
8437 + | input.simple_struct,
|
8438 + | expected.simple_struct,
|
8439 + | "Unexpected value for `simple_struct`"
|
8440 + | );
|
8441 + | ::pretty_assertions::assert_eq!(
|
8442 + | input.string,
|
8443 + | expected.string,
|
8444 + | "Unexpected value for `string`"
|
8445 + | );
|
8446 + | ::pretty_assertions::assert_eq!(
|
8447 + | input.struct_with_json_name,
|
8448 + | expected.struct_with_json_name,
|
8449 + | "Unexpected value for `struct_with_json_name`"
|
8450 + | );
|
8451 + | ::pretty_assertions::assert_eq!(
|
8452 + | input.timestamp,
|
8453 + | expected.timestamp,
|
8454 + | "Unexpected value for `timestamp`"
|
8455 + | );
|
8456 + | ::pretty_assertions::assert_eq!(
|
8457 + | input.unix_timestamp,
|
8458 + | expected.unix_timestamp,
|
8459 + | "Unexpected value for `unix_timestamp`"
|
8460 + | );
|
8461 + | let output = crate::output::KitchenSinkOperationOutput {
|
8462 + | blob: ::std::option::Option::None,
|
8463 + | boolean: ::std::option::Option::None,
|
8464 + | double: ::std::option::Option::None,
|
8465 + | empty_struct: ::std::option::Option::None,
|
8466 + | float: ::std::option::Option::None,
|
8467 + | httpdate_timestamp: ::std::option::Option::None,
|
8468 + | integer: ::std::option::Option::None,
|
8469 + | iso8601_timestamp: ::std::option::Option::None,
|
8470 + | json_value: ::std::option::Option::None,
|
8471 + | list_of_lists: ::std::option::Option::None,
|
8472 + | list_of_maps_of_strings: ::std::option::Option::None,
|
8473 + | list_of_strings: ::std::option::Option::None,
|
8474 + | list_of_structs: ::std::option::Option::None,
|
8475 + | long: ::std::option::Option::None,
|
8476 + | map_of_lists_of_strings: ::std::option::Option::None,
|
8477 + | map_of_maps: ::std::option::Option::None,
|
8478 + | map_of_strings: ::std::option::Option::None,
|
8479 + | map_of_structs: ::std::option::Option::None,
|
8480 + | recursive_list: ::std::option::Option::None,
|
8481 + | recursive_map: ::std::option::Option::None,
|
8482 + | recursive_struct: ::std::option::Option::None,
|
8483 + | simple_struct: ::std::option::Option::None,
|
8484 + | string: ::std::option::Option::None,
|
8485 + | struct_with_json_name: ::std::option::Option::None,
|
8486 + | timestamp: ::std::option::Option::None,
|
8487 + | unix_timestamp: ::std::option::Option::None,
|
8488 + | };
|
8489 + | Ok(output)
|
8490 + | };
|
8491 + | sender.send(()).await.expect("receiver dropped early");
|
8492 + | result
|
8493 + | }
|
8494 + | })
|
8495 + | .build_unchecked();
|
8496 + | let http_response = ::tower::ServiceExt::oneshot(service, http_request)
|
8497 + | .await
|
8498 + | .expect("unable to make an HTTP request");
|
8499 + | assert!(
|
8500 + | receiver.recv().await.is_some(),
|
8501 + | "we expected operation handler to be invoked but it was not entered"
|
8502 + | );
|
8503 + | }
|
8504 + |
|
8505 + | /// Serializes empty map shapes
|
8506 + | /// Test ID: serializes_empty_map_shapes
|
8507 + | #[::tokio::test]
|
8508 + | #[::tracing_test::traced_test]
|
8509 + | async fn serializes_empty_map_shapes_request() {
|
8510 + | #[allow(unused_mut)]
|
8511 + | let mut http_request = ::http_1x::Request::builder()
|
8512 + | .uri("/")
|
8513 + | .method("POST")
|
8514 + | .header("Content-Type", "application/x-amz-json-1.1")
|
8515 + | .header("X-Amz-Target", "JsonProtocol.KitchenSinkOperation")
|
8516 + | .body(::aws_smithy_http_server::body::boxed(
|
8517 + | ::http_body_util::Full::new(::bytes::Bytes::copy_from_slice(
|
8518 + | &::aws_smithy_protocol_test::decode_body_data(
|
8519 + | "{\"MapOfStrings\":{}}".as_bytes(),
|
8520 + | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
8521 + | ),
|
8522 + | )),
|
8523 + | ))
|
8524 + | .unwrap();
|
8525 + | #[allow(unused_mut)]
|
8526 + | let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
|
8527 + | let config = crate::service::JsonProtocolConfig::builder().build();
|
8528 + | let service = crate::service::JsonProtocol::builder::<
|
8529 + | ::aws_smithy_http_server::body::BoxBody,
|
8530 + | _,
|
8531 + | _,
|
8532 + | _,
|
8533 + | >(config)
|
8534 + | .kitchen_sink_operation(move |input: crate::input::KitchenSinkOperationInput| {
|
8535 + | let sender = sender.clone();
|
8536 + | async move {
|
8537 + | let result = {
|
8538 + | use ::aws_smithy_protocol_test::FloatEquals;
|
8539 + | let expected = crate::input::KitchenSinkOperationInput {
|
8540 + | map_of_strings: ::std::option::Option::Some(
|
8541 + | ::std::collections::HashMap::new(),
|
8542 + | ),
|
8543 + | blob: ::std::option::Option::None,
|
8544 + | boolean: ::std::option::Option::None,
|
8545 + | double: ::std::option::Option::None,
|
8546 + | empty_struct: ::std::option::Option::None,
|
8547 + | float: ::std::option::Option::None,
|
8548 + | httpdate_timestamp: ::std::option::Option::None,
|
8549 + | integer: ::std::option::Option::None,
|
8550 + | iso8601_timestamp: ::std::option::Option::None,
|
8551 + | json_value: ::std::option::Option::None,
|
8552 + | list_of_lists: ::std::option::Option::None,
|
8553 + | list_of_maps_of_strings: ::std::option::Option::None,
|
8554 + | list_of_strings: ::std::option::Option::None,
|
8555 + | list_of_structs: ::std::option::Option::None,
|
8556 + | long: ::std::option::Option::None,
|
8557 + | map_of_lists_of_strings: ::std::option::Option::None,
|
8558 + | map_of_maps: ::std::option::Option::None,
|
8559 + | map_of_structs: ::std::option::Option::None,
|
8560 + | recursive_list: ::std::option::Option::None,
|
8561 + | recursive_map: ::std::option::Option::None,
|
8562 + | recursive_struct: ::std::option::Option::None,
|
8563 + | simple_struct: ::std::option::Option::None,
|
8564 + | string: ::std::option::Option::None,
|
8565 + | struct_with_json_name: ::std::option::Option::None,
|
8566 + | timestamp: ::std::option::Option::None,
|
8567 + | unix_timestamp: ::std::option::Option::None,
|
8568 + | };
|
8569 + | ::pretty_assertions::assert_eq!(
|
8570 + | input.blob,
|
8571 + | expected.blob,
|
8572 + | "Unexpected value for `blob`"
|
8573 + | );
|
8574 + | ::pretty_assertions::assert_eq!(
|
8575 + | input.boolean,
|
8576 + | expected.boolean,
|
8577 + | "Unexpected value for `boolean`"
|
8578 + | );
|
8579 + | assert!(
|
8580 + | input.double.float_equals(&expected.double),
|
8581 + | "Unexpected value for `double` {:?} vs. {:?}",
|
8582 + | expected.double,
|
8583 + | input.double
|
8584 + | );
|
8585 + | ::pretty_assertions::assert_eq!(
|
8586 + | input.empty_struct,
|
8587 + | expected.empty_struct,
|
8588 + | "Unexpected value for `empty_struct`"
|
8589 + | );
|
8590 + | assert!(
|
8591 + | input.float.float_equals(&expected.float),
|
8592 + | "Unexpected value for `float` {:?} vs. {:?}",
|
8593 + | expected.float,
|
8594 + | input.float
|
8595 + | );
|
8596 + | ::pretty_assertions::assert_eq!(
|
8597 + | input.httpdate_timestamp,
|
8598 + | expected.httpdate_timestamp,
|
8599 + | "Unexpected value for `httpdate_timestamp`"
|
8600 + | );
|
8601 + | ::pretty_assertions::assert_eq!(
|
8602 + | input.integer,
|
8603 + | expected.integer,
|
8604 + | "Unexpected value for `integer`"
|
8605 + | );
|
8606 + | ::pretty_assertions::assert_eq!(
|
8607 + | input.iso8601_timestamp,
|
8608 + | expected.iso8601_timestamp,
|
8609 + | "Unexpected value for `iso8601_timestamp`"
|
8610 + | );
|
8611 + | ::pretty_assertions::assert_eq!(
|
8612 + | input.json_value,
|
8613 + | expected.json_value,
|
8614 + | "Unexpected value for `json_value`"
|
8615 + | );
|
8616 + | ::pretty_assertions::assert_eq!(
|
8617 + | input.list_of_lists,
|
8618 + | expected.list_of_lists,
|
8619 + | "Unexpected value for `list_of_lists`"
|
8620 + | );
|
8621 + | ::pretty_assertions::assert_eq!(
|
8622 + | input.list_of_maps_of_strings,
|
8623 + | expected.list_of_maps_of_strings,
|
8624 + | "Unexpected value for `list_of_maps_of_strings`"
|
8625 + | );
|
8626 + | ::pretty_assertions::assert_eq!(
|
8627 + | input.list_of_strings,
|
8628 + | expected.list_of_strings,
|
8629 + | "Unexpected value for `list_of_strings`"
|
8630 + | );
|
8631 + | ::pretty_assertions::assert_eq!(
|
8632 + | input.list_of_structs,
|
8633 + | expected.list_of_structs,
|
8634 + | "Unexpected value for `list_of_structs`"
|
8635 + | );
|
8636 + | ::pretty_assertions::assert_eq!(
|
8637 + | input.long,
|
8638 + | expected.long,
|
8639 + | "Unexpected value for `long`"
|
8640 + | );
|
8641 + | ::pretty_assertions::assert_eq!(
|
8642 + | input.map_of_lists_of_strings,
|
8643 + | expected.map_of_lists_of_strings,
|
8644 + | "Unexpected value for `map_of_lists_of_strings`"
|
8645 + | );
|
8646 + | ::pretty_assertions::assert_eq!(
|
8647 + | input.map_of_maps,
|
8648 + | expected.map_of_maps,
|
8649 + | "Unexpected value for `map_of_maps`"
|
8650 + | );
|
8651 + | ::pretty_assertions::assert_eq!(
|
8652 + | input.map_of_strings,
|
8653 + | expected.map_of_strings,
|
8654 + | "Unexpected value for `map_of_strings`"
|
8655 + | );
|
8656 + | ::pretty_assertions::assert_eq!(
|
8657 + | input.map_of_structs,
|
8658 + | expected.map_of_structs,
|
8659 + | "Unexpected value for `map_of_structs`"
|
8660 + | );
|
8661 + | ::pretty_assertions::assert_eq!(
|
8662 + | input.recursive_list,
|
8663 + | expected.recursive_list,
|
8664 + | "Unexpected value for `recursive_list`"
|
8665 + | );
|
8666 + | ::pretty_assertions::assert_eq!(
|
8667 + | input.recursive_map,
|
8668 + | expected.recursive_map,
|
8669 + | "Unexpected value for `recursive_map`"
|
8670 + | );
|
8671 + | ::pretty_assertions::assert_eq!(
|
8672 + | input.recursive_struct,
|
8673 + | expected.recursive_struct,
|
8674 + | "Unexpected value for `recursive_struct`"
|
8675 + | );
|
8676 + | ::pretty_assertions::assert_eq!(
|
8677 + | input.simple_struct,
|
8678 + | expected.simple_struct,
|
8679 + | "Unexpected value for `simple_struct`"
|
8680 + | );
|
8681 + | ::pretty_assertions::assert_eq!(
|
8682 + | input.string,
|
8683 + | expected.string,
|
8684 + | "Unexpected value for `string`"
|
8685 + | );
|
8686 + | ::pretty_assertions::assert_eq!(
|
8687 + | input.struct_with_json_name,
|
8688 + | expected.struct_with_json_name,
|
8689 + | "Unexpected value for `struct_with_json_name`"
|
8690 + | );
|
8691 + | ::pretty_assertions::assert_eq!(
|
8692 + | input.timestamp,
|
8693 + | expected.timestamp,
|
8694 + | "Unexpected value for `timestamp`"
|
8695 + | );
|
8696 + | ::pretty_assertions::assert_eq!(
|
8697 + | input.unix_timestamp,
|
8698 + | expected.unix_timestamp,
|
8699 + | "Unexpected value for `unix_timestamp`"
|
8700 + | );
|
8701 + | let output = crate::output::KitchenSinkOperationOutput {
|
8702 + | blob: ::std::option::Option::None,
|
8703 + | boolean: ::std::option::Option::None,
|
8704 + | double: ::std::option::Option::None,
|
8705 + | empty_struct: ::std::option::Option::None,
|
8706 + | float: ::std::option::Option::None,
|
8707 + | httpdate_timestamp: ::std::option::Option::None,
|
8708 + | integer: ::std::option::Option::None,
|
8709 + | iso8601_timestamp: ::std::option::Option::None,
|
8710 + | json_value: ::std::option::Option::None,
|
8711 + | list_of_lists: ::std::option::Option::None,
|
8712 + | list_of_maps_of_strings: ::std::option::Option::None,
|
8713 + | list_of_strings: ::std::option::Option::None,
|
8714 + | list_of_structs: ::std::option::Option::None,
|
8715 + | long: ::std::option::Option::None,
|
8716 + | map_of_lists_of_strings: ::std::option::Option::None,
|
8717 + | map_of_maps: ::std::option::Option::None,
|
8718 + | map_of_strings: ::std::option::Option::None,
|
8719 + | map_of_structs: ::std::option::Option::None,
|
8720 + | recursive_list: ::std::option::Option::None,
|
8721 + | recursive_map: ::std::option::Option::None,
|
8722 + | recursive_struct: ::std::option::Option::None,
|
8723 + | simple_struct: ::std::option::Option::None,
|
8724 + | string: ::std::option::Option::None,
|
8725 + | struct_with_json_name: ::std::option::Option::None,
|
8726 + | timestamp: ::std::option::Option::None,
|
8727 + | unix_timestamp: ::std::option::Option::None,
|
8728 + | };
|
8729 + | Ok(output)
|
8730 + | };
|
8731 + | sender.send(()).await.expect("receiver dropped early");
|
8732 + | result
|
8733 + | }
|
8734 + | })
|
8735 + | .build_unchecked();
|
8736 + | let http_response = ::tower::ServiceExt::oneshot(service, http_request)
|
8737 + | .await
|
8738 + | .expect("unable to make an HTTP request");
|
8739 + | assert!(
|
8740 + | receiver.recv().await.is_some(),
|
8741 + | "we expected operation handler to be invoked but it was not entered"
|
8742 + | );
|
8743 + | }
|
8744 + |
|
8745 + | /// Serializes map of list shapes
|
8746 + | /// Test ID: serializes_map_of_list_shapes
|
8747 + | #[::tokio::test]
|
8748 + | #[::tracing_test::traced_test]
|
8749 + | async fn serializes_map_of_list_shapes_request() {
|
8750 + | #[allow(unused_mut)]
|
8751 + | let mut http_request = ::http_1x::Request::builder()
|
8752 + | .uri("/")
|
8753 + | .method("POST")
|
8754 + | .header("Content-Type", "application/x-amz-json-1.1")
|
8755 + | .header("X-Amz-Target", "JsonProtocol.KitchenSinkOperation")
|
8756 + | .body(::aws_smithy_http_server::body::boxed(::http_body_util::Full::new(
|
8757 + | ::bytes::Bytes::copy_from_slice(
|
8758 + | &::aws_smithy_protocol_test::decode_body_data("{\"MapOfListsOfStrings\":{\"abc\":[\"abc\",\"xyz\"],\"mno\":[\"xyz\",\"abc\"]}}".as_bytes(), ::aws_smithy_protocol_test::MediaType::from("application/json"))
|
8759 + | )
|
8760 + | ))).unwrap();
|
8761 + | #[allow(unused_mut)]
|
8762 + | let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
|
8763 + | let config = crate::service::JsonProtocolConfig::builder().build();
|
8764 + | let service = crate::service::JsonProtocol::builder::<
|
8765 + | ::aws_smithy_http_server::body::BoxBody,
|
8766 + | _,
|
8767 + | _,
|
8768 + | _,
|
8769 + | >(config)
|
8770 + | .kitchen_sink_operation(move |input: crate::input::KitchenSinkOperationInput| {
|
8771 + | let sender = sender.clone();
|
8772 + | async move {
|
8773 + | let result = {
|
8774 + | use ::aws_smithy_protocol_test::FloatEquals;
|
8775 + | let expected = crate::input::KitchenSinkOperationInput {
|
8776 + | map_of_lists_of_strings: ::std::option::Option::Some({
|
8777 + | let mut ret = ::std::collections::HashMap::new();
|
8778 + | ret.insert("abc".to_owned(), vec!["abc".to_owned(), "xyz".to_owned()]);
|
8779 + | ret.insert("mno".to_owned(), vec!["xyz".to_owned(), "abc".to_owned()]);
|
8780 + | ret
|
8781 + | }),
|
8782 + | blob: ::std::option::Option::None,
|
8783 + | boolean: ::std::option::Option::None,
|
8784 + | double: ::std::option::Option::None,
|
8785 + | empty_struct: ::std::option::Option::None,
|
8786 + | float: ::std::option::Option::None,
|
8787 + | httpdate_timestamp: ::std::option::Option::None,
|
8788 + | integer: ::std::option::Option::None,
|
8789 + | iso8601_timestamp: ::std::option::Option::None,
|
8790 + | json_value: ::std::option::Option::None,
|
8791 + | list_of_lists: ::std::option::Option::None,
|
8792 + | list_of_maps_of_strings: ::std::option::Option::None,
|
8793 + | list_of_strings: ::std::option::Option::None,
|
8794 + | list_of_structs: ::std::option::Option::None,
|
8795 + | long: ::std::option::Option::None,
|
8796 + | map_of_maps: ::std::option::Option::None,
|
8797 + | map_of_strings: ::std::option::Option::None,
|
8798 + | map_of_structs: ::std::option::Option::None,
|
8799 + | recursive_list: ::std::option::Option::None,
|
8800 + | recursive_map: ::std::option::Option::None,
|
8801 + | recursive_struct: ::std::option::Option::None,
|
8802 + | simple_struct: ::std::option::Option::None,
|
8803 + | string: ::std::option::Option::None,
|
8804 + | struct_with_json_name: ::std::option::Option::None,
|
8805 + | timestamp: ::std::option::Option::None,
|
8806 + | unix_timestamp: ::std::option::Option::None,
|
8807 + | };
|
8808 + | ::pretty_assertions::assert_eq!(
|
8809 + | input.blob,
|
8810 + | expected.blob,
|
8811 + | "Unexpected value for `blob`"
|
8812 + | );
|
8813 + | ::pretty_assertions::assert_eq!(
|
8814 + | input.boolean,
|
8815 + | expected.boolean,
|
8816 + | "Unexpected value for `boolean`"
|
8817 + | );
|
8818 + | assert!(
|
8819 + | input.double.float_equals(&expected.double),
|
8820 + | "Unexpected value for `double` {:?} vs. {:?}",
|
8821 + | expected.double,
|
8822 + | input.double
|
8823 + | );
|
8824 + | ::pretty_assertions::assert_eq!(
|
8825 + | input.empty_struct,
|
8826 + | expected.empty_struct,
|
8827 + | "Unexpected value for `empty_struct`"
|
8828 + | );
|
8829 + | assert!(
|
8830 + | input.float.float_equals(&expected.float),
|
8831 + | "Unexpected value for `float` {:?} vs. {:?}",
|
8832 + | expected.float,
|
8833 + | input.float
|
8834 + | );
|
8835 + | ::pretty_assertions::assert_eq!(
|
8836 + | input.httpdate_timestamp,
|
8837 + | expected.httpdate_timestamp,
|
8838 + | "Unexpected value for `httpdate_timestamp`"
|
8839 + | );
|
8840 + | ::pretty_assertions::assert_eq!(
|
8841 + | input.integer,
|
8842 + | expected.integer,
|
8843 + | "Unexpected value for `integer`"
|
8844 + | );
|
8845 + | ::pretty_assertions::assert_eq!(
|
8846 + | input.iso8601_timestamp,
|
8847 + | expected.iso8601_timestamp,
|
8848 + | "Unexpected value for `iso8601_timestamp`"
|
8849 + | );
|
8850 + | ::pretty_assertions::assert_eq!(
|
8851 + | input.json_value,
|
8852 + | expected.json_value,
|
8853 + | "Unexpected value for `json_value`"
|
8854 + | );
|
8855 + | ::pretty_assertions::assert_eq!(
|
8856 + | input.list_of_lists,
|
8857 + | expected.list_of_lists,
|
8858 + | "Unexpected value for `list_of_lists`"
|
8859 + | );
|
8860 + | ::pretty_assertions::assert_eq!(
|
8861 + | input.list_of_maps_of_strings,
|
8862 + | expected.list_of_maps_of_strings,
|
8863 + | "Unexpected value for `list_of_maps_of_strings`"
|
8864 + | );
|
8865 + | ::pretty_assertions::assert_eq!(
|
8866 + | input.list_of_strings,
|
8867 + | expected.list_of_strings,
|
8868 + | "Unexpected value for `list_of_strings`"
|
8869 + | );
|
8870 + | ::pretty_assertions::assert_eq!(
|
8871 + | input.list_of_structs,
|
8872 + | expected.list_of_structs,
|
8873 + | "Unexpected value for `list_of_structs`"
|
8874 + | );
|
8875 + | ::pretty_assertions::assert_eq!(
|
8876 + | input.long,
|
8877 + | expected.long,
|
8878 + | "Unexpected value for `long`"
|
8879 + | );
|
8880 + | ::pretty_assertions::assert_eq!(
|
8881 + | input.map_of_lists_of_strings,
|
8882 + | expected.map_of_lists_of_strings,
|
8883 + | "Unexpected value for `map_of_lists_of_strings`"
|
8884 + | );
|
8885 + | ::pretty_assertions::assert_eq!(
|
8886 + | input.map_of_maps,
|
8887 + | expected.map_of_maps,
|
8888 + | "Unexpected value for `map_of_maps`"
|
8889 + | );
|
8890 + | ::pretty_assertions::assert_eq!(
|
8891 + | input.map_of_strings,
|
8892 + | expected.map_of_strings,
|
8893 + | "Unexpected value for `map_of_strings`"
|
8894 + | );
|
8895 + | ::pretty_assertions::assert_eq!(
|
8896 + | input.map_of_structs,
|
8897 + | expected.map_of_structs,
|
8898 + | "Unexpected value for `map_of_structs`"
|
8899 + | );
|
8900 + | ::pretty_assertions::assert_eq!(
|
8901 + | input.recursive_list,
|
8902 + | expected.recursive_list,
|
8903 + | "Unexpected value for `recursive_list`"
|
8904 + | );
|
8905 + | ::pretty_assertions::assert_eq!(
|
8906 + | input.recursive_map,
|
8907 + | expected.recursive_map,
|
8908 + | "Unexpected value for `recursive_map`"
|
8909 + | );
|
8910 + | ::pretty_assertions::assert_eq!(
|
8911 + | input.recursive_struct,
|
8912 + | expected.recursive_struct,
|
8913 + | "Unexpected value for `recursive_struct`"
|
8914 + | );
|
8915 + | ::pretty_assertions::assert_eq!(
|
8916 + | input.simple_struct,
|
8917 + | expected.simple_struct,
|
8918 + | "Unexpected value for `simple_struct`"
|
8919 + | );
|
8920 + | ::pretty_assertions::assert_eq!(
|
8921 + | input.string,
|
8922 + | expected.string,
|
8923 + | "Unexpected value for `string`"
|
8924 + | );
|
8925 + | ::pretty_assertions::assert_eq!(
|
8926 + | input.struct_with_json_name,
|
8927 + | expected.struct_with_json_name,
|
8928 + | "Unexpected value for `struct_with_json_name`"
|
8929 + | );
|
8930 + | ::pretty_assertions::assert_eq!(
|
8931 + | input.timestamp,
|
8932 + | expected.timestamp,
|
8933 + | "Unexpected value for `timestamp`"
|
8934 + | );
|
8935 + | ::pretty_assertions::assert_eq!(
|
8936 + | input.unix_timestamp,
|
8937 + | expected.unix_timestamp,
|
8938 + | "Unexpected value for `unix_timestamp`"
|
8939 + | );
|
8940 + | let output = crate::output::KitchenSinkOperationOutput {
|
8941 + | blob: ::std::option::Option::None,
|
8942 + | boolean: ::std::option::Option::None,
|
8943 + | double: ::std::option::Option::None,
|
8944 + | empty_struct: ::std::option::Option::None,
|
8945 + | float: ::std::option::Option::None,
|
8946 + | httpdate_timestamp: ::std::option::Option::None,
|
8947 + | integer: ::std::option::Option::None,
|
8948 + | iso8601_timestamp: ::std::option::Option::None,
|
8949 + | json_value: ::std::option::Option::None,
|
8950 + | list_of_lists: ::std::option::Option::None,
|
8951 + | list_of_maps_of_strings: ::std::option::Option::None,
|
8952 + | list_of_strings: ::std::option::Option::None,
|
8953 + | list_of_structs: ::std::option::Option::None,
|
8954 + | long: ::std::option::Option::None,
|
8955 + | map_of_lists_of_strings: ::std::option::Option::None,
|
8956 + | map_of_maps: ::std::option::Option::None,
|
8957 + | map_of_strings: ::std::option::Option::None,
|
8958 + | map_of_structs: ::std::option::Option::None,
|
8959 + | recursive_list: ::std::option::Option::None,
|
8960 + | recursive_map: ::std::option::Option::None,
|
8961 + | recursive_struct: ::std::option::Option::None,
|
8962 + | simple_struct: ::std::option::Option::None,
|
8963 + | string: ::std::option::Option::None,
|
8964 + | struct_with_json_name: ::std::option::Option::None,
|
8965 + | timestamp: ::std::option::Option::None,
|
8966 + | unix_timestamp: ::std::option::Option::None,
|
8967 + | };
|
8968 + | Ok(output)
|
8969 + | };
|
8970 + | sender.send(()).await.expect("receiver dropped early");
|
8971 + | result
|
8972 + | }
|
8973 + | })
|
8974 + | .build_unchecked();
|
8975 + | let http_response = ::tower::ServiceExt::oneshot(service, http_request)
|
8976 + | .await
|
8977 + | .expect("unable to make an HTTP request");
|
8978 + | assert!(
|
8979 + | receiver.recv().await.is_some(),
|
8980 + | "we expected operation handler to be invoked but it was not entered"
|
8981 + | );
|
8982 + | }
|
8983 + |
|
8984 + | /// Serializes map of structure shapes
|
8985 + | /// Test ID: serializes_map_of_structure_shapes
|
8986 + | #[::tokio::test]
|
8987 + | #[::tracing_test::traced_test]
|
8988 + | async fn serializes_map_of_structure_shapes_request() {
|
8989 + | #[allow(unused_mut)]
|
8990 + | let mut http_request = ::http_1x::Request::builder()
|
8991 + | .uri("/")
|
8992 + | .method("POST")
|
8993 + | .header("Content-Type", "application/x-amz-json-1.1")
|
8994 + | .header("X-Amz-Target", "JsonProtocol.KitchenSinkOperation")
|
8995 + | .body(::aws_smithy_http_server::body::boxed(::http_body_util::Full::new(
|
8996 + | ::bytes::Bytes::copy_from_slice(
|
8997 + | &::aws_smithy_protocol_test::decode_body_data("{\"MapOfStructs\":{\"key1\":{\"Value\":\"value-1\"},\"key2\":{\"Value\":\"value-2\"}}}".as_bytes(), ::aws_smithy_protocol_test::MediaType::from("application/json"))
|
8998 + | )
|
8999 + | ))).unwrap();
|
9000 + | #[allow(unused_mut)]
|
9001 + | let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
|
9002 + | let config = crate::service::JsonProtocolConfig::builder().build();
|
9003 + | let service = crate::service::JsonProtocol::builder::<
|
9004 + | ::aws_smithy_http_server::body::BoxBody,
|
9005 + | _,
|
9006 + | _,
|
9007 + | _,
|
9008 + | >(config)
|
9009 + | .kitchen_sink_operation(move |input: crate::input::KitchenSinkOperationInput| {
|
9010 + | let sender = sender.clone();
|
9011 + | async move {
|
9012 + | let result = {
|
9013 + | use ::aws_smithy_protocol_test::FloatEquals;
|
9014 + | let expected = crate::input::KitchenSinkOperationInput {
|
9015 + | map_of_structs: ::std::option::Option::Some({
|
9016 + | let mut ret = ::std::collections::HashMap::new();
|
9017 + | ret.insert(
|
9018 + | "key1".to_owned(),
|
9019 + | crate::model::SimpleStruct {
|
9020 + | value: ::std::option::Option::Some("value-1".to_owned()),
|
9021 + | },
|
9022 + | );
|
9023 + | ret.insert(
|
9024 + | "key2".to_owned(),
|
9025 + | crate::model::SimpleStruct {
|
9026 + | value: ::std::option::Option::Some("value-2".to_owned()),
|
9027 + | },
|
9028 + | );
|
9029 + | ret
|
9030 + | }),
|
9031 + | blob: ::std::option::Option::None,
|
9032 + | boolean: ::std::option::Option::None,
|
9033 + | double: ::std::option::Option::None,
|
9034 + | empty_struct: ::std::option::Option::None,
|
9035 + | float: ::std::option::Option::None,
|
9036 + | httpdate_timestamp: ::std::option::Option::None,
|
9037 + | integer: ::std::option::Option::None,
|
9038 + | iso8601_timestamp: ::std::option::Option::None,
|
9039 + | json_value: ::std::option::Option::None,
|
9040 + | list_of_lists: ::std::option::Option::None,
|
9041 + | list_of_maps_of_strings: ::std::option::Option::None,
|
9042 + | list_of_strings: ::std::option::Option::None,
|
9043 + | list_of_structs: ::std::option::Option::None,
|
9044 + | long: ::std::option::Option::None,
|
9045 + | map_of_lists_of_strings: ::std::option::Option::None,
|
9046 + | map_of_maps: ::std::option::Option::None,
|
9047 + | map_of_strings: ::std::option::Option::None,
|
9048 + | recursive_list: ::std::option::Option::None,
|
9049 + | recursive_map: ::std::option::Option::None,
|
9050 + | recursive_struct: ::std::option::Option::None,
|
9051 + | simple_struct: ::std::option::Option::None,
|
9052 + | string: ::std::option::Option::None,
|
9053 + | struct_with_json_name: ::std::option::Option::None,
|
9054 + | timestamp: ::std::option::Option::None,
|
9055 + | unix_timestamp: ::std::option::Option::None,
|
9056 + | };
|
9057 + | ::pretty_assertions::assert_eq!(
|
9058 + | input.blob,
|
9059 + | expected.blob,
|
9060 + | "Unexpected value for `blob`"
|
9061 + | );
|
9062 + | ::pretty_assertions::assert_eq!(
|
9063 + | input.boolean,
|
9064 + | expected.boolean,
|
9065 + | "Unexpected value for `boolean`"
|
9066 + | );
|
9067 + | assert!(
|
9068 + | input.double.float_equals(&expected.double),
|
9069 + | "Unexpected value for `double` {:?} vs. {:?}",
|
9070 + | expected.double,
|
9071 + | input.double
|
9072 + | );
|
9073 + | ::pretty_assertions::assert_eq!(
|
9074 + | input.empty_struct,
|
9075 + | expected.empty_struct,
|
9076 + | "Unexpected value for `empty_struct`"
|
9077 + | );
|
9078 + | assert!(
|
9079 + | input.float.float_equals(&expected.float),
|
9080 + | "Unexpected value for `float` {:?} vs. {:?}",
|
9081 + | expected.float,
|
9082 + | input.float
|
9083 + | );
|
9084 + | ::pretty_assertions::assert_eq!(
|
9085 + | input.httpdate_timestamp,
|
9086 + | expected.httpdate_timestamp,
|
9087 + | "Unexpected value for `httpdate_timestamp`"
|
9088 + | );
|
9089 + | ::pretty_assertions::assert_eq!(
|
9090 + | input.integer,
|
9091 + | expected.integer,
|
9092 + | "Unexpected value for `integer`"
|
9093 + | );
|
9094 + | ::pretty_assertions::assert_eq!(
|
9095 + | input.iso8601_timestamp,
|
9096 + | expected.iso8601_timestamp,
|
9097 + | "Unexpected value for `iso8601_timestamp`"
|
9098 + | );
|
9099 + | ::pretty_assertions::assert_eq!(
|
9100 + | input.json_value,
|
9101 + | expected.json_value,
|
9102 + | "Unexpected value for `json_value`"
|
9103 + | );
|
9104 + | ::pretty_assertions::assert_eq!(
|
9105 + | input.list_of_lists,
|
9106 + | expected.list_of_lists,
|
9107 + | "Unexpected value for `list_of_lists`"
|
9108 + | );
|
9109 + | ::pretty_assertions::assert_eq!(
|
9110 + | input.list_of_maps_of_strings,
|
9111 + | expected.list_of_maps_of_strings,
|
9112 + | "Unexpected value for `list_of_maps_of_strings`"
|
9113 + | );
|
9114 + | ::pretty_assertions::assert_eq!(
|
9115 + | input.list_of_strings,
|
9116 + | expected.list_of_strings,
|
9117 + | "Unexpected value for `list_of_strings`"
|
9118 + | );
|
9119 + | ::pretty_assertions::assert_eq!(
|
9120 + | input.list_of_structs,
|
9121 + | expected.list_of_structs,
|
9122 + | "Unexpected value for `list_of_structs`"
|
9123 + | );
|
9124 + | ::pretty_assertions::assert_eq!(
|
9125 + | input.long,
|
9126 + | expected.long,
|
9127 + | "Unexpected value for `long`"
|
9128 + | );
|
9129 + | ::pretty_assertions::assert_eq!(
|
9130 + | input.map_of_lists_of_strings,
|
9131 + | expected.map_of_lists_of_strings,
|
9132 + | "Unexpected value for `map_of_lists_of_strings`"
|
9133 + | );
|
9134 + | ::pretty_assertions::assert_eq!(
|
9135 + | input.map_of_maps,
|
9136 + | expected.map_of_maps,
|
9137 + | "Unexpected value for `map_of_maps`"
|
9138 + | );
|
9139 + | ::pretty_assertions::assert_eq!(
|
9140 + | input.map_of_strings,
|
9141 + | expected.map_of_strings,
|
9142 + | "Unexpected value for `map_of_strings`"
|
9143 + | );
|
9144 + | ::pretty_assertions::assert_eq!(
|
9145 + | input.map_of_structs,
|
9146 + | expected.map_of_structs,
|
9147 + | "Unexpected value for `map_of_structs`"
|
9148 + | );
|
9149 + | ::pretty_assertions::assert_eq!(
|
9150 + | input.recursive_list,
|
9151 + | expected.recursive_list,
|
9152 + | "Unexpected value for `recursive_list`"
|
9153 + | );
|
9154 + | ::pretty_assertions::assert_eq!(
|
9155 + | input.recursive_map,
|
9156 + | expected.recursive_map,
|
9157 + | "Unexpected value for `recursive_map`"
|
9158 + | );
|
9159 + | ::pretty_assertions::assert_eq!(
|
9160 + | input.recursive_struct,
|
9161 + | expected.recursive_struct,
|
9162 + | "Unexpected value for `recursive_struct`"
|
9163 + | );
|
9164 + | ::pretty_assertions::assert_eq!(
|
9165 + | input.simple_struct,
|
9166 + | expected.simple_struct,
|
9167 + | "Unexpected value for `simple_struct`"
|
9168 + | );
|
9169 + | ::pretty_assertions::assert_eq!(
|
9170 + | input.string,
|
9171 + | expected.string,
|
9172 + | "Unexpected value for `string`"
|
9173 + | );
|
9174 + | ::pretty_assertions::assert_eq!(
|
9175 + | input.struct_with_json_name,
|
9176 + | expected.struct_with_json_name,
|
9177 + | "Unexpected value for `struct_with_json_name`"
|
9178 + | );
|
9179 + | ::pretty_assertions::assert_eq!(
|
9180 + | input.timestamp,
|
9181 + | expected.timestamp,
|
9182 + | "Unexpected value for `timestamp`"
|
9183 + | );
|
9184 + | ::pretty_assertions::assert_eq!(
|
9185 + | input.unix_timestamp,
|
9186 + | expected.unix_timestamp,
|
9187 + | "Unexpected value for `unix_timestamp`"
|
9188 + | );
|
9189 + | let output = crate::output::KitchenSinkOperationOutput {
|
9190 + | blob: ::std::option::Option::None,
|
9191 + | boolean: ::std::option::Option::None,
|
9192 + | double: ::std::option::Option::None,
|
9193 + | empty_struct: ::std::option::Option::None,
|
9194 + | float: ::std::option::Option::None,
|
9195 + | httpdate_timestamp: ::std::option::Option::None,
|
9196 + | integer: ::std::option::Option::None,
|
9197 + | iso8601_timestamp: ::std::option::Option::None,
|
9198 + | json_value: ::std::option::Option::None,
|
9199 + | list_of_lists: ::std::option::Option::None,
|
9200 + | list_of_maps_of_strings: ::std::option::Option::None,
|
9201 + | list_of_strings: ::std::option::Option::None,
|
9202 + | list_of_structs: ::std::option::Option::None,
|
9203 + | long: ::std::option::Option::None,
|
9204 + | map_of_lists_of_strings: ::std::option::Option::None,
|
9205 + | map_of_maps: ::std::option::Option::None,
|
9206 + | map_of_strings: ::std::option::Option::None,
|
9207 + | map_of_structs: ::std::option::Option::None,
|
9208 + | recursive_list: ::std::option::Option::None,
|
9209 + | recursive_map: ::std::option::Option::None,
|
9210 + | recursive_struct: ::std::option::Option::None,
|
9211 + | simple_struct: ::std::option::Option::None,
|
9212 + | string: ::std::option::Option::None,
|
9213 + | struct_with_json_name: ::std::option::Option::None,
|
9214 + | timestamp: ::std::option::Option::None,
|
9215 + | unix_timestamp: ::std::option::Option::None,
|
9216 + | };
|
9217 + | Ok(output)
|
9218 + | };
|
9219 + | sender.send(()).await.expect("receiver dropped early");
|
9220 + | result
|
9221 + | }
|
9222 + | })
|
9223 + | .build_unchecked();
|
9224 + | let http_response = ::tower::ServiceExt::oneshot(service, http_request)
|
9225 + | .await
|
9226 + | .expect("unable to make an HTTP request");
|
9227 + | assert!(
|
9228 + | receiver.recv().await.is_some(),
|
9229 + | "we expected operation handler to be invoked but it was not entered"
|
9230 + | );
|
9231 + | }
|
9232 + |
|
9233 + | /// Serializes map of recursive structure shapes
|
9234 + | /// Test ID: serializes_map_of_recursive_structure_shapes
|
9235 + | #[::tokio::test]
|
9236 + | #[::tracing_test::traced_test]
|
9237 + | async fn serializes_map_of_recursive_structure_shapes_request() {
|
9238 + | #[allow(unused_mut)]
|
9239 + | let mut http_request = ::http_1x::Request::builder()
|
9240 + | .uri("/")
|
9241 + | .method("POST")
|
9242 + | .header("Content-Type", "application/x-amz-json-1.1")
|
9243 + | .header("X-Amz-Target", "JsonProtocol.KitchenSinkOperation")
|
9244 + | .body(::aws_smithy_http_server::body::boxed(::http_body_util::Full::new(
|
9245 + | ::bytes::Bytes::copy_from_slice(
|
9246 + | &::aws_smithy_protocol_test::decode_body_data("{\"RecursiveMap\":{\"key1\":{\"RecursiveMap\":{\"key2\":{\"RecursiveMap\":{\"key3\":{\"Boolean\":false}}}}}}}".as_bytes(), ::aws_smithy_protocol_test::MediaType::from("application/json"))
|
9247 + | )
|
9248 + | ))).unwrap();
|
9249 + | #[allow(unused_mut)]
|
9250 + | let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
|
9251 + | let config = crate::service::JsonProtocolConfig::builder().build();
|
9252 + | let service = crate::service::JsonProtocol::builder::<
|
9253 + | ::aws_smithy_http_server::body::BoxBody,
|
9254 + | _,
|
9255 + | _,
|
9256 + | _,
|
9257 + | >(config)
|
9258 + | .kitchen_sink_operation(move |input: crate::input::KitchenSinkOperationInput| {
|
9259 + | let sender = sender.clone();
|
9260 + | async move {
|
9261 + | let result = {
|
9262 + | use ::aws_smithy_protocol_test::FloatEquals;
|
9263 + | let expected = crate::input::KitchenSinkOperationInput {
|
9264 + | recursive_map: ::std::option::Option::Some({
|
9265 + | let mut ret = ::std::collections::HashMap::new();
|
9266 + | ret.insert(
|
9267 + | "key1".to_owned(),
|
9268 + | crate::model::KitchenSink {
|
9269 + | recursive_map: ::std::option::Option::Some({
|
9270 + | let mut ret = ::std::collections::HashMap::new();
|
9271 + | ret.insert(
|
9272 + | "key2".to_owned(),
|
9273 + | crate::model::KitchenSink {
|
9274 + | recursive_map: ::std::option::Option::Some({
|
9275 + | let mut ret =
|
9276 + | ::std::collections::HashMap::new();
|
9277 + | ret.insert(
|
9278 + | "key3".to_owned(),
|
9279 + | crate::model::KitchenSink {
|
9280 + | boolean: ::std::option::Option::Some(
|
9281 + | false,
|
9282 + | ),
|
9283 + | blob: ::std::option::Option::None,
|
9284 + | double: ::std::option::Option::None,
|
9285 + | empty_struct:
|
9286 + | ::std::option::Option::None,
|
9287 + | float: ::std::option::Option::None,
|
9288 + | httpdate_timestamp:
|
9289 + | ::std::option::Option::None,
|
9290 + | integer: ::std::option::Option::None,
|
9291 + | iso8601_timestamp:
|
9292 + | ::std::option::Option::None,
|
9293 + | json_value: ::std::option::Option::None,
|
9294 + | list_of_lists:
|
9295 + | ::std::option::Option::None,
|
9296 + | list_of_maps_of_strings:
|
9297 + | ::std::option::Option::None,
|
9298 + | list_of_strings:
|
9299 + | ::std::option::Option::None,
|
9300 + | list_of_structs:
|
9301 + | ::std::option::Option::None,
|
9302 + | long: ::std::option::Option::None,
|
9303 + | map_of_lists_of_strings:
|
9304 + | ::std::option::Option::None,
|
9305 + | map_of_maps:
|
9306 + | ::std::option::Option::None,
|
9307 + | map_of_strings:
|
9308 + | ::std::option::Option::None,
|
9309 + | map_of_structs:
|
9310 + | ::std::option::Option::None,
|
9311 + | recursive_list:
|
9312 + | ::std::option::Option::None,
|
9313 + | recursive_map:
|
9314 + | ::std::option::Option::None,
|
9315 + | recursive_struct:
|
9316 + | ::std::option::Option::None,
|
9317 + | simple_struct:
|
9318 + | ::std::option::Option::None,
|
9319 + | string: ::std::option::Option::None,
|
9320 + | struct_with_json_name:
|
9321 + | ::std::option::Option::None,
|
9322 + | timestamp: ::std::option::Option::None,
|
9323 + | unix_timestamp:
|
9324 + | ::std::option::Option::None,
|
9325 + | },
|
9326 + | );
|
9327 + | ret
|
9328 + | }),
|
9329 + | blob: ::std::option::Option::None,
|
9330 + | boolean: ::std::option::Option::None,
|
9331 + | double: ::std::option::Option::None,
|
9332 + | empty_struct: ::std::option::Option::None,
|
9333 + | float: ::std::option::Option::None,
|
9334 + | httpdate_timestamp: ::std::option::Option::None,
|
9335 + | integer: ::std::option::Option::None,
|
9336 + | iso8601_timestamp: ::std::option::Option::None,
|
9337 + | json_value: ::std::option::Option::None,
|
9338 + | list_of_lists: ::std::option::Option::None,
|
9339 + | list_of_maps_of_strings:
|
9340 + | ::std::option::Option::None,
|
9341 + | list_of_strings: ::std::option::Option::None,
|
9342 + | list_of_structs: ::std::option::Option::None,
|
9343 + | long: ::std::option::Option::None,
|
9344 + | map_of_lists_of_strings:
|
9345 + | ::std::option::Option::None,
|
9346 + | map_of_maps: ::std::option::Option::None,
|
9347 + | map_of_strings: ::std::option::Option::None,
|
9348 + | map_of_structs: ::std::option::Option::None,
|
9349 + | recursive_list: ::std::option::Option::None,
|
9350 + | recursive_struct: ::std::option::Option::None,
|
9351 + | simple_struct: ::std::option::Option::None,
|
9352 + | string: ::std::option::Option::None,
|
9353 + | struct_with_json_name: ::std::option::Option::None,
|
9354 + | timestamp: ::std::option::Option::None,
|
9355 + | unix_timestamp: ::std::option::Option::None,
|
9356 + | },
|
9357 + | );
|
9358 + | ret
|
9359 + | }),
|
9360 + | blob: ::std::option::Option::None,
|
9361 + | boolean: ::std::option::Option::None,
|
9362 + | double: ::std::option::Option::None,
|
9363 + | empty_struct: ::std::option::Option::None,
|
9364 + | float: ::std::option::Option::None,
|
9365 + | httpdate_timestamp: ::std::option::Option::None,
|
9366 + | integer: ::std::option::Option::None,
|
9367 + | iso8601_timestamp: ::std::option::Option::None,
|
9368 + | json_value: ::std::option::Option::None,
|
9369 + | list_of_lists: ::std::option::Option::None,
|
9370 + | list_of_maps_of_strings: ::std::option::Option::None,
|
9371 + | list_of_strings: ::std::option::Option::None,
|
9372 + | list_of_structs: ::std::option::Option::None,
|
9373 + | long: ::std::option::Option::None,
|
9374 + | map_of_lists_of_strings: ::std::option::Option::None,
|
9375 + | map_of_maps: ::std::option::Option::None,
|
9376 + | map_of_strings: ::std::option::Option::None,
|
9377 + | map_of_structs: ::std::option::Option::None,
|
9378 + | recursive_list: ::std::option::Option::None,
|
9379 + | recursive_struct: ::std::option::Option::None,
|
9380 + | simple_struct: ::std::option::Option::None,
|
9381 + | string: ::std::option::Option::None,
|
9382 + | struct_with_json_name: ::std::option::Option::None,
|
9383 + | timestamp: ::std::option::Option::None,
|
9384 + | unix_timestamp: ::std::option::Option::None,
|
9385 + | },
|
9386 + | );
|
9387 + | ret
|
9388 + | }),
|
9389 + | blob: ::std::option::Option::None,
|
9390 + | boolean: ::std::option::Option::None,
|
9391 + | double: ::std::option::Option::None,
|
9392 + | empty_struct: ::std::option::Option::None,
|
9393 + | float: ::std::option::Option::None,
|
9394 + | httpdate_timestamp: ::std::option::Option::None,
|
9395 + | integer: ::std::option::Option::None,
|
9396 + | iso8601_timestamp: ::std::option::Option::None,
|
9397 + | json_value: ::std::option::Option::None,
|
9398 + | list_of_lists: ::std::option::Option::None,
|
9399 + | list_of_maps_of_strings: ::std::option::Option::None,
|
9400 + | list_of_strings: ::std::option::Option::None,
|
9401 + | list_of_structs: ::std::option::Option::None,
|
9402 + | long: ::std::option::Option::None,
|
9403 + | map_of_lists_of_strings: ::std::option::Option::None,
|
9404 + | map_of_maps: ::std::option::Option::None,
|
9405 + | map_of_strings: ::std::option::Option::None,
|
9406 + | map_of_structs: ::std::option::Option::None,
|
9407 + | recursive_list: ::std::option::Option::None,
|
9408 + | recursive_struct: ::std::option::Option::None,
|
9409 + | simple_struct: ::std::option::Option::None,
|
9410 + | string: ::std::option::Option::None,
|
9411 + | struct_with_json_name: ::std::option::Option::None,
|
9412 + | timestamp: ::std::option::Option::None,
|
9413 + | unix_timestamp: ::std::option::Option::None,
|
9232 9414 | };
|
9233 - | sender.send(()).await.expect("receiver dropped early");
|
9234 - | result
|
9235 - | }
|
9236 - | })
|
9237 - | .build_unchecked();
|
9415 + | ::pretty_assertions::assert_eq!(
|
9416 + | input.blob,
|
9417 + | expected.blob,
|
9418 + | "Unexpected value for `blob`"
|
9419 + | );
|
9420 + | ::pretty_assertions::assert_eq!(
|
9421 + | input.boolean,
|
9422 + | expected.boolean,
|
9423 + | "Unexpected value for `boolean`"
|
9424 + | );
|
9425 + | assert!(
|
9426 + | input.double.float_equals(&expected.double),
|
9427 + | "Unexpected value for `double` {:?} vs. {:?}",
|
9428 + | expected.double,
|
9429 + | input.double
|
9430 + | );
|
9431 + | ::pretty_assertions::assert_eq!(
|
9432 + | input.empty_struct,
|
9433 + | expected.empty_struct,
|
9434 + | "Unexpected value for `empty_struct`"
|
9435 + | );
|
9436 + | assert!(
|
9437 + | input.float.float_equals(&expected.float),
|
9438 + | "Unexpected value for `float` {:?} vs. {:?}",
|
9439 + | expected.float,
|
9440 + | input.float
|
9441 + | );
|
9442 + | ::pretty_assertions::assert_eq!(
|
9443 + | input.httpdate_timestamp,
|
9444 + | expected.httpdate_timestamp,
|
9445 + | "Unexpected value for `httpdate_timestamp`"
|
9446 + | );
|
9447 + | ::pretty_assertions::assert_eq!(
|
9448 + | input.integer,
|
9449 + | expected.integer,
|
9450 + | "Unexpected value for `integer`"
|
9451 + | );
|
9452 + | ::pretty_assertions::assert_eq!(
|
9453 + | input.iso8601_timestamp,
|
9454 + | expected.iso8601_timestamp,
|
9455 + | "Unexpected value for `iso8601_timestamp`"
|
9456 + | );
|
9457 + | ::pretty_assertions::assert_eq!(
|
9458 + | input.json_value,
|
9459 + | expected.json_value,
|
9460 + | "Unexpected value for `json_value`"
|
9461 + | );
|
9462 + | ::pretty_assertions::assert_eq!(
|
9463 + | input.list_of_lists,
|
9464 + | expected.list_of_lists,
|
9465 + | "Unexpected value for `list_of_lists`"
|
9466 + | );
|
9467 + | ::pretty_assertions::assert_eq!(
|
9468 + | input.list_of_maps_of_strings,
|
9469 + | expected.list_of_maps_of_strings,
|
9470 + | "Unexpected value for `list_of_maps_of_strings`"
|
9471 + | );
|
9472 + | ::pretty_assertions::assert_eq!(
|
9473 + | input.list_of_strings,
|
9474 + | expected.list_of_strings,
|
9475 + | "Unexpected value for `list_of_strings`"
|
9476 + | );
|
9477 + | ::pretty_assertions::assert_eq!(
|
9478 + | input.list_of_structs,
|
9479 + | expected.list_of_structs,
|
9480 + | "Unexpected value for `list_of_structs`"
|
9481 + | );
|
9482 + | ::pretty_assertions::assert_eq!(
|
9483 + | input.long,
|
9484 + | expected.long,
|
9485 + | "Unexpected value for `long`"
|
9486 + | );
|
9487 + | ::pretty_assertions::assert_eq!(
|
9488 + | input.map_of_lists_of_strings,
|
9489 + | expected.map_of_lists_of_strings,
|
9490 + | "Unexpected value for `map_of_lists_of_strings`"
|
9491 + | );
|
9492 + | ::pretty_assertions::assert_eq!(
|
9493 + | input.map_of_maps,
|
9494 + | expected.map_of_maps,
|
9495 + | "Unexpected value for `map_of_maps`"
|
9496 + | );
|
9497 + | ::pretty_assertions::assert_eq!(
|
9498 + | input.map_of_strings,
|
9499 + | expected.map_of_strings,
|
9500 + | "Unexpected value for `map_of_strings`"
|
9501 + | );
|
9502 + | ::pretty_assertions::assert_eq!(
|
9503 + | input.map_of_structs,
|
9504 + | expected.map_of_structs,
|
9505 + | "Unexpected value for `map_of_structs`"
|
9506 + | );
|
9507 + | ::pretty_assertions::assert_eq!(
|
9508 + | input.recursive_list,
|
9509 + | expected.recursive_list,
|
9510 + | "Unexpected value for `recursive_list`"
|
9511 + | );
|
9512 + | ::pretty_assertions::assert_eq!(
|
9513 + | input.recursive_map,
|
9514 + | expected.recursive_map,
|
9515 + | "Unexpected value for `recursive_map`"
|
9516 + | );
|
9517 + | ::pretty_assertions::assert_eq!(
|
9518 + | input.recursive_struct,
|
9519 + | expected.recursive_struct,
|
9520 + | "Unexpected value for `recursive_struct`"
|
9521 + | );
|
9522 + | ::pretty_assertions::assert_eq!(
|
9523 + | input.simple_struct,
|
9524 + | expected.simple_struct,
|
9525 + | "Unexpected value for `simple_struct`"
|
9526 + | );
|
9527 + | ::pretty_assertions::assert_eq!(
|
9528 + | input.string,
|
9529 + | expected.string,
|
9530 + | "Unexpected value for `string`"
|
9531 + | );
|
9532 + | ::pretty_assertions::assert_eq!(
|
9533 + | input.struct_with_json_name,
|
9534 + | expected.struct_with_json_name,
|
9535 + | "Unexpected value for `struct_with_json_name`"
|
9536 + | );
|
9537 + | ::pretty_assertions::assert_eq!(
|
9538 + | input.timestamp,
|
9539 + | expected.timestamp,
|
9540 + | "Unexpected value for `timestamp`"
|
9541 + | );
|
9542 + | ::pretty_assertions::assert_eq!(
|
9543 + | input.unix_timestamp,
|
9544 + | expected.unix_timestamp,
|
9545 + | "Unexpected value for `unix_timestamp`"
|
9546 + | );
|
9547 + | let output = crate::output::KitchenSinkOperationOutput {
|
9548 + | blob: ::std::option::Option::None,
|
9549 + | boolean: ::std::option::Option::None,
|
9550 + | double: ::std::option::Option::None,
|
9551 + | empty_struct: ::std::option::Option::None,
|
9552 + | float: ::std::option::Option::None,
|
9553 + | httpdate_timestamp: ::std::option::Option::None,
|
9554 + | integer: ::std::option::Option::None,
|
9555 + | iso8601_timestamp: ::std::option::Option::None,
|
9556 + | json_value: ::std::option::Option::None,
|
9557 + | list_of_lists: ::std::option::Option::None,
|
9558 + | list_of_maps_of_strings: ::std::option::Option::None,
|
9559 + | list_of_strings: ::std::option::Option::None,
|
9560 + | list_of_structs: ::std::option::Option::None,
|
9561 + | long: ::std::option::Option::None,
|
9562 + | map_of_lists_of_strings: ::std::option::Option::None,
|
9563 + | map_of_maps: ::std::option::Option::None,
|
9564 + | map_of_strings: ::std::option::Option::None,
|
9565 + | map_of_structs: ::std::option::Option::None,
|
9566 + | recursive_list: ::std::option::Option::None,
|
9567 + | recursive_map: ::std::option::Option::None,
|
9568 + | recursive_struct: ::std::option::Option::None,
|
9569 + | simple_struct: ::std::option::Option::None,
|
9570 + | string: ::std::option::Option::None,
|
9571 + | struct_with_json_name: ::std::option::Option::None,
|
9572 + | timestamp: ::std::option::Option::None,
|
9573 + | unix_timestamp: ::std::option::Option::None,
|
9574 + | };
|
9575 + | Ok(output)
|
9576 + | };
|
9577 + | sender.send(()).await.expect("receiver dropped early");
|
9578 + | result
|
9579 + | }
|
9580 + | })
|
9581 + | .build_unchecked();
|
9238 9582 | let http_response = ::tower::ServiceExt::oneshot(service, http_request)
|
9239 9583 | .await
|
9240 9584 | .expect("unable to make an HTTP request");
|
9241 9585 | assert!(
|
9242 9586 | receiver.recv().await.is_some(),
|
9243 9587 | "we expected operation handler to be invoked but it was not entered"
|
9244 9588 | );
|
9245 9589 | }
|
9246 9590 |
|
9247 9591 | /// Serializes structure shapes
|
9248 9592 | /// Test ID: serializes_structure_shapes
|
9249 9593 | #[::tokio::test]
|
9250 9594 | #[::tracing_test::traced_test]
|
9251 9595 | async fn serializes_structure_shapes_request() {
|
9252 9596 | #[allow(unused_mut)]
|
9253 - | let mut http_request = http::Request::builder()
|
9597 + | let mut http_request = ::http_1x::Request::builder()
|
9254 9598 | .uri("/")
|
9255 9599 | .method("POST")
|
9256 9600 | .header("Content-Type", "application/x-amz-json-1.1")
|
9257 9601 | .header("X-Amz-Target", "JsonProtocol.KitchenSinkOperation")
|
9258 - | .body(::aws_smithy_http_server::body::Body::from(
|
9259 - | ::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
|
9260 - | "{\"SimpleStruct\":{\"Value\":\"abc\"}}".as_bytes(),
|
9261 - | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
9602 + | .body(::aws_smithy_http_server::body::boxed(
|
9603 + | ::http_body_util::Full::new(::bytes::Bytes::copy_from_slice(
|
9604 + | &::aws_smithy_protocol_test::decode_body_data(
|
9605 + | "{\"SimpleStruct\":{\"Value\":\"abc\"}}".as_bytes(),
|
9606 + | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
9607 + | ),
|
9262 9608 | )),
|
9263 9609 | ))
|
9264 9610 | .unwrap();
|
9265 9611 | #[allow(unused_mut)]
|
9266 9612 | let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
|
9267 9613 | let config = crate::service::JsonProtocolConfig::builder().build();
|
9268 - | let service = crate::service::JsonProtocol::builder::<::hyper::body::Body, _, _, _>(config)
|
9269 - | .kitchen_sink_operation(move |input: crate::input::KitchenSinkOperationInput| {
|
9270 - | let sender = sender.clone();
|
9271 - | async move {
|
9272 - | let result = {
|
9273 - | use ::aws_smithy_protocol_test::FloatEquals;
|
9274 - | let expected = crate::input::KitchenSinkOperationInput {
|
9275 - | simple_struct: ::std::option::Option::Some(
|
9276 - | crate::model::SimpleStruct {
|
9277 - | value: ::std::option::Option::Some("abc".to_owned()),
|
9278 - | },
|
9279 - | ),
|
9280 - | blob: ::std::option::Option::None,
|
9281 - | boolean: ::std::option::Option::None,
|
9282 - | double: ::std::option::Option::None,
|
9283 - | empty_struct: ::std::option::Option::None,
|
9284 - | float: ::std::option::Option::None,
|
9285 - | httpdate_timestamp: ::std::option::Option::None,
|
9286 - | integer: ::std::option::Option::None,
|
9287 - | iso8601_timestamp: ::std::option::Option::None,
|
9288 - | json_value: ::std::option::Option::None,
|
9289 - | list_of_lists: ::std::option::Option::None,
|
9290 - | list_of_maps_of_strings: ::std::option::Option::None,
|
9291 - | list_of_strings: ::std::option::Option::None,
|
9292 - | list_of_structs: ::std::option::Option::None,
|
9293 - | long: ::std::option::Option::None,
|
9294 - | map_of_lists_of_strings: ::std::option::Option::None,
|
9295 - | map_of_maps: ::std::option::Option::None,
|
9296 - | map_of_strings: ::std::option::Option::None,
|
9297 - | map_of_structs: ::std::option::Option::None,
|
9298 - | recursive_list: ::std::option::Option::None,
|
9299 - | recursive_map: ::std::option::Option::None,
|
9300 - | recursive_struct: ::std::option::Option::None,
|
9301 - | string: ::std::option::Option::None,
|
9302 - | struct_with_json_name: ::std::option::Option::None,
|
9303 - | timestamp: ::std::option::Option::None,
|
9304 - | unix_timestamp: ::std::option::Option::None,
|
9305 - | };
|
9306 - | ::pretty_assertions::assert_eq!(
|
9307 - | input.blob,
|
9308 - | expected.blob,
|
9309 - | "Unexpected value for `blob`"
|
9310 - | );
|
9311 - | ::pretty_assertions::assert_eq!(
|
9312 - | input.boolean,
|
9313 - | expected.boolean,
|
9314 - | "Unexpected value for `boolean`"
|
9315 - | );
|
9316 - | assert!(
|
9317 - | input.double.float_equals(&expected.double),
|
9318 - | "Unexpected value for `double` {:?} vs. {:?}",
|
9319 - | expected.double,
|
9320 - | input.double
|
9321 - | );
|
9322 - | ::pretty_assertions::assert_eq!(
|
9323 - | input.empty_struct,
|
9324 - | expected.empty_struct,
|
9325 - | "Unexpected value for `empty_struct`"
|
9326 - | );
|
9327 - | assert!(
|
9328 - | input.float.float_equals(&expected.float),
|
9329 - | "Unexpected value for `float` {:?} vs. {:?}",
|
9330 - | expected.float,
|
9331 - | input.float
|
9332 - | );
|
9333 - | ::pretty_assertions::assert_eq!(
|
9334 - | input.httpdate_timestamp,
|
9335 - | expected.httpdate_timestamp,
|
9336 - | "Unexpected value for `httpdate_timestamp`"
|
9337 - | );
|
9338 - | ::pretty_assertions::assert_eq!(
|
9339 - | input.integer,
|
9340 - | expected.integer,
|
9341 - | "Unexpected value for `integer`"
|
9342 - | );
|
9343 - | ::pretty_assertions::assert_eq!(
|
9344 - | input.iso8601_timestamp,
|
9345 - | expected.iso8601_timestamp,
|
9346 - | "Unexpected value for `iso8601_timestamp`"
|
9347 - | );
|
9348 - | ::pretty_assertions::assert_eq!(
|
9349 - | input.json_value,
|
9350 - | expected.json_value,
|
9351 - | "Unexpected value for `json_value`"
|
9352 - | );
|
9353 - | ::pretty_assertions::assert_eq!(
|
9354 - | input.list_of_lists,
|
9355 - | expected.list_of_lists,
|
9356 - | "Unexpected value for `list_of_lists`"
|
9357 - | );
|
9358 - | ::pretty_assertions::assert_eq!(
|
9359 - | input.list_of_maps_of_strings,
|
9360 - | expected.list_of_maps_of_strings,
|
9361 - | "Unexpected value for `list_of_maps_of_strings`"
|
9362 - | );
|
9363 - | ::pretty_assertions::assert_eq!(
|
9364 - | input.list_of_strings,
|
9365 - | expected.list_of_strings,
|
9366 - | "Unexpected value for `list_of_strings`"
|
9367 - | );
|
9368 - | ::pretty_assertions::assert_eq!(
|
9369 - | input.list_of_structs,
|
9370 - | expected.list_of_structs,
|
9371 - | "Unexpected value for `list_of_structs`"
|
9372 - | );
|
9373 - | ::pretty_assertions::assert_eq!(
|
9374 - | input.long,
|
9375 - | expected.long,
|
9376 - | "Unexpected value for `long`"
|
9377 - | );
|
9378 - | ::pretty_assertions::assert_eq!(
|
9379 - | input.map_of_lists_of_strings,
|
9380 - | expected.map_of_lists_of_strings,
|
9381 - | "Unexpected value for `map_of_lists_of_strings`"
|
9382 - | );
|
9383 - | ::pretty_assertions::assert_eq!(
|
9384 - | input.map_of_maps,
|
9385 - | expected.map_of_maps,
|
9386 - | "Unexpected value for `map_of_maps`"
|
9387 - | );
|
9388 - | ::pretty_assertions::assert_eq!(
|
9389 - | input.map_of_strings,
|
9390 - | expected.map_of_strings,
|
9391 - | "Unexpected value for `map_of_strings`"
|
9392 - | );
|
9393 - | ::pretty_assertions::assert_eq!(
|
9394 - | input.map_of_structs,
|
9395 - | expected.map_of_structs,
|
9396 - | "Unexpected value for `map_of_structs`"
|
9397 - | );
|
9398 - | ::pretty_assertions::assert_eq!(
|
9399 - | input.recursive_list,
|
9400 - | expected.recursive_list,
|
9401 - | "Unexpected value for `recursive_list`"
|
9402 - | );
|
9403 - | ::pretty_assertions::assert_eq!(
|
9404 - | input.recursive_map,
|
9405 - | expected.recursive_map,
|
9406 - | "Unexpected value for `recursive_map`"
|
9407 - | );
|
9408 - | ::pretty_assertions::assert_eq!(
|
9409 - | input.recursive_struct,
|
9410 - | expected.recursive_struct,
|
9411 - | "Unexpected value for `recursive_struct`"
|
9412 - | );
|
9413 - | ::pretty_assertions::assert_eq!(
|
9414 - | input.simple_struct,
|
9415 - | expected.simple_struct,
|
9416 - | "Unexpected value for `simple_struct`"
|
9417 - | );
|
9418 - | ::pretty_assertions::assert_eq!(
|
9419 - | input.string,
|
9420 - | expected.string,
|
9421 - | "Unexpected value for `string`"
|
9422 - | );
|
9423 - | ::pretty_assertions::assert_eq!(
|
9424 - | input.struct_with_json_name,
|
9425 - | expected.struct_with_json_name,
|
9426 - | "Unexpected value for `struct_with_json_name`"
|
9427 - | );
|
9428 - | ::pretty_assertions::assert_eq!(
|
9429 - | input.timestamp,
|
9430 - | expected.timestamp,
|
9431 - | "Unexpected value for `timestamp`"
|
9432 - | );
|
9433 - | ::pretty_assertions::assert_eq!(
|
9434 - | input.unix_timestamp,
|
9435 - | expected.unix_timestamp,
|
9436 - | "Unexpected value for `unix_timestamp`"
|
9437 - | );
|
9438 - | let output = crate::output::KitchenSinkOperationOutput {
|
9439 - | blob: ::std::option::Option::None,
|
9440 - | boolean: ::std::option::Option::None,
|
9441 - | double: ::std::option::Option::None,
|
9442 - | empty_struct: ::std::option::Option::None,
|
9443 - | float: ::std::option::Option::None,
|
9444 - | httpdate_timestamp: ::std::option::Option::None,
|
9445 - | integer: ::std::option::Option::None,
|
9446 - | iso8601_timestamp: ::std::option::Option::None,
|
9447 - | json_value: ::std::option::Option::None,
|
9448 - | list_of_lists: ::std::option::Option::None,
|
9449 - | list_of_maps_of_strings: ::std::option::Option::None,
|
9450 - | list_of_strings: ::std::option::Option::None,
|
9451 - | list_of_structs: ::std::option::Option::None,
|
9452 - | long: ::std::option::Option::None,
|
9453 - | map_of_lists_of_strings: ::std::option::Option::None,
|
9454 - | map_of_maps: ::std::option::Option::None,
|
9455 - | map_of_strings: ::std::option::Option::None,
|
9456 - | map_of_structs: ::std::option::Option::None,
|
9457 - | recursive_list: ::std::option::Option::None,
|
9458 - | recursive_map: ::std::option::Option::None,
|
9459 - | recursive_struct: ::std::option::Option::None,
|
9460 - | simple_struct: ::std::option::Option::None,
|
9461 - | string: ::std::option::Option::None,
|
9462 - | struct_with_json_name: ::std::option::Option::None,
|
9463 - | timestamp: ::std::option::Option::None,
|
9464 - | unix_timestamp: ::std::option::Option::None,
|
9465 - | };
|
9466 - | Ok(output)
|
9614 + | let service = crate::service::JsonProtocol::builder::<
|
9615 + | ::aws_smithy_http_server::body::BoxBody,
|
9616 + | _,
|
9617 + | _,
|
9618 + | _,
|
9619 + | >(config)
|
9620 + | .kitchen_sink_operation(move |input: crate::input::KitchenSinkOperationInput| {
|
9621 + | let sender = sender.clone();
|
9622 + | async move {
|
9623 + | let result = {
|
9624 + | use ::aws_smithy_protocol_test::FloatEquals;
|
9625 + | let expected = crate::input::KitchenSinkOperationInput {
|
9626 + | simple_struct: ::std::option::Option::Some(crate::model::SimpleStruct {
|
9627 + | value: ::std::option::Option::Some("abc".to_owned()),
|
9628 + | }),
|
9629 + | blob: ::std::option::Option::None,
|
9630 + | boolean: ::std::option::Option::None,
|
9631 + | double: ::std::option::Option::None,
|
9632 + | empty_struct: ::std::option::Option::None,
|
9633 + | float: ::std::option::Option::None,
|
9634 + | httpdate_timestamp: ::std::option::Option::None,
|
9635 + | integer: ::std::option::Option::None,
|
9636 + | iso8601_timestamp: ::std::option::Option::None,
|
9637 + | json_value: ::std::option::Option::None,
|
9638 + | list_of_lists: ::std::option::Option::None,
|
9639 + | list_of_maps_of_strings: ::std::option::Option::None,
|
9640 + | list_of_strings: ::std::option::Option::None,
|
9641 + | list_of_structs: ::std::option::Option::None,
|
9642 + | long: ::std::option::Option::None,
|
9643 + | map_of_lists_of_strings: ::std::option::Option::None,
|
9644 + | map_of_maps: ::std::option::Option::None,
|
9645 + | map_of_strings: ::std::option::Option::None,
|
9646 + | map_of_structs: ::std::option::Option::None,
|
9647 + | recursive_list: ::std::option::Option::None,
|
9648 + | recursive_map: ::std::option::Option::None,
|
9649 + | recursive_struct: ::std::option::Option::None,
|
9650 + | string: ::std::option::Option::None,
|
9651 + | struct_with_json_name: ::std::option::Option::None,
|
9652 + | timestamp: ::std::option::Option::None,
|
9653 + | unix_timestamp: ::std::option::Option::None,
|
9467 9654 | };
|
9468 - | sender.send(()).await.expect("receiver dropped early");
|
9469 - | result
|
9470 - | }
|
9471 - | })
|
9472 - | .build_unchecked();
|
9655 + | ::pretty_assertions::assert_eq!(
|
9656 + | input.blob,
|
9657 + | expected.blob,
|
9658 + | "Unexpected value for `blob`"
|
9659 + | );
|
9660 + | ::pretty_assertions::assert_eq!(
|
9661 + | input.boolean,
|
9662 + | expected.boolean,
|
9663 + | "Unexpected value for `boolean`"
|
9664 + | );
|
9665 + | assert!(
|
9666 + | input.double.float_equals(&expected.double),
|
9667 + | "Unexpected value for `double` {:?} vs. {:?}",
|
9668 + | expected.double,
|
9669 + | input.double
|
9670 + | );
|
9671 + | ::pretty_assertions::assert_eq!(
|
9672 + | input.empty_struct,
|
9673 + | expected.empty_struct,
|
9674 + | "Unexpected value for `empty_struct`"
|
9675 + | );
|
9676 + | assert!(
|
9677 + | input.float.float_equals(&expected.float),
|
9678 + | "Unexpected value for `float` {:?} vs. {:?}",
|
9679 + | expected.float,
|
9680 + | input.float
|
9681 + | );
|
9682 + | ::pretty_assertions::assert_eq!(
|
9683 + | input.httpdate_timestamp,
|
9684 + | expected.httpdate_timestamp,
|
9685 + | "Unexpected value for `httpdate_timestamp`"
|
9686 + | );
|
9687 + | ::pretty_assertions::assert_eq!(
|
9688 + | input.integer,
|
9689 + | expected.integer,
|
9690 + | "Unexpected value for `integer`"
|
9691 + | );
|
9692 + | ::pretty_assertions::assert_eq!(
|
9693 + | input.iso8601_timestamp,
|
9694 + | expected.iso8601_timestamp,
|
9695 + | "Unexpected value for `iso8601_timestamp`"
|
9696 + | );
|
9697 + | ::pretty_assertions::assert_eq!(
|
9698 + | input.json_value,
|
9699 + | expected.json_value,
|
9700 + | "Unexpected value for `json_value`"
|
9701 + | );
|
9702 + | ::pretty_assertions::assert_eq!(
|
9703 + | input.list_of_lists,
|
9704 + | expected.list_of_lists,
|
9705 + | "Unexpected value for `list_of_lists`"
|
9706 + | );
|
9707 + | ::pretty_assertions::assert_eq!(
|
9708 + | input.list_of_maps_of_strings,
|
9709 + | expected.list_of_maps_of_strings,
|
9710 + | "Unexpected value for `list_of_maps_of_strings`"
|
9711 + | );
|
9712 + | ::pretty_assertions::assert_eq!(
|
9713 + | input.list_of_strings,
|
9714 + | expected.list_of_strings,
|
9715 + | "Unexpected value for `list_of_strings`"
|
9716 + | );
|
9717 + | ::pretty_assertions::assert_eq!(
|
9718 + | input.list_of_structs,
|
9719 + | expected.list_of_structs,
|
9720 + | "Unexpected value for `list_of_structs`"
|
9721 + | );
|
9722 + | ::pretty_assertions::assert_eq!(
|
9723 + | input.long,
|
9724 + | expected.long,
|
9725 + | "Unexpected value for `long`"
|
9726 + | );
|
9727 + | ::pretty_assertions::assert_eq!(
|
9728 + | input.map_of_lists_of_strings,
|
9729 + | expected.map_of_lists_of_strings,
|
9730 + | "Unexpected value for `map_of_lists_of_strings`"
|
9731 + | );
|
9732 + | ::pretty_assertions::assert_eq!(
|
9733 + | input.map_of_maps,
|
9734 + | expected.map_of_maps,
|
9735 + | "Unexpected value for `map_of_maps`"
|
9736 + | );
|
9737 + | ::pretty_assertions::assert_eq!(
|
9738 + | input.map_of_strings,
|
9739 + | expected.map_of_strings,
|
9740 + | "Unexpected value for `map_of_strings`"
|
9741 + | );
|
9742 + | ::pretty_assertions::assert_eq!(
|
9743 + | input.map_of_structs,
|
9744 + | expected.map_of_structs,
|
9745 + | "Unexpected value for `map_of_structs`"
|
9746 + | );
|
9747 + | ::pretty_assertions::assert_eq!(
|
9748 + | input.recursive_list,
|
9749 + | expected.recursive_list,
|
9750 + | "Unexpected value for `recursive_list`"
|
9751 + | );
|
9752 + | ::pretty_assertions::assert_eq!(
|
9753 + | input.recursive_map,
|
9754 + | expected.recursive_map,
|
9755 + | "Unexpected value for `recursive_map`"
|
9756 + | );
|
9757 + | ::pretty_assertions::assert_eq!(
|
9758 + | input.recursive_struct,
|
9759 + | expected.recursive_struct,
|
9760 + | "Unexpected value for `recursive_struct`"
|
9761 + | );
|
9762 + | ::pretty_assertions::assert_eq!(
|
9763 + | input.simple_struct,
|
9764 + | expected.simple_struct,
|
9765 + | "Unexpected value for `simple_struct`"
|
9766 + | );
|
9767 + | ::pretty_assertions::assert_eq!(
|
9768 + | input.string,
|
9769 + | expected.string,
|
9770 + | "Unexpected value for `string`"
|
9771 + | );
|
9772 + | ::pretty_assertions::assert_eq!(
|
9773 + | input.struct_with_json_name,
|
9774 + | expected.struct_with_json_name,
|
9775 + | "Unexpected value for `struct_with_json_name`"
|
9776 + | );
|
9777 + | ::pretty_assertions::assert_eq!(
|
9778 + | input.timestamp,
|
9779 + | expected.timestamp,
|
9780 + | "Unexpected value for `timestamp`"
|
9781 + | );
|
9782 + | ::pretty_assertions::assert_eq!(
|
9783 + | input.unix_timestamp,
|
9784 + | expected.unix_timestamp,
|
9785 + | "Unexpected value for `unix_timestamp`"
|
9786 + | );
|
9787 + | let output = crate::output::KitchenSinkOperationOutput {
|
9788 + | blob: ::std::option::Option::None,
|
9789 + | boolean: ::std::option::Option::None,
|
9790 + | double: ::std::option::Option::None,
|
9791 + | empty_struct: ::std::option::Option::None,
|
9792 + | float: ::std::option::Option::None,
|
9793 + | httpdate_timestamp: ::std::option::Option::None,
|
9794 + | integer: ::std::option::Option::None,
|
9795 + | iso8601_timestamp: ::std::option::Option::None,
|
9796 + | json_value: ::std::option::Option::None,
|
9797 + | list_of_lists: ::std::option::Option::None,
|
9798 + | list_of_maps_of_strings: ::std::option::Option::None,
|
9799 + | list_of_strings: ::std::option::Option::None,
|
9800 + | list_of_structs: ::std::option::Option::None,
|
9801 + | long: ::std::option::Option::None,
|
9802 + | map_of_lists_of_strings: ::std::option::Option::None,
|
9803 + | map_of_maps: ::std::option::Option::None,
|
9804 + | map_of_strings: ::std::option::Option::None,
|
9805 + | map_of_structs: ::std::option::Option::None,
|
9806 + | recursive_list: ::std::option::Option::None,
|
9807 + | recursive_map: ::std::option::Option::None,
|
9808 + | recursive_struct: ::std::option::Option::None,
|
9809 + | simple_struct: ::std::option::Option::None,
|
9810 + | string: ::std::option::Option::None,
|
9811 + | struct_with_json_name: ::std::option::Option::None,
|
9812 + | timestamp: ::std::option::Option::None,
|
9813 + | unix_timestamp: ::std::option::Option::None,
|
9814 + | };
|
9815 + | Ok(output)
|
9816 + | };
|
9817 + | sender.send(()).await.expect("receiver dropped early");
|
9818 + | result
|
9819 + | }
|
9820 + | })
|
9821 + | .build_unchecked();
|
9473 9822 | let http_response = ::tower::ServiceExt::oneshot(service, http_request)
|
9474 9823 | .await
|
9475 9824 | .expect("unable to make an HTTP request");
|
9476 9825 | assert!(
|
9477 9826 | receiver.recv().await.is_some(),
|
9478 9827 | "we expected operation handler to be invoked but it was not entered"
|
9479 9828 | );
|
9480 9829 | }
|
9481 9830 |
|
9482 9831 | /// Serializes structure members with locationName traits
|
9483 9832 | /// Test ID: serializes_structure_members_with_locationname_traits
|
9484 9833 | #[::tokio::test]
|
9485 9834 | #[::tracing_test::traced_test]
|
9486 9835 | async fn serializes_structure_members_with_locationname_traits_request() {
|
9487 9836 | #[allow(unused_mut)]
|
9488 - | let mut http_request = http::Request::builder()
|
9837 + | let mut http_request = ::http_1x::Request::builder()
|
9489 9838 | .uri("/")
|
9490 9839 | .method("POST")
|
9491 9840 | .header("Content-Type", "application/x-amz-json-1.1")
|
9492 9841 | .header("X-Amz-Target", "JsonProtocol.KitchenSinkOperation")
|
9493 - | .body(::aws_smithy_http_server::body::Body::from(
|
9494 - | ::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
|
9495 - | "{\"StructWithJsonName\":{\"Value\":\"some-value\"}}".as_bytes(),
|
9496 - | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
9842 + | .body(::aws_smithy_http_server::body::boxed(
|
9843 + | ::http_body_util::Full::new(::bytes::Bytes::copy_from_slice(
|
9844 + | &::aws_smithy_protocol_test::decode_body_data(
|
9845 + | "{\"StructWithJsonName\":{\"Value\":\"some-value\"}}".as_bytes(),
|
9846 + | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
9847 + | ),
|
9497 9848 | )),
|
9498 9849 | ))
|
9499 9850 | .unwrap();
|
9500 9851 | #[allow(unused_mut)]
|
9501 9852 | let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
|
9502 9853 | let config = crate::service::JsonProtocolConfig::builder().build();
|
9503 - | let service = crate::service::JsonProtocol::builder::<::hyper::body::Body, _, _, _>(config)
|
9504 - | .kitchen_sink_operation(move |input: crate::input::KitchenSinkOperationInput| {
|
9505 - | let sender = sender.clone();
|
9506 - | async move {
|
9507 - | let result = {
|
9508 - | use ::aws_smithy_protocol_test::FloatEquals;
|
9509 - | let expected = crate::input::KitchenSinkOperationInput {
|
9510 - | struct_with_json_name: ::std::option::Option::Some(
|
9511 - | crate::model::StructWithJsonName {
|
9512 - | value: ::std::option::Option::Some("some-value".to_owned()),
|
9513 - | },
|
9514 - | ),
|
9515 - | blob: ::std::option::Option::None,
|
9516 - | boolean: ::std::option::Option::None,
|
9517 - | double: ::std::option::Option::None,
|
9518 - | empty_struct: ::std::option::Option::None,
|
9519 - | float: ::std::option::Option::None,
|
9520 - | httpdate_timestamp: ::std::option::Option::None,
|
9521 - | integer: ::std::option::Option::None,
|
9522 - | iso8601_timestamp: ::std::option::Option::None,
|
9523 - | json_value: ::std::option::Option::None,
|
9524 - | list_of_lists: ::std::option::Option::None,
|
9525 - | list_of_maps_of_strings: ::std::option::Option::None,
|
9526 - | list_of_strings: ::std::option::Option::None,
|
9527 - | list_of_structs: ::std::option::Option::None,
|
9528 - | long: ::std::option::Option::None,
|
9529 - | map_of_lists_of_strings: ::std::option::Option::None,
|
9530 - | map_of_maps: ::std::option::Option::None,
|
9531 - | map_of_strings: ::std::option::Option::None,
|
9532 - | map_of_structs: ::std::option::Option::None,
|
9533 - | recursive_list: ::std::option::Option::None,
|
9534 - | recursive_map: ::std::option::Option::None,
|
9535 - | recursive_struct: ::std::option::Option::None,
|
9536 - | simple_struct: ::std::option::Option::None,
|
9537 - | string: ::std::option::Option::None,
|
9538 - | timestamp: ::std::option::Option::None,
|
9539 - | unix_timestamp: ::std::option::Option::None,
|
9540 - | };
|
9541 - | ::pretty_assertions::assert_eq!(
|
9542 - | input.blob,
|
9543 - | expected.blob,
|
9544 - | "Unexpected value for `blob`"
|
9545 - | );
|
9546 - | ::pretty_assertions::assert_eq!(
|
9547 - | input.boolean,
|
9548 - | expected.boolean,
|
9549 - | "Unexpected value for `boolean`"
|
9550 - | );
|
9551 - | assert!(
|
9552 - | input.double.float_equals(&expected.double),
|
9553 - | "Unexpected value for `double` {:?} vs. {:?}",
|
9554 - | expected.double,
|
9555 - | input.double
|
9556 - | );
|
9557 - | ::pretty_assertions::assert_eq!(
|
9558 - | input.empty_struct,
|
9559 - | expected.empty_struct,
|
9560 - | "Unexpected value for `empty_struct`"
|
9561 - | );
|
9562 - | assert!(
|
9563 - | input.float.float_equals(&expected.float),
|
9564 - | "Unexpected value for `float` {:?} vs. {:?}",
|
9565 - | expected.float,
|
9566 - | input.float
|
9567 - | );
|
9568 - | ::pretty_assertions::assert_eq!(
|
9569 - | input.httpdate_timestamp,
|
9570 - | expected.httpdate_timestamp,
|
9571 - | "Unexpected value for `httpdate_timestamp`"
|
9572 - | );
|
9573 - | ::pretty_assertions::assert_eq!(
|
9574 - | input.integer,
|
9575 - | expected.integer,
|
9576 - | "Unexpected value for `integer`"
|
9577 - | );
|
9578 - | ::pretty_assertions::assert_eq!(
|
9579 - | input.iso8601_timestamp,
|
9580 - | expected.iso8601_timestamp,
|
9581 - | "Unexpected value for `iso8601_timestamp`"
|
9582 - | );
|
9583 - | ::pretty_assertions::assert_eq!(
|
9584 - | input.json_value,
|
9585 - | expected.json_value,
|
9586 - | "Unexpected value for `json_value`"
|
9587 - | );
|
9588 - | ::pretty_assertions::assert_eq!(
|
9589 - | input.list_of_lists,
|
9590 - | expected.list_of_lists,
|
9591 - | "Unexpected value for `list_of_lists`"
|
9592 - | );
|
9593 - | ::pretty_assertions::assert_eq!(
|
9594 - | input.list_of_maps_of_strings,
|
9595 - | expected.list_of_maps_of_strings,
|
9596 - | "Unexpected value for `list_of_maps_of_strings`"
|
9597 - | );
|
9598 - | ::pretty_assertions::assert_eq!(
|
9599 - | input.list_of_strings,
|
9600 - | expected.list_of_strings,
|
9601 - | "Unexpected value for `list_of_strings`"
|
9602 - | );
|
9603 - | ::pretty_assertions::assert_eq!(
|
9604 - | input.list_of_structs,
|
9605 - | expected.list_of_structs,
|
9606 - | "Unexpected value for `list_of_structs`"
|
9607 - | );
|
9608 - | ::pretty_assertions::assert_eq!(
|
9609 - | input.long,
|
9610 - | expected.long,
|
9611 - | "Unexpected value for `long`"
|
9612 - | );
|
9613 - | ::pretty_assertions::assert_eq!(
|
9614 - | input.map_of_lists_of_strings,
|
9615 - | expected.map_of_lists_of_strings,
|
9616 - | "Unexpected value for `map_of_lists_of_strings`"
|
9617 - | );
|
9618 - | ::pretty_assertions::assert_eq!(
|
9619 - | input.map_of_maps,
|
9620 - | expected.map_of_maps,
|
9621 - | "Unexpected value for `map_of_maps`"
|
9622 - | );
|
9623 - | ::pretty_assertions::assert_eq!(
|
9624 - | input.map_of_strings,
|
9625 - | expected.map_of_strings,
|
9626 - | "Unexpected value for `map_of_strings`"
|
9627 - | );
|
9628 - | ::pretty_assertions::assert_eq!(
|
9629 - | input.map_of_structs,
|
9630 - | expected.map_of_structs,
|
9631 - | "Unexpected value for `map_of_structs`"
|
9632 - | );
|
9633 - | ::pretty_assertions::assert_eq!(
|
9634 - | input.recursive_list,
|
9635 - | expected.recursive_list,
|
9636 - | "Unexpected value for `recursive_list`"
|
9637 - | );
|
9638 - | ::pretty_assertions::assert_eq!(
|
9639 - | input.recursive_map,
|
9640 - | expected.recursive_map,
|
9641 - | "Unexpected value for `recursive_map`"
|
9642 - | );
|
9643 - | ::pretty_assertions::assert_eq!(
|
9644 - | input.recursive_struct,
|
9645 - | expected.recursive_struct,
|
9646 - | "Unexpected value for `recursive_struct`"
|
9647 - | );
|
9648 - | ::pretty_assertions::assert_eq!(
|
9649 - | input.simple_struct,
|
9650 - | expected.simple_struct,
|
9651 - | "Unexpected value for `simple_struct`"
|
9652 - | );
|
9653 - | ::pretty_assertions::assert_eq!(
|
9654 - | input.string,
|
9655 - | expected.string,
|
9656 - | "Unexpected value for `string`"
|
9657 - | );
|
9658 - | ::pretty_assertions::assert_eq!(
|
9659 - | input.struct_with_json_name,
|
9660 - | expected.struct_with_json_name,
|
9661 - | "Unexpected value for `struct_with_json_name`"
|
9662 - | );
|
9663 - | ::pretty_assertions::assert_eq!(
|
9664 - | input.timestamp,
|
9665 - | expected.timestamp,
|
9666 - | "Unexpected value for `timestamp`"
|
9667 - | );
|
9668 - | ::pretty_assertions::assert_eq!(
|
9669 - | input.unix_timestamp,
|
9670 - | expected.unix_timestamp,
|
9671 - | "Unexpected value for `unix_timestamp`"
|
9672 - | );
|
9673 - | let output = crate::output::KitchenSinkOperationOutput {
|
9674 - | blob: ::std::option::Option::None,
|
9675 - | boolean: ::std::option::Option::None,
|
9676 - | double: ::std::option::Option::None,
|
9677 - | empty_struct: ::std::option::Option::None,
|
9678 - | float: ::std::option::Option::None,
|
9679 - | httpdate_timestamp: ::std::option::Option::None,
|
9680 - | integer: ::std::option::Option::None,
|
9681 - | iso8601_timestamp: ::std::option::Option::None,
|
9682 - | json_value: ::std::option::Option::None,
|
9683 - | list_of_lists: ::std::option::Option::None,
|
9684 - | list_of_maps_of_strings: ::std::option::Option::None,
|
9685 - | list_of_strings: ::std::option::Option::None,
|
9686 - | list_of_structs: ::std::option::Option::None,
|
9687 - | long: ::std::option::Option::None,
|
9688 - | map_of_lists_of_strings: ::std::option::Option::None,
|
9689 - | map_of_maps: ::std::option::Option::None,
|
9690 - | map_of_strings: ::std::option::Option::None,
|
9691 - | map_of_structs: ::std::option::Option::None,
|
9692 - | recursive_list: ::std::option::Option::None,
|
9693 - | recursive_map: ::std::option::Option::None,
|
9694 - | recursive_struct: ::std::option::Option::None,
|
9695 - | simple_struct: ::std::option::Option::None,
|
9696 - | string: ::std::option::Option::None,
|
9697 - | struct_with_json_name: ::std::option::Option::None,
|
9698 - | timestamp: ::std::option::Option::None,
|
9699 - | unix_timestamp: ::std::option::Option::None,
|
9700 - | };
|
9701 - | Ok(output)
|
9854 + | let service = crate::service::JsonProtocol::builder::<
|
9855 + | ::aws_smithy_http_server::body::BoxBody,
|
9856 + | _,
|
9857 + | _,
|
9858 + | _,
|
9859 + | >(config)
|
9860 + | .kitchen_sink_operation(move |input: crate::input::KitchenSinkOperationInput| {
|
9861 + | let sender = sender.clone();
|
9862 + | async move {
|
9863 + | let result = {
|
9864 + | use ::aws_smithy_protocol_test::FloatEquals;
|
9865 + | let expected = crate::input::KitchenSinkOperationInput {
|
9866 + | struct_with_json_name: ::std::option::Option::Some(
|
9867 + | crate::model::StructWithJsonName {
|
9868 + | value: ::std::option::Option::Some("some-value".to_owned()),
|
9869 + | },
|
9870 + | ),
|
9871 + | blob: ::std::option::Option::None,
|
9872 + | boolean: ::std::option::Option::None,
|
9873 + | double: ::std::option::Option::None,
|
9874 + | empty_struct: ::std::option::Option::None,
|
9875 + | float: ::std::option::Option::None,
|
9876 + | httpdate_timestamp: ::std::option::Option::None,
|
9877 + | integer: ::std::option::Option::None,
|
9878 + | iso8601_timestamp: ::std::option::Option::None,
|
9879 + | json_value: ::std::option::Option::None,
|
9880 + | list_of_lists: ::std::option::Option::None,
|
9881 + | list_of_maps_of_strings: ::std::option::Option::None,
|
9882 + | list_of_strings: ::std::option::Option::None,
|
9883 + | list_of_structs: ::std::option::Option::None,
|
9884 + | long: ::std::option::Option::None,
|
9885 + | map_of_lists_of_strings: ::std::option::Option::None,
|
9886 + | map_of_maps: ::std::option::Option::None,
|
9887 + | map_of_strings: ::std::option::Option::None,
|
9888 + | map_of_structs: ::std::option::Option::None,
|
9889 + | recursive_list: ::std::option::Option::None,
|
9890 + | recursive_map: ::std::option::Option::None,
|
9891 + | recursive_struct: ::std::option::Option::None,
|
9892 + | simple_struct: ::std::option::Option::None,
|
9893 + | string: ::std::option::Option::None,
|
9894 + | timestamp: ::std::option::Option::None,
|
9895 + | unix_timestamp: ::std::option::Option::None,
|
9702 9896 | };
|
9703 - | sender.send(()).await.expect("receiver dropped early");
|
9704 - | result
|
9705 - | }
|
9706 - | })
|
9707 - | .build_unchecked();
|
9897 + | ::pretty_assertions::assert_eq!(
|
9898 + | input.blob,
|
9899 + | expected.blob,
|
9900 + | "Unexpected value for `blob`"
|
9901 + | );
|
9902 + | ::pretty_assertions::assert_eq!(
|
9903 + | input.boolean,
|
9904 + | expected.boolean,
|
9905 + | "Unexpected value for `boolean`"
|
9906 + | );
|
9907 + | assert!(
|
9908 + | input.double.float_equals(&expected.double),
|
9909 + | "Unexpected value for `double` {:?} vs. {:?}",
|
9910 + | expected.double,
|
9911 + | input.double
|
9912 + | );
|
9913 + | ::pretty_assertions::assert_eq!(
|
9914 + | input.empty_struct,
|
9915 + | expected.empty_struct,
|
9916 + | "Unexpected value for `empty_struct`"
|
9917 + | );
|
9918 + | assert!(
|
9919 + | input.float.float_equals(&expected.float),
|
9920 + | "Unexpected value for `float` {:?} vs. {:?}",
|
9921 + | expected.float,
|
9922 + | input.float
|
9923 + | );
|
9924 + | ::pretty_assertions::assert_eq!(
|
9925 + | input.httpdate_timestamp,
|
9926 + | expected.httpdate_timestamp,
|
9927 + | "Unexpected value for `httpdate_timestamp`"
|
9928 + | );
|
9929 + | ::pretty_assertions::assert_eq!(
|
9930 + | input.integer,
|
9931 + | expected.integer,
|
9932 + | "Unexpected value for `integer`"
|
9933 + | );
|
9934 + | ::pretty_assertions::assert_eq!(
|
9935 + | input.iso8601_timestamp,
|
9936 + | expected.iso8601_timestamp,
|
9937 + | "Unexpected value for `iso8601_timestamp`"
|
9938 + | );
|
9939 + | ::pretty_assertions::assert_eq!(
|
9940 + | input.json_value,
|
9941 + | expected.json_value,
|
9942 + | "Unexpected value for `json_value`"
|
9943 + | );
|
9944 + | ::pretty_assertions::assert_eq!(
|
9945 + | input.list_of_lists,
|
9946 + | expected.list_of_lists,
|
9947 + | "Unexpected value for `list_of_lists`"
|
9948 + | );
|
9949 + | ::pretty_assertions::assert_eq!(
|
9950 + | input.list_of_maps_of_strings,
|
9951 + | expected.list_of_maps_of_strings,
|
9952 + | "Unexpected value for `list_of_maps_of_strings`"
|
9953 + | );
|
9954 + | ::pretty_assertions::assert_eq!(
|
9955 + | input.list_of_strings,
|
9956 + | expected.list_of_strings,
|
9957 + | "Unexpected value for `list_of_strings`"
|
9958 + | );
|
9959 + | ::pretty_assertions::assert_eq!(
|
9960 + | input.list_of_structs,
|
9961 + | expected.list_of_structs,
|
9962 + | "Unexpected value for `list_of_structs`"
|
9963 + | );
|
9964 + | ::pretty_assertions::assert_eq!(
|
9965 + | input.long,
|
9966 + | expected.long,
|
9967 + | "Unexpected value for `long`"
|
9968 + | );
|
9969 + | ::pretty_assertions::assert_eq!(
|
9970 + | input.map_of_lists_of_strings,
|
9971 + | expected.map_of_lists_of_strings,
|
9972 + | "Unexpected value for `map_of_lists_of_strings`"
|
9973 + | );
|
9974 + | ::pretty_assertions::assert_eq!(
|
9975 + | input.map_of_maps,
|
9976 + | expected.map_of_maps,
|
9977 + | "Unexpected value for `map_of_maps`"
|
9978 + | );
|
9979 + | ::pretty_assertions::assert_eq!(
|
9980 + | input.map_of_strings,
|
9981 + | expected.map_of_strings,
|
9982 + | "Unexpected value for `map_of_strings`"
|
9983 + | );
|
9984 + | ::pretty_assertions::assert_eq!(
|
9985 + | input.map_of_structs,
|
9986 + | expected.map_of_structs,
|
9987 + | "Unexpected value for `map_of_structs`"
|
9988 + | );
|
9989 + | ::pretty_assertions::assert_eq!(
|
9990 + | input.recursive_list,
|
9991 + | expected.recursive_list,
|
9992 + | "Unexpected value for `recursive_list`"
|
9993 + | );
|
9994 + | ::pretty_assertions::assert_eq!(
|
9995 + | input.recursive_map,
|
9996 + | expected.recursive_map,
|
9997 + | "Unexpected value for `recursive_map`"
|
9998 + | );
|
9999 + | ::pretty_assertions::assert_eq!(
|
10000 + | input.recursive_struct,
|
10001 + | expected.recursive_struct,
|
10002 + | "Unexpected value for `recursive_struct`"
|
10003 + | );
|
10004 + | ::pretty_assertions::assert_eq!(
|
10005 + | input.simple_struct,
|
10006 + | expected.simple_struct,
|
10007 + | "Unexpected value for `simple_struct`"
|
10008 + | );
|
10009 + | ::pretty_assertions::assert_eq!(
|
10010 + | input.string,
|
10011 + | expected.string,
|
10012 + | "Unexpected value for `string`"
|
10013 + | );
|
10014 + | ::pretty_assertions::assert_eq!(
|
10015 + | input.struct_with_json_name,
|
10016 + | expected.struct_with_json_name,
|
10017 + | "Unexpected value for `struct_with_json_name`"
|
10018 + | );
|
10019 + | ::pretty_assertions::assert_eq!(
|
10020 + | input.timestamp,
|
10021 + | expected.timestamp,
|
10022 + | "Unexpected value for `timestamp`"
|
10023 + | );
|
10024 + | ::pretty_assertions::assert_eq!(
|
10025 + | input.unix_timestamp,
|
10026 + | expected.unix_timestamp,
|
10027 + | "Unexpected value for `unix_timestamp`"
|
10028 + | );
|
10029 + | let output = crate::output::KitchenSinkOperationOutput {
|
10030 + | blob: ::std::option::Option::None,
|
10031 + | boolean: ::std::option::Option::None,
|
10032 + | double: ::std::option::Option::None,
|
10033 + | empty_struct: ::std::option::Option::None,
|
10034 + | float: ::std::option::Option::None,
|
10035 + | httpdate_timestamp: ::std::option::Option::None,
|
10036 + | integer: ::std::option::Option::None,
|
10037 + | iso8601_timestamp: ::std::option::Option::None,
|
10038 + | json_value: ::std::option::Option::None,
|
10039 + | list_of_lists: ::std::option::Option::None,
|
10040 + | list_of_maps_of_strings: ::std::option::Option::None,
|
10041 + | list_of_strings: ::std::option::Option::None,
|
10042 + | list_of_structs: ::std::option::Option::None,
|
10043 + | long: ::std::option::Option::None,
|
10044 + | map_of_lists_of_strings: ::std::option::Option::None,
|
10045 + | map_of_maps: ::std::option::Option::None,
|
10046 + | map_of_strings: ::std::option::Option::None,
|
10047 + | map_of_structs: ::std::option::Option::None,
|
10048 + | recursive_list: ::std::option::Option::None,
|
10049 + | recursive_map: ::std::option::Option::None,
|
10050 + | recursive_struct: ::std::option::Option::None,
|
10051 + | simple_struct: ::std::option::Option::None,
|
10052 + | string: ::std::option::Option::None,
|
10053 + | struct_with_json_name: ::std::option::Option::None,
|
10054 + | timestamp: ::std::option::Option::None,
|
10055 + | unix_timestamp: ::std::option::Option::None,
|
10056 + | };
|
10057 + | Ok(output)
|
10058 + | };
|
10059 + | sender.send(()).await.expect("receiver dropped early");
|
10060 + | result
|
10061 + | }
|
10062 + | })
|
10063 + | .build_unchecked();
|
9708 10064 | let http_response = ::tower::ServiceExt::oneshot(service, http_request)
|
9709 10065 | .await
|
9710 10066 | .expect("unable to make an HTTP request");
|
9711 10067 | assert!(
|
9712 10068 | receiver.recv().await.is_some(),
|
9713 10069 | "we expected operation handler to be invoked but it was not entered"
|
9714 10070 | );
|
9715 10071 | }
|
9716 10072 |
|
9717 10073 | /// Serializes empty structure shapes
|
9718 10074 | /// Test ID: serializes_empty_structure_shapes
|
9719 10075 | #[::tokio::test]
|
9720 10076 | #[::tracing_test::traced_test]
|
9721 10077 | async fn serializes_empty_structure_shapes_request() {
|
9722 10078 | #[allow(unused_mut)]
|
9723 - | let mut http_request = http::Request::builder()
|
10079 + | let mut http_request = ::http_1x::Request::builder()
|
9724 10080 | .uri("/")
|
9725 10081 | .method("POST")
|
9726 10082 | .header("Content-Type", "application/x-amz-json-1.1")
|
9727 10083 | .header("X-Amz-Target", "JsonProtocol.KitchenSinkOperation")
|
9728 - | .body(::aws_smithy_http_server::body::Body::from(
|
9729 - | ::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
|
9730 - | "{\"SimpleStruct\":{}}".as_bytes(),
|
9731 - | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
10084 + | .body(::aws_smithy_http_server::body::boxed(
|
10085 + | ::http_body_util::Full::new(::bytes::Bytes::copy_from_slice(
|
10086 + | &::aws_smithy_protocol_test::decode_body_data(
|
10087 + | "{\"SimpleStruct\":{}}".as_bytes(),
|
10088 + | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
10089 + | ),
|
9732 10090 | )),
|
9733 10091 | ))
|
9734 10092 | .unwrap();
|
9735 10093 | #[allow(unused_mut)]
|
9736 10094 | let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
|
9737 10095 | let config = crate::service::JsonProtocolConfig::builder().build();
|
9738 - | let service = crate::service::JsonProtocol::builder::<::hyper::body::Body, _, _, _>(config)
|
9739 - | .kitchen_sink_operation(move |input: crate::input::KitchenSinkOperationInput| {
|
9740 - | let sender = sender.clone();
|
9741 - | async move {
|
9742 - | let result = {
|
9743 - | use ::aws_smithy_protocol_test::FloatEquals;
|
9744 - | let expected = crate::input::KitchenSinkOperationInput {
|
9745 - | simple_struct: ::std::option::Option::Some(
|
9746 - | crate::model::SimpleStruct {
|
9747 - | value: ::std::option::Option::None,
|
9748 - | },
|
9749 - | ),
|
9750 - | blob: ::std::option::Option::None,
|
9751 - | boolean: ::std::option::Option::None,
|
9752 - | double: ::std::option::Option::None,
|
9753 - | empty_struct: ::std::option::Option::None,
|
9754 - | float: ::std::option::Option::None,
|
9755 - | httpdate_timestamp: ::std::option::Option::None,
|
9756 - | integer: ::std::option::Option::None,
|
9757 - | iso8601_timestamp: ::std::option::Option::None,
|
9758 - | json_value: ::std::option::Option::None,
|
9759 - | list_of_lists: ::std::option::Option::None,
|
9760 - | list_of_maps_of_strings: ::std::option::Option::None,
|
9761 - | list_of_strings: ::std::option::Option::None,
|
9762 - | list_of_structs: ::std::option::Option::None,
|
9763 - | long: ::std::option::Option::None,
|
9764 - | map_of_lists_of_strings: ::std::option::Option::None,
|
9765 - | map_of_maps: ::std::option::Option::None,
|
9766 - | map_of_strings: ::std::option::Option::None,
|
9767 - | map_of_structs: ::std::option::Option::None,
|
9768 - | recursive_list: ::std::option::Option::None,
|
9769 - | recursive_map: ::std::option::Option::None,
|
9770 - | recursive_struct: ::std::option::Option::None,
|
9771 - | string: ::std::option::Option::None,
|
9772 - | struct_with_json_name: ::std::option::Option::None,
|
9773 - | timestamp: ::std::option::Option::None,
|
9774 - | unix_timestamp: ::std::option::Option::None,
|
9775 - | };
|
9776 - | ::pretty_assertions::assert_eq!(
|
9777 - | input.blob,
|
9778 - | expected.blob,
|
9779 - | "Unexpected value for `blob`"
|
9780 - | );
|
9781 - | ::pretty_assertions::assert_eq!(
|
9782 - | input.boolean,
|
9783 - | expected.boolean,
|
9784 - | "Unexpected value for `boolean`"
|
9785 - | );
|
9786 - | assert!(
|
9787 - | input.double.float_equals(&expected.double),
|
9788 - | "Unexpected value for `double` {:?} vs. {:?}",
|
9789 - | expected.double,
|
9790 - | input.double
|
9791 - | );
|
9792 - | ::pretty_assertions::assert_eq!(
|
9793 - | input.empty_struct,
|
9794 - | expected.empty_struct,
|
9795 - | "Unexpected value for `empty_struct`"
|
9796 - | );
|
9797 - | assert!(
|
9798 - | input.float.float_equals(&expected.float),
|
9799 - | "Unexpected value for `float` {:?} vs. {:?}",
|
9800 - | expected.float,
|
9801 - | input.float
|
9802 - | );
|
9803 - | ::pretty_assertions::assert_eq!(
|
9804 - | input.httpdate_timestamp,
|
9805 - | expected.httpdate_timestamp,
|
9806 - | "Unexpected value for `httpdate_timestamp`"
|
9807 - | );
|
9808 - | ::pretty_assertions::assert_eq!(
|
9809 - | input.integer,
|
9810 - | expected.integer,
|
9811 - | "Unexpected value for `integer`"
|
9812 - | );
|
9813 - | ::pretty_assertions::assert_eq!(
|
9814 - | input.iso8601_timestamp,
|
9815 - | expected.iso8601_timestamp,
|
9816 - | "Unexpected value for `iso8601_timestamp`"
|
9817 - | );
|
9818 - | ::pretty_assertions::assert_eq!(
|
9819 - | input.json_value,
|
9820 - | expected.json_value,
|
9821 - | "Unexpected value for `json_value`"
|
9822 - | );
|
9823 - | ::pretty_assertions::assert_eq!(
|
9824 - | input.list_of_lists,
|
9825 - | expected.list_of_lists,
|
9826 - | "Unexpected value for `list_of_lists`"
|
9827 - | );
|
9828 - | ::pretty_assertions::assert_eq!(
|
9829 - | input.list_of_maps_of_strings,
|
9830 - | expected.list_of_maps_of_strings,
|
9831 - | "Unexpected value for `list_of_maps_of_strings`"
|
9832 - | );
|
9833 - | ::pretty_assertions::assert_eq!(
|
9834 - | input.list_of_strings,
|
9835 - | expected.list_of_strings,
|
9836 - | "Unexpected value for `list_of_strings`"
|
9837 - | );
|
9838 - | ::pretty_assertions::assert_eq!(
|
9839 - | input.list_of_structs,
|
9840 - | expected.list_of_structs,
|
9841 - | "Unexpected value for `list_of_structs`"
|
9842 - | );
|
9843 - | ::pretty_assertions::assert_eq!(
|
9844 - | input.long,
|
9845 - | expected.long,
|
9846 - | "Unexpected value for `long`"
|
9847 - | );
|
9848 - | ::pretty_assertions::assert_eq!(
|
9849 - | input.map_of_lists_of_strings,
|
9850 - | expected.map_of_lists_of_strings,
|
9851 - | "Unexpected value for `map_of_lists_of_strings`"
|
9852 - | );
|
9853 - | ::pretty_assertions::assert_eq!(
|
9854 - | input.map_of_maps,
|
9855 - | expected.map_of_maps,
|
9856 - | "Unexpected value for `map_of_maps`"
|
9857 - | );
|
9858 - | ::pretty_assertions::assert_eq!(
|
9859 - | input.map_of_strings,
|
9860 - | expected.map_of_strings,
|
9861 - | "Unexpected value for `map_of_strings`"
|
9862 - | );
|
9863 - | ::pretty_assertions::assert_eq!(
|
9864 - | input.map_of_structs,
|
9865 - | expected.map_of_structs,
|
9866 - | "Unexpected value for `map_of_structs`"
|
9867 - | );
|
9868 - | ::pretty_assertions::assert_eq!(
|
9869 - | input.recursive_list,
|
9870 - | expected.recursive_list,
|
9871 - | "Unexpected value for `recursive_list`"
|
9872 - | );
|
9873 - | ::pretty_assertions::assert_eq!(
|
9874 - | input.recursive_map,
|
9875 - | expected.recursive_map,
|
9876 - | "Unexpected value for `recursive_map`"
|
9877 - | );
|
9878 - | ::pretty_assertions::assert_eq!(
|
9879 - | input.recursive_struct,
|
9880 - | expected.recursive_struct,
|
9881 - | "Unexpected value for `recursive_struct`"
|
9882 - | );
|
9883 - | ::pretty_assertions::assert_eq!(
|
9884 - | input.simple_struct,
|
9885 - | expected.simple_struct,
|
9886 - | "Unexpected value for `simple_struct`"
|
9887 - | );
|
9888 - | ::pretty_assertions::assert_eq!(
|
9889 - | input.string,
|
9890 - | expected.string,
|
9891 - | "Unexpected value for `string`"
|
9892 - | );
|
9893 - | ::pretty_assertions::assert_eq!(
|
9894 - | input.struct_with_json_name,
|
9895 - | expected.struct_with_json_name,
|
9896 - | "Unexpected value for `struct_with_json_name`"
|
9897 - | );
|
9898 - | ::pretty_assertions::assert_eq!(
|
9899 - | input.timestamp,
|
9900 - | expected.timestamp,
|
9901 - | "Unexpected value for `timestamp`"
|
9902 - | );
|
9903 - | ::pretty_assertions::assert_eq!(
|
9904 - | input.unix_timestamp,
|
9905 - | expected.unix_timestamp,
|
9906 - | "Unexpected value for `unix_timestamp`"
|
9907 - | );
|
9908 - | let output = crate::output::KitchenSinkOperationOutput {
|
9909 - | blob: ::std::option::Option::None,
|
9910 - | boolean: ::std::option::Option::None,
|
9911 - | double: ::std::option::Option::None,
|
9912 - | empty_struct: ::std::option::Option::None,
|
9913 - | float: ::std::option::Option::None,
|
9914 - | httpdate_timestamp: ::std::option::Option::None,
|
9915 - | integer: ::std::option::Option::None,
|
9916 - | iso8601_timestamp: ::std::option::Option::None,
|
9917 - | json_value: ::std::option::Option::None,
|
9918 - | list_of_lists: ::std::option::Option::None,
|
9919 - | list_of_maps_of_strings: ::std::option::Option::None,
|
9920 - | list_of_strings: ::std::option::Option::None,
|
9921 - | list_of_structs: ::std::option::Option::None,
|
9922 - | long: ::std::option::Option::None,
|
9923 - | map_of_lists_of_strings: ::std::option::Option::None,
|
9924 - | map_of_maps: ::std::option::Option::None,
|
9925 - | map_of_strings: ::std::option::Option::None,
|
9926 - | map_of_structs: ::std::option::Option::None,
|
9927 - | recursive_list: ::std::option::Option::None,
|
9928 - | recursive_map: ::std::option::Option::None,
|
9929 - | recursive_struct: ::std::option::Option::None,
|
9930 - | simple_struct: ::std::option::Option::None,
|
9931 - | string: ::std::option::Option::None,
|
9932 - | struct_with_json_name: ::std::option::Option::None,
|
9933 - | timestamp: ::std::option::Option::None,
|
9934 - | unix_timestamp: ::std::option::Option::None,
|
9935 - | };
|
9936 - | Ok(output)
|
10096 + | let service = crate::service::JsonProtocol::builder::<
|
10097 + | ::aws_smithy_http_server::body::BoxBody,
|
10098 + | _,
|
10099 + | _,
|
10100 + | _,
|
10101 + | >(config)
|
10102 + | .kitchen_sink_operation(move |input: crate::input::KitchenSinkOperationInput| {
|
10103 + | let sender = sender.clone();
|
10104 + | async move {
|
10105 + | let result = {
|
10106 + | use ::aws_smithy_protocol_test::FloatEquals;
|
10107 + | let expected = crate::input::KitchenSinkOperationInput {
|
10108 + | simple_struct: ::std::option::Option::Some(crate::model::SimpleStruct {
|
10109 + | value: ::std::option::Option::None,
|
10110 + | }),
|
10111 + | blob: ::std::option::Option::None,
|
10112 + | boolean: ::std::option::Option::None,
|
10113 + | double: ::std::option::Option::None,
|
10114 + | empty_struct: ::std::option::Option::None,
|
10115 + | float: ::std::option::Option::None,
|
10116 + | httpdate_timestamp: ::std::option::Option::None,
|
10117 + | integer: ::std::option::Option::None,
|
10118 + | iso8601_timestamp: ::std::option::Option::None,
|
10119 + | json_value: ::std::option::Option::None,
|
10120 + | list_of_lists: ::std::option::Option::None,
|
10121 + | list_of_maps_of_strings: ::std::option::Option::None,
|
10122 + | list_of_strings: ::std::option::Option::None,
|
10123 + | list_of_structs: ::std::option::Option::None,
|
10124 + | long: ::std::option::Option::None,
|
10125 + | map_of_lists_of_strings: ::std::option::Option::None,
|
10126 + | map_of_maps: ::std::option::Option::None,
|
10127 + | map_of_strings: ::std::option::Option::None,
|
10128 + | map_of_structs: ::std::option::Option::None,
|
10129 + | recursive_list: ::std::option::Option::None,
|
10130 + | recursive_map: ::std::option::Option::None,
|
10131 + | recursive_struct: ::std::option::Option::None,
|
10132 + | string: ::std::option::Option::None,
|
10133 + | struct_with_json_name: ::std::option::Option::None,
|
10134 + | timestamp: ::std::option::Option::None,
|
10135 + | unix_timestamp: ::std::option::Option::None,
|
9937 10136 | };
|
9938 - | sender.send(()).await.expect("receiver dropped early");
|
9939 - | result
|
9940 - | }
|
9941 - | })
|
9942 - | .build_unchecked();
|
10137 + | ::pretty_assertions::assert_eq!(
|
10138 + | input.blob,
|
10139 + | expected.blob,
|
10140 + | "Unexpected value for `blob`"
|
10141 + | );
|
10142 + | ::pretty_assertions::assert_eq!(
|
10143 + | input.boolean,
|
10144 + | expected.boolean,
|
10145 + | "Unexpected value for `boolean`"
|
10146 + | );
|
10147 + | assert!(
|
10148 + | input.double.float_equals(&expected.double),
|
10149 + | "Unexpected value for `double` {:?} vs. {:?}",
|
10150 + | expected.double,
|
10151 + | input.double
|
10152 + | );
|
10153 + | ::pretty_assertions::assert_eq!(
|
10154 + | input.empty_struct,
|
10155 + | expected.empty_struct,
|
10156 + | "Unexpected value for `empty_struct`"
|
10157 + | );
|
10158 + | assert!(
|
10159 + | input.float.float_equals(&expected.float),
|
10160 + | "Unexpected value for `float` {:?} vs. {:?}",
|
10161 + | expected.float,
|
10162 + | input.float
|
10163 + | );
|
10164 + | ::pretty_assertions::assert_eq!(
|
10165 + | input.httpdate_timestamp,
|
10166 + | expected.httpdate_timestamp,
|
10167 + | "Unexpected value for `httpdate_timestamp`"
|
10168 + | );
|
10169 + | ::pretty_assertions::assert_eq!(
|
10170 + | input.integer,
|
10171 + | expected.integer,
|
10172 + | "Unexpected value for `integer`"
|
10173 + | );
|
10174 + | ::pretty_assertions::assert_eq!(
|
10175 + | input.iso8601_timestamp,
|
10176 + | expected.iso8601_timestamp,
|
10177 + | "Unexpected value for `iso8601_timestamp`"
|
10178 + | );
|
10179 + | ::pretty_assertions::assert_eq!(
|
10180 + | input.json_value,
|
10181 + | expected.json_value,
|
10182 + | "Unexpected value for `json_value`"
|
10183 + | );
|
10184 + | ::pretty_assertions::assert_eq!(
|
10185 + | input.list_of_lists,
|
10186 + | expected.list_of_lists,
|
10187 + | "Unexpected value for `list_of_lists`"
|
10188 + | );
|
10189 + | ::pretty_assertions::assert_eq!(
|
10190 + | input.list_of_maps_of_strings,
|
10191 + | expected.list_of_maps_of_strings,
|
10192 + | "Unexpected value for `list_of_maps_of_strings`"
|
10193 + | );
|
10194 + | ::pretty_assertions::assert_eq!(
|
10195 + | input.list_of_strings,
|
10196 + | expected.list_of_strings,
|
10197 + | "Unexpected value for `list_of_strings`"
|
10198 + | );
|
10199 + | ::pretty_assertions::assert_eq!(
|
10200 + | input.list_of_structs,
|
10201 + | expected.list_of_structs,
|
10202 + | "Unexpected value for `list_of_structs`"
|
10203 + | );
|
10204 + | ::pretty_assertions::assert_eq!(
|
10205 + | input.long,
|
10206 + | expected.long,
|
10207 + | "Unexpected value for `long`"
|
10208 + | );
|
10209 + | ::pretty_assertions::assert_eq!(
|
10210 + | input.map_of_lists_of_strings,
|
10211 + | expected.map_of_lists_of_strings,
|
10212 + | "Unexpected value for `map_of_lists_of_strings`"
|
10213 + | );
|
10214 + | ::pretty_assertions::assert_eq!(
|
10215 + | input.map_of_maps,
|
10216 + | expected.map_of_maps,
|
10217 + | "Unexpected value for `map_of_maps`"
|
10218 + | );
|
10219 + | ::pretty_assertions::assert_eq!(
|
10220 + | input.map_of_strings,
|
10221 + | expected.map_of_strings,
|
10222 + | "Unexpected value for `map_of_strings`"
|
10223 + | );
|
10224 + | ::pretty_assertions::assert_eq!(
|
10225 + | input.map_of_structs,
|
10226 + | expected.map_of_structs,
|
10227 + | "Unexpected value for `map_of_structs`"
|
10228 + | );
|
10229 + | ::pretty_assertions::assert_eq!(
|
10230 + | input.recursive_list,
|
10231 + | expected.recursive_list,
|
10232 + | "Unexpected value for `recursive_list`"
|
10233 + | );
|
10234 + | ::pretty_assertions::assert_eq!(
|
10235 + | input.recursive_map,
|
10236 + | expected.recursive_map,
|
10237 + | "Unexpected value for `recursive_map`"
|
10238 + | );
|
10239 + | ::pretty_assertions::assert_eq!(
|
10240 + | input.recursive_struct,
|
10241 + | expected.recursive_struct,
|
10242 + | "Unexpected value for `recursive_struct`"
|
10243 + | );
|
10244 + | ::pretty_assertions::assert_eq!(
|
10245 + | input.simple_struct,
|
10246 + | expected.simple_struct,
|
10247 + | "Unexpected value for `simple_struct`"
|
10248 + | );
|
10249 + | ::pretty_assertions::assert_eq!(
|
10250 + | input.string,
|
10251 + | expected.string,
|
10252 + | "Unexpected value for `string`"
|
10253 + | );
|
10254 + | ::pretty_assertions::assert_eq!(
|
10255 + | input.struct_with_json_name,
|
10256 + | expected.struct_with_json_name,
|
10257 + | "Unexpected value for `struct_with_json_name`"
|
10258 + | );
|
10259 + | ::pretty_assertions::assert_eq!(
|
10260 + | input.timestamp,
|
10261 + | expected.timestamp,
|
10262 + | "Unexpected value for `timestamp`"
|
10263 + | );
|
10264 + | ::pretty_assertions::assert_eq!(
|
10265 + | input.unix_timestamp,
|
10266 + | expected.unix_timestamp,
|
10267 + | "Unexpected value for `unix_timestamp`"
|
10268 + | );
|
10269 + | let output = crate::output::KitchenSinkOperationOutput {
|
10270 + | blob: ::std::option::Option::None,
|
10271 + | boolean: ::std::option::Option::None,
|
10272 + | double: ::std::option::Option::None,
|
10273 + | empty_struct: ::std::option::Option::None,
|
10274 + | float: ::std::option::Option::None,
|
10275 + | httpdate_timestamp: ::std::option::Option::None,
|
10276 + | integer: ::std::option::Option::None,
|
10277 + | iso8601_timestamp: ::std::option::Option::None,
|
10278 + | json_value: ::std::option::Option::None,
|
10279 + | list_of_lists: ::std::option::Option::None,
|
10280 + | list_of_maps_of_strings: ::std::option::Option::None,
|
10281 + | list_of_strings: ::std::option::Option::None,
|
10282 + | list_of_structs: ::std::option::Option::None,
|
10283 + | long: ::std::option::Option::None,
|
10284 + | map_of_lists_of_strings: ::std::option::Option::None,
|
10285 + | map_of_maps: ::std::option::Option::None,
|
10286 + | map_of_strings: ::std::option::Option::None,
|
10287 + | map_of_structs: ::std::option::Option::None,
|
10288 + | recursive_list: ::std::option::Option::None,
|
10289 + | recursive_map: ::std::option::Option::None,
|
10290 + | recursive_struct: ::std::option::Option::None,
|
10291 + | simple_struct: ::std::option::Option::None,
|
10292 + | string: ::std::option::Option::None,
|
10293 + | struct_with_json_name: ::std::option::Option::None,
|
10294 + | timestamp: ::std::option::Option::None,
|
10295 + | unix_timestamp: ::std::option::Option::None,
|
10296 + | };
|
10297 + | Ok(output)
|
10298 + | };
|
10299 + | sender.send(()).await.expect("receiver dropped early");
|
10300 + | result
|
10301 + | }
|
10302 + | })
|
10303 + | .build_unchecked();
|
9943 10304 | let http_response = ::tower::ServiceExt::oneshot(service, http_request)
|
9944 10305 | .await
|
9945 10306 | .expect("unable to make an HTTP request");
|
9946 10307 | assert!(
|
9947 10308 | receiver.recv().await.is_some(),
|
9948 10309 | "we expected operation handler to be invoked but it was not entered"
|
9949 10310 | );
|
9950 10311 | }
|
9951 10312 |
|
9952 10313 | /// Serializes structure which have no members
|
9953 10314 | /// Test ID: serializes_structure_which_have_no_members
|
9954 10315 | #[::tokio::test]
|
9955 10316 | #[::tracing_test::traced_test]
|
9956 10317 | async fn serializes_structure_which_have_no_members_request() {
|
9957 10318 | #[allow(unused_mut)]
|
9958 - | let mut http_request = http::Request::builder()
|
10319 + | let mut http_request = ::http_1x::Request::builder()
|
9959 10320 | .uri("/")
|
9960 10321 | .method("POST")
|
9961 10322 | .header("Content-Type", "application/x-amz-json-1.1")
|
9962 10323 | .header("X-Amz-Target", "JsonProtocol.KitchenSinkOperation")
|
9963 - | .body(::aws_smithy_http_server::body::Body::from(
|
9964 - | ::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
|
9965 - | "{\"EmptyStruct\":{}}".as_bytes(),
|
9966 - | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
10324 + | .body(::aws_smithy_http_server::body::boxed(
|
10325 + | ::http_body_util::Full::new(::bytes::Bytes::copy_from_slice(
|
10326 + | &::aws_smithy_protocol_test::decode_body_data(
|
10327 + | "{\"EmptyStruct\":{}}".as_bytes(),
|
10328 + | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
10329 + | ),
|
9967 10330 | )),
|
9968 10331 | ))
|
9969 10332 | .unwrap();
|
9970 10333 | #[allow(unused_mut)]
|
9971 10334 | let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
|
9972 10335 | let config = crate::service::JsonProtocolConfig::builder().build();
|
9973 - | let service = crate::service::JsonProtocol::builder::<::hyper::body::Body, _, _, _>(config)
|
9974 - | .kitchen_sink_operation(move |input: crate::input::KitchenSinkOperationInput| {
|
9975 - | let sender = sender.clone();
|
9976 - | async move {
|
9977 - | let result = {
|
9978 - | use ::aws_smithy_protocol_test::FloatEquals;
|
9979 - | let expected = crate::input::KitchenSinkOperationInput {
|
9980 - | empty_struct: ::std::option::Option::Some(crate::model::EmptyStruct {}),
|
9981 - | blob: ::std::option::Option::None,
|
9982 - | boolean: ::std::option::Option::None,
|
9983 - | double: ::std::option::Option::None,
|
9984 - | float: ::std::option::Option::None,
|
9985 - | httpdate_timestamp: ::std::option::Option::None,
|
9986 - | integer: ::std::option::Option::None,
|
9987 - | iso8601_timestamp: ::std::option::Option::None,
|
9988 - | json_value: ::std::option::Option::None,
|
9989 - | list_of_lists: ::std::option::Option::None,
|
9990 - | list_of_maps_of_strings: ::std::option::Option::None,
|
9991 - | list_of_strings: ::std::option::Option::None,
|
9992 - | list_of_structs: ::std::option::Option::None,
|
9993 - | long: ::std::option::Option::None,
|
9994 - | map_of_lists_of_strings: ::std::option::Option::None,
|
9995 - | map_of_maps: ::std::option::Option::None,
|
9996 - | map_of_strings: ::std::option::Option::None,
|
9997 - | map_of_structs: ::std::option::Option::None,
|
9998 - | recursive_list: ::std::option::Option::None,
|
9999 - | recursive_map: ::std::option::Option::None,
|
10000 - | recursive_struct: ::std::option::Option::None,
|
10001 - | simple_struct: ::std::option::Option::None,
|
10002 - | string: ::std::option::Option::None,
|
10003 - | struct_with_json_name: ::std::option::Option::None,
|
10004 - | timestamp: ::std::option::Option::None,
|
10005 - | unix_timestamp: ::std::option::Option::None,
|
10006 - | };
|
10007 - | ::pretty_assertions::assert_eq!(
|
10008 - | input.blob,
|
10009 - | expected.blob,
|
10010 - | "Unexpected value for `blob`"
|
10011 - | );
|
10012 - | ::pretty_assertions::assert_eq!(
|
10013 - | input.boolean,
|
10014 - | expected.boolean,
|
10015 - | "Unexpected value for `boolean`"
|
10016 - | );
|
10017 - | assert!(
|
10018 - | input.double.float_equals(&expected.double),
|
10019 - | "Unexpected value for `double` {:?} vs. {:?}",
|
10020 - | expected.double,
|
10021 - | input.double
|
10022 - | );
|
10023 - | ::pretty_assertions::assert_eq!(
|
10024 - | input.empty_struct,
|
10025 - | expected.empty_struct,
|
10026 - | "Unexpected value for `empty_struct`"
|
10027 - | );
|
10028 - | assert!(
|
10029 - | input.float.float_equals(&expected.float),
|
10030 - | "Unexpected value for `float` {:?} vs. {:?}",
|
10031 - | expected.float,
|
10032 - | input.float
|
10033 - | );
|
10034 - | ::pretty_assertions::assert_eq!(
|
10035 - | input.httpdate_timestamp,
|
10036 - | expected.httpdate_timestamp,
|
10037 - | "Unexpected value for `httpdate_timestamp`"
|
10038 - | );
|
10039 - | ::pretty_assertions::assert_eq!(
|
10040 - | input.integer,
|
10041 - | expected.integer,
|
10042 - | "Unexpected value for `integer`"
|
10043 - | );
|
10044 - | ::pretty_assertions::assert_eq!(
|
10045 - | input.iso8601_timestamp,
|
10046 - | expected.iso8601_timestamp,
|
10047 - | "Unexpected value for `iso8601_timestamp`"
|
10048 - | );
|
10049 - | ::pretty_assertions::assert_eq!(
|
10050 - | input.json_value,
|
10051 - | expected.json_value,
|
10052 - | "Unexpected value for `json_value`"
|
10053 - | );
|
10054 - | ::pretty_assertions::assert_eq!(
|
10055 - | input.list_of_lists,
|
10056 - | expected.list_of_lists,
|
10057 - | "Unexpected value for `list_of_lists`"
|
10058 - | );
|
10059 - | ::pretty_assertions::assert_eq!(
|
10060 - | input.list_of_maps_of_strings,
|
10061 - | expected.list_of_maps_of_strings,
|
10062 - | "Unexpected value for `list_of_maps_of_strings`"
|
10063 - | );
|
10064 - | ::pretty_assertions::assert_eq!(
|
10065 - | input.list_of_strings,
|
10066 - | expected.list_of_strings,
|
10067 - | "Unexpected value for `list_of_strings`"
|
10068 - | );
|
10069 - | ::pretty_assertions::assert_eq!(
|
10070 - | input.list_of_structs,
|
10071 - | expected.list_of_structs,
|
10072 - | "Unexpected value for `list_of_structs`"
|
10073 - | );
|
10074 - | ::pretty_assertions::assert_eq!(
|
10075 - | input.long,
|
10076 - | expected.long,
|
10077 - | "Unexpected value for `long`"
|
10078 - | );
|
10079 - | ::pretty_assertions::assert_eq!(
|
10080 - | input.map_of_lists_of_strings,
|
10081 - | expected.map_of_lists_of_strings,
|
10082 - | "Unexpected value for `map_of_lists_of_strings`"
|
10083 - | );
|
10084 - | ::pretty_assertions::assert_eq!(
|
10085 - | input.map_of_maps,
|
10086 - | expected.map_of_maps,
|
10087 - | "Unexpected value for `map_of_maps`"
|
10088 - | );
|
10089 - | ::pretty_assertions::assert_eq!(
|
10090 - | input.map_of_strings,
|
10091 - | expected.map_of_strings,
|
10092 - | "Unexpected value for `map_of_strings`"
|
10093 - | );
|
10094 - | ::pretty_assertions::assert_eq!(
|
10095 - | input.map_of_structs,
|
10096 - | expected.map_of_structs,
|
10097 - | "Unexpected value for `map_of_structs`"
|
10098 - | );
|
10099 - | ::pretty_assertions::assert_eq!(
|
10100 - | input.recursive_list,
|
10101 - | expected.recursive_list,
|
10102 - | "Unexpected value for `recursive_list`"
|
10103 - | );
|
10104 - | ::pretty_assertions::assert_eq!(
|
10105 - | input.recursive_map,
|
10106 - | expected.recursive_map,
|
10107 - | "Unexpected value for `recursive_map`"
|
10108 - | );
|
10109 - | ::pretty_assertions::assert_eq!(
|
10110 - | input.recursive_struct,
|
10111 - | expected.recursive_struct,
|
10112 - | "Unexpected value for `recursive_struct`"
|
10113 - | );
|
10114 - | ::pretty_assertions::assert_eq!(
|
10115 - | input.simple_struct,
|
10116 - | expected.simple_struct,
|
10117 - | "Unexpected value for `simple_struct`"
|
10118 - | );
|
10119 - | ::pretty_assertions::assert_eq!(
|
10120 - | input.string,
|
10121 - | expected.string,
|
10122 - | "Unexpected value for `string`"
|
10123 - | );
|
10124 - | ::pretty_assertions::assert_eq!(
|
10125 - | input.struct_with_json_name,
|
10126 - | expected.struct_with_json_name,
|
10127 - | "Unexpected value for `struct_with_json_name`"
|
10128 - | );
|
10129 - | ::pretty_assertions::assert_eq!(
|
10130 - | input.timestamp,
|
10131 - | expected.timestamp,
|
10132 - | "Unexpected value for `timestamp`"
|
10133 - | );
|
10134 - | ::pretty_assertions::assert_eq!(
|
10135 - | input.unix_timestamp,
|
10136 - | expected.unix_timestamp,
|
10137 - | "Unexpected value for `unix_timestamp`"
|
10138 - | );
|
10139 - | let output = crate::output::KitchenSinkOperationOutput {
|
10140 - | blob: ::std::option::Option::None,
|
10141 - | boolean: ::std::option::Option::None,
|
10142 - | double: ::std::option::Option::None,
|
10143 - | empty_struct: ::std::option::Option::None,
|
10144 - | float: ::std::option::Option::None,
|
10145 - | httpdate_timestamp: ::std::option::Option::None,
|
10146 - | integer: ::std::option::Option::None,
|
10147 - | iso8601_timestamp: ::std::option::Option::None,
|
10148 - | json_value: ::std::option::Option::None,
|
10149 - | list_of_lists: ::std::option::Option::None,
|
10150 - | list_of_maps_of_strings: ::std::option::Option::None,
|
10151 - | list_of_strings: ::std::option::Option::None,
|
10152 - | list_of_structs: ::std::option::Option::None,
|
10153 - | long: ::std::option::Option::None,
|
10154 - | map_of_lists_of_strings: ::std::option::Option::None,
|
10155 - | map_of_maps: ::std::option::Option::None,
|
10156 - | map_of_strings: ::std::option::Option::None,
|
10157 - | map_of_structs: ::std::option::Option::None,
|
10158 - | recursive_list: ::std::option::Option::None,
|
10159 - | recursive_map: ::std::option::Option::None,
|
10160 - | recursive_struct: ::std::option::Option::None,
|
10161 - | simple_struct: ::std::option::Option::None,
|
10162 - | string: ::std::option::Option::None,
|
10163 - | struct_with_json_name: ::std::option::Option::None,
|
10164 - | timestamp: ::std::option::Option::None,
|
10165 - | unix_timestamp: ::std::option::Option::None,
|
10166 - | };
|
10167 - | Ok(output)
|
10336 + | let service = crate::service::JsonProtocol::builder::<
|
10337 + | ::aws_smithy_http_server::body::BoxBody,
|
10338 + | _,
|
10339 + | _,
|
10340 + | _,
|
10341 + | >(config)
|
10342 + | .kitchen_sink_operation(move |input: crate::input::KitchenSinkOperationInput| {
|
10343 + | let sender = sender.clone();
|
10344 + | async move {
|
10345 + | let result = {
|
10346 + | use ::aws_smithy_protocol_test::FloatEquals;
|
10347 + | let expected = crate::input::KitchenSinkOperationInput {
|
10348 + | empty_struct: ::std::option::Option::Some(crate::model::EmptyStruct {}),
|
10349 + | blob: ::std::option::Option::None,
|
10350 + | boolean: ::std::option::Option::None,
|
10351 + | double: ::std::option::Option::None,
|
10352 + | float: ::std::option::Option::None,
|
10353 + | httpdate_timestamp: ::std::option::Option::None,
|
10354 + | integer: ::std::option::Option::None,
|
10355 + | iso8601_timestamp: ::std::option::Option::None,
|
10356 + | json_value: ::std::option::Option::None,
|
10357 + | list_of_lists: ::std::option::Option::None,
|
10358 + | list_of_maps_of_strings: ::std::option::Option::None,
|
10359 + | list_of_strings: ::std::option::Option::None,
|
10360 + | list_of_structs: ::std::option::Option::None,
|
10361 + | long: ::std::option::Option::None,
|
10362 + | map_of_lists_of_strings: ::std::option::Option::None,
|
10363 + | map_of_maps: ::std::option::Option::None,
|
10364 + | map_of_strings: ::std::option::Option::None,
|
10365 + | map_of_structs: ::std::option::Option::None,
|
10366 + | recursive_list: ::std::option::Option::None,
|
10367 + | recursive_map: ::std::option::Option::None,
|
10368 + | recursive_struct: ::std::option::Option::None,
|
10369 + | simple_struct: ::std::option::Option::None,
|
10370 + | string: ::std::option::Option::None,
|
10371 + | struct_with_json_name: ::std::option::Option::None,
|
10372 + | timestamp: ::std::option::Option::None,
|
10373 + | unix_timestamp: ::std::option::Option::None,
|
10168 10374 | };
|
10169 - | sender.send(()).await.expect("receiver dropped early");
|
10170 - | result
|
10171 - | }
|
10172 - | })
|
10173 - | .build_unchecked();
|
10375 + | ::pretty_assertions::assert_eq!(
|
10376 + | input.blob,
|
10377 + | expected.blob,
|
10378 + | "Unexpected value for `blob`"
|
10379 + | );
|
10380 + | ::pretty_assertions::assert_eq!(
|
10381 + | input.boolean,
|
10382 + | expected.boolean,
|
10383 + | "Unexpected value for `boolean`"
|
10384 + | );
|
10385 + | assert!(
|
10386 + | input.double.float_equals(&expected.double),
|
10387 + | "Unexpected value for `double` {:?} vs. {:?}",
|
10388 + | expected.double,
|
10389 + | input.double
|
10390 + | );
|
10391 + | ::pretty_assertions::assert_eq!(
|
10392 + | input.empty_struct,
|
10393 + | expected.empty_struct,
|
10394 + | "Unexpected value for `empty_struct`"
|
10395 + | );
|
10396 + | assert!(
|
10397 + | input.float.float_equals(&expected.float),
|
10398 + | "Unexpected value for `float` {:?} vs. {:?}",
|
10399 + | expected.float,
|
10400 + | input.float
|
10401 + | );
|
10402 + | ::pretty_assertions::assert_eq!(
|
10403 + | input.httpdate_timestamp,
|
10404 + | expected.httpdate_timestamp,
|
10405 + | "Unexpected value for `httpdate_timestamp`"
|
10406 + | );
|
10407 + | ::pretty_assertions::assert_eq!(
|
10408 + | input.integer,
|
10409 + | expected.integer,
|
10410 + | "Unexpected value for `integer`"
|
10411 + | );
|
10412 + | ::pretty_assertions::assert_eq!(
|
10413 + | input.iso8601_timestamp,
|
10414 + | expected.iso8601_timestamp,
|
10415 + | "Unexpected value for `iso8601_timestamp`"
|
10416 + | );
|
10417 + | ::pretty_assertions::assert_eq!(
|
10418 + | input.json_value,
|
10419 + | expected.json_value,
|
10420 + | "Unexpected value for `json_value`"
|
10421 + | );
|
10422 + | ::pretty_assertions::assert_eq!(
|
10423 + | input.list_of_lists,
|
10424 + | expected.list_of_lists,
|
10425 + | "Unexpected value for `list_of_lists`"
|
10426 + | );
|
10427 + | ::pretty_assertions::assert_eq!(
|
10428 + | input.list_of_maps_of_strings,
|
10429 + | expected.list_of_maps_of_strings,
|
10430 + | "Unexpected value for `list_of_maps_of_strings`"
|
10431 + | );
|
10432 + | ::pretty_assertions::assert_eq!(
|
10433 + | input.list_of_strings,
|
10434 + | expected.list_of_strings,
|
10435 + | "Unexpected value for `list_of_strings`"
|
10436 + | );
|
10437 + | ::pretty_assertions::assert_eq!(
|
10438 + | input.list_of_structs,
|
10439 + | expected.list_of_structs,
|
10440 + | "Unexpected value for `list_of_structs`"
|
10441 + | );
|
10442 + | ::pretty_assertions::assert_eq!(
|
10443 + | input.long,
|
10444 + | expected.long,
|
10445 + | "Unexpected value for `long`"
|
10446 + | );
|
10447 + | ::pretty_assertions::assert_eq!(
|
10448 + | input.map_of_lists_of_strings,
|
10449 + | expected.map_of_lists_of_strings,
|
10450 + | "Unexpected value for `map_of_lists_of_strings`"
|
10451 + | );
|
10452 + | ::pretty_assertions::assert_eq!(
|
10453 + | input.map_of_maps,
|
10454 + | expected.map_of_maps,
|
10455 + | "Unexpected value for `map_of_maps`"
|
10456 + | );
|
10457 + | ::pretty_assertions::assert_eq!(
|
10458 + | input.map_of_strings,
|
10459 + | expected.map_of_strings,
|
10460 + | "Unexpected value for `map_of_strings`"
|
10461 + | );
|
10462 + | ::pretty_assertions::assert_eq!(
|
10463 + | input.map_of_structs,
|
10464 + | expected.map_of_structs,
|
10465 + | "Unexpected value for `map_of_structs`"
|
10466 + | );
|
10467 + | ::pretty_assertions::assert_eq!(
|
10468 + | input.recursive_list,
|
10469 + | expected.recursive_list,
|
10470 + | "Unexpected value for `recursive_list`"
|
10471 + | );
|
10472 + | ::pretty_assertions::assert_eq!(
|
10473 + | input.recursive_map,
|
10474 + | expected.recursive_map,
|
10475 + | "Unexpected value for `recursive_map`"
|
10476 + | );
|
10477 + | ::pretty_assertions::assert_eq!(
|
10478 + | input.recursive_struct,
|
10479 + | expected.recursive_struct,
|
10480 + | "Unexpected value for `recursive_struct`"
|
10481 + | );
|
10482 + | ::pretty_assertions::assert_eq!(
|
10483 + | input.simple_struct,
|
10484 + | expected.simple_struct,
|
10485 + | "Unexpected value for `simple_struct`"
|
10486 + | );
|
10487 + | ::pretty_assertions::assert_eq!(
|
10488 + | input.string,
|
10489 + | expected.string,
|
10490 + | "Unexpected value for `string`"
|
10491 + | );
|
10492 + | ::pretty_assertions::assert_eq!(
|
10493 + | input.struct_with_json_name,
|
10494 + | expected.struct_with_json_name,
|
10495 + | "Unexpected value for `struct_with_json_name`"
|
10496 + | );
|
10497 + | ::pretty_assertions::assert_eq!(
|
10498 + | input.timestamp,
|
10499 + | expected.timestamp,
|
10500 + | "Unexpected value for `timestamp`"
|
10501 + | );
|
10502 + | ::pretty_assertions::assert_eq!(
|
10503 + | input.unix_timestamp,
|
10504 + | expected.unix_timestamp,
|
10505 + | "Unexpected value for `unix_timestamp`"
|
10506 + | );
|
10507 + | let output = crate::output::KitchenSinkOperationOutput {
|
10508 + | blob: ::std::option::Option::None,
|
10509 + | boolean: ::std::option::Option::None,
|
10510 + | double: ::std::option::Option::None,
|
10511 + | empty_struct: ::std::option::Option::None,
|
10512 + | float: ::std::option::Option::None,
|
10513 + | httpdate_timestamp: ::std::option::Option::None,
|
10514 + | integer: ::std::option::Option::None,
|
10515 + | iso8601_timestamp: ::std::option::Option::None,
|
10516 + | json_value: ::std::option::Option::None,
|
10517 + | list_of_lists: ::std::option::Option::None,
|
10518 + | list_of_maps_of_strings: ::std::option::Option::None,
|
10519 + | list_of_strings: ::std::option::Option::None,
|
10520 + | list_of_structs: ::std::option::Option::None,
|
10521 + | long: ::std::option::Option::None,
|
10522 + | map_of_lists_of_strings: ::std::option::Option::None,
|
10523 + | map_of_maps: ::std::option::Option::None,
|
10524 + | map_of_strings: ::std::option::Option::None,
|
10525 + | map_of_structs: ::std::option::Option::None,
|
10526 + | recursive_list: ::std::option::Option::None,
|
10527 + | recursive_map: ::std::option::Option::None,
|
10528 + | recursive_struct: ::std::option::Option::None,
|
10529 + | simple_struct: ::std::option::Option::None,
|
10530 + | string: ::std::option::Option::None,
|
10531 + | struct_with_json_name: ::std::option::Option::None,
|
10532 + | timestamp: ::std::option::Option::None,
|
10533 + | unix_timestamp: ::std::option::Option::None,
|
10534 + | };
|
10535 + | Ok(output)
|
10536 + | };
|
10537 + | sender.send(()).await.expect("receiver dropped early");
|
10538 + | result
|
10539 + | }
|
10540 + | })
|
10541 + | .build_unchecked();
|
10174 10542 | let http_response = ::tower::ServiceExt::oneshot(service, http_request)
|
10175 10543 | .await
|
10176 10544 | .expect("unable to make an HTTP request");
|
10177 10545 | assert!(
|
10178 10546 | receiver.recv().await.is_some(),
|
10179 10547 | "we expected operation handler to be invoked but it was not entered"
|
10180 10548 | );
|
10181 10549 | }
|
10182 10550 |
|
10183 10551 | /// Serializes recursive structure shapes
|
10184 10552 | /// Test ID: serializes_recursive_structure_shapes
|
10185 10553 | #[::tokio::test]
|
10186 10554 | #[::tracing_test::traced_test]
|
10187 10555 | async fn serializes_recursive_structure_shapes_request() {
|
10188 10556 | #[allow(unused_mut)]
|
10189 - | let mut http_request = http::Request::builder()
|
10557 + | let mut http_request = ::http_1x::Request::builder()
|
10190 10558 | .uri("/")
|
10191 10559 | .method("POST")
|
10192 10560 | .header("Content-Type", "application/x-amz-json-1.1")
|
10193 10561 | .header("X-Amz-Target", "JsonProtocol.KitchenSinkOperation")
|
10194 - | .body(::aws_smithy_http_server::body::Body::from(
|
10195 - | ::bytes::Bytes::copy_from_slice(
|
10196 - | &::aws_smithy_protocol_test::decode_body_data("{\"String\":\"top-value\",\"Boolean\":false,\"RecursiveStruct\":{\"String\":\"nested-value\",\"Boolean\":true,\"RecursiveList\":[{\"String\":\"string-only\"},{\"RecursiveStruct\":{\"MapOfStrings\":{\"color\":\"red\",\"size\":\"large\"}}}]}}".as_bytes(), ::aws_smithy_protocol_test::MediaType::from("application/json"))
|
10197 - | )
|
10198 - | )).unwrap();
|
10562 + | .body(::aws_smithy_http_server::body::boxed(::http_body_util::Full::new(
|
10563 + | ::bytes::Bytes::copy_from_slice(
|
10564 + | &::aws_smithy_protocol_test::decode_body_data("{\"String\":\"top-value\",\"Boolean\":false,\"RecursiveStruct\":{\"String\":\"nested-value\",\"Boolean\":true,\"RecursiveList\":[{\"String\":\"string-only\"},{\"RecursiveStruct\":{\"MapOfStrings\":{\"color\":\"red\",\"size\":\"large\"}}}]}}".as_bytes(), ::aws_smithy_protocol_test::MediaType::from("application/json"))
|
10565 + | )
|
10566 + | ))).unwrap();
|
10199 10567 | #[allow(unused_mut)]
|
10200 10568 | let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
|
10201 10569 | let config = crate::service::JsonProtocolConfig::builder().build();
|
10202 - | let service = crate::service::JsonProtocol::builder::<::hyper::body::Body, _, _, _>(config)
|
10203 - | .kitchen_sink_operation(move |input: crate::input::KitchenSinkOperationInput| {
|
10204 - | let sender = sender.clone();
|
10205 - | async move {
|
10206 - | let result = {
|
10207 - | use ::aws_smithy_protocol_test::FloatEquals;
|
10208 - | let expected = crate::input::KitchenSinkOperationInput {
|
10209 - | string: ::std::option::Option::Some("top-value".to_owned()),
|
10210 - | boolean: ::std::option::Option::Some(false),
|
10211 - | recursive_struct: ::std::option::Option::Some(::std::boxed::Box::new(
|
10212 - | crate::model::KitchenSink {
|
10213 - | string: ::std::option::Option::Some("nested-value".to_owned()),
|
10214 - | boolean: ::std::option::Option::Some(true),
|
10215 - | recursive_list: ::std::option::Option::Some(vec![
|
10216 - | crate::model::KitchenSink {
|
10217 - | string: ::std::option::Option::Some(
|
10218 - | "string-only".to_owned(),
|
10219 - | ),
|
10220 - | blob: ::std::option::Option::None,
|
10221 - | boolean: ::std::option::Option::None,
|
10222 - | double: ::std::option::Option::None,
|
10223 - | empty_struct: ::std::option::Option::None,
|
10224 - | float: ::std::option::Option::None,
|
10225 - | httpdate_timestamp: ::std::option::Option::None,
|
10226 - | integer: ::std::option::Option::None,
|
10227 - | iso8601_timestamp: ::std::option::Option::None,
|
10228 - | json_value: ::std::option::Option::None,
|
10229 - | list_of_lists: ::std::option::Option::None,
|
10230 - | list_of_maps_of_strings: ::std::option::Option::None,
|
10231 - | list_of_strings: ::std::option::Option::None,
|
10232 - | list_of_structs: ::std::option::Option::None,
|
10233 - | long: ::std::option::Option::None,
|
10234 - | map_of_lists_of_strings: ::std::option::Option::None,
|
10235 - | map_of_maps: ::std::option::Option::None,
|
10236 - | map_of_strings: ::std::option::Option::None,
|
10237 - | map_of_structs: ::std::option::Option::None,
|
10238 - | recursive_list: ::std::option::Option::None,
|
10239 - | recursive_map: ::std::option::Option::None,
|
10240 - | recursive_struct: ::std::option::Option::None,
|
10241 - | simple_struct: ::std::option::Option::None,
|
10242 - | struct_with_json_name: ::std::option::Option::None,
|
10243 - | timestamp: ::std::option::Option::None,
|
10244 - | unix_timestamp: ::std::option::Option::None,
|
10245 - | },
|
10246 - | crate::model::KitchenSink {
|
10247 - | recursive_struct: ::std::option::Option::Some(
|
10248 - | ::std::boxed::Box::new(crate::model::KitchenSink {
|
10249 - | map_of_strings: ::std::option::Option::Some({
|
10250 - | let mut ret =
|
10251 - | ::std::collections::HashMap::new();
|
10252 - | ret.insert(
|
10253 - | "color".to_owned(),
|
10254 - | "red".to_owned(),
|
10255 - | );
|
10256 - | ret.insert(
|
10257 - | "size".to_owned(),
|
10258 - | "large".to_owned(),
|
10259 - | );
|
10260 - | ret
|
10261 - | }),
|
10262 - | blob: ::std::option::Option::None,
|
10263 - | boolean: ::std::option::Option::None,
|
10264 - | double: ::std::option::Option::None,
|
10265 - | empty_struct: ::std::option::Option::None,
|
10266 - | float: ::std::option::Option::None,
|
10267 - | httpdate_timestamp: ::std::option::Option::None,
|
10268 - | integer: ::std::option::Option::None,
|
10269 - | iso8601_timestamp: ::std::option::Option::None,
|
10270 - | json_value: ::std::option::Option::None,
|
10271 - | list_of_lists: ::std::option::Option::None,
|
10272 - | list_of_maps_of_strings:
|
10273 - | ::std::option::Option::None,
|
10274 - | list_of_strings: ::std::option::Option::None,
|
10275 - | list_of_structs: ::std::option::Option::None,
|
10276 - | long: ::std::option::Option::None,
|
10277 - | map_of_lists_of_strings:
|
10278 - | ::std::option::Option::None,
|
10279 - | map_of_maps: ::std::option::Option::None,
|
10280 - | map_of_structs: ::std::option::Option::None,
|
10281 - | recursive_list: ::std::option::Option::None,
|
10282 - | recursive_map: ::std::option::Option::None,
|
10283 - | recursive_struct: ::std::option::Option::None,
|
10284 - | simple_struct: ::std::option::Option::None,
|
10285 - | string: ::std::option::Option::None,
|
10286 - | struct_with_json_name:
|
10287 - | ::std::option::Option::None,
|
10288 - | timestamp: ::std::option::Option::None,
|
10289 - | unix_timestamp: ::std::option::Option::None,
|
10570 + | let service = crate::service::JsonProtocol::builder::<
|
10571 + | ::aws_smithy_http_server::body::BoxBody,
|
10572 + | _,
|
10573 + | _,
|
10574 + | _,
|
10575 + | >(config)
|
10576 + | .kitchen_sink_operation(move |input: crate::input::KitchenSinkOperationInput| {
|
10577 + | let sender = sender.clone();
|
10578 + | async move {
|
10579 + | let result = {
|
10580 + | use ::aws_smithy_protocol_test::FloatEquals;
|
10581 + | let expected = crate::input::KitchenSinkOperationInput {
|
10582 + | string: ::std::option::Option::Some("top-value".to_owned()),
|
10583 + | boolean: ::std::option::Option::Some(false),
|
10584 + | recursive_struct: ::std::option::Option::Some(::std::boxed::Box::new(
|
10585 + | crate::model::KitchenSink {
|
10586 + | string: ::std::option::Option::Some("nested-value".to_owned()),
|
10587 + | boolean: ::std::option::Option::Some(true),
|
10588 + | recursive_list: ::std::option::Option::Some(vec![
|
10589 + | crate::model::KitchenSink {
|
10590 + | string: ::std::option::Option::Some(
|
10591 + | "string-only".to_owned(),
|
10592 + | ),
|
10593 + | blob: ::std::option::Option::None,
|
10594 + | boolean: ::std::option::Option::None,
|
10595 + | double: ::std::option::Option::None,
|
10596 + | empty_struct: ::std::option::Option::None,
|
10597 + | float: ::std::option::Option::None,
|
10598 + | httpdate_timestamp: ::std::option::Option::None,
|
10599 + | integer: ::std::option::Option::None,
|
10600 + | iso8601_timestamp: ::std::option::Option::None,
|
10601 + | json_value: ::std::option::Option::None,
|
10602 + | list_of_lists: ::std::option::Option::None,
|
10603 + | list_of_maps_of_strings: ::std::option::Option::None,
|
10604 + | list_of_strings: ::std::option::Option::None,
|
10605 + | list_of_structs: ::std::option::Option::None,
|
10606 + | long: ::std::option::Option::None,
|
10607 + | map_of_lists_of_strings: ::std::option::Option::None,
|
10608 + | map_of_maps: ::std::option::Option::None,
|
10609 + | map_of_strings: ::std::option::Option::None,
|
10610 + | map_of_structs: ::std::option::Option::None,
|
10611 + | recursive_list: ::std::option::Option::None,
|
10612 + | recursive_map: ::std::option::Option::None,
|
10613 + | recursive_struct: ::std::option::Option::None,
|
10614 + | simple_struct: ::std::option::Option::None,
|
10615 + | struct_with_json_name: ::std::option::Option::None,
|
10616 + | timestamp: ::std::option::Option::None,
|
10617 + | unix_timestamp: ::std::option::Option::None,
|
10618 + | },
|
10619 + | crate::model::KitchenSink {
|
10620 + | recursive_struct: ::std::option::Option::Some(
|
10621 + | ::std::boxed::Box::new(crate::model::KitchenSink {
|
10622 + | map_of_strings: ::std::option::Option::Some({
|
10623 + | let mut ret =
|
10624 + | ::std::collections::HashMap::new();
|
10625 + | ret.insert(
|
10626 + | "color".to_owned(),
|
10627 + | "red".to_owned(),
|
10628 + | );
|
10629 + | ret.insert(
|
10630 + | "size".to_owned(),
|
10631 + | "large".to_owned(),
|
10632 + | );
|
10633 + | ret
|
10290 10634 | }),
|
10291 - | ),
|
10292 - | blob: ::std::option::Option::None,
|
10293 - | boolean: ::std::option::Option::None,
|
10294 - | double: ::std::option::Option::None,
|
10295 - | empty_struct: ::std::option::Option::None,
|
10296 - | float: ::std::option::Option::None,
|
10297 - | httpdate_timestamp: ::std::option::Option::None,
|
10298 - | integer: ::std::option::Option::None,
|
10299 - | iso8601_timestamp: ::std::option::Option::None,
|
10300 - | json_value: ::std::option::Option::None,
|
10301 - | list_of_lists: ::std::option::Option::None,
|
10302 - | list_of_maps_of_strings: ::std::option::Option::None,
|
10303 - | list_of_strings: ::std::option::Option::None,
|
10304 - | list_of_structs: ::std::option::Option::None,
|
10305 - | long: ::std::option::Option::None,
|
10306 - | map_of_lists_of_strings: ::std::option::Option::None,
|
10307 - | map_of_maps: ::std::option::Option::None,
|
10308 - | map_of_strings: ::std::option::Option::None,
|
10309 - | map_of_structs: ::std::option::Option::None,
|
10310 - | recursive_list: ::std::option::Option::None,
|
10311 - | recursive_map: ::std::option::Option::None,
|
10312 - | simple_struct: ::std::option::Option::None,
|
10313 - | string: ::std::option::Option::None,
|
10314 - | struct_with_json_name: ::std::option::Option::None,
|
10315 - | timestamp: ::std::option::Option::None,
|
10316 - | unix_timestamp: ::std::option::Option::None,
|
10317 - | },
|
10318 - | ]),
|
10319 - | blob: ::std::option::Option::None,
|
10320 - | double: ::std::option::Option::None,
|
10321 - | empty_struct: ::std::option::Option::None,
|
10322 - | float: ::std::option::Option::None,
|
10323 - | httpdate_timestamp: ::std::option::Option::None,
|
10324 - | integer: ::std::option::Option::None,
|
10325 - | iso8601_timestamp: ::std::option::Option::None,
|
10326 - | json_value: ::std::option::Option::None,
|
10327 - | list_of_lists: ::std::option::Option::None,
|
10328 - | list_of_maps_of_strings: ::std::option::Option::None,
|
10329 - | list_of_strings: ::std::option::Option::None,
|
10330 - | list_of_structs: ::std::option::Option::None,
|
10331 - | long: ::std::option::Option::None,
|
10332 - | map_of_lists_of_strings: ::std::option::Option::None,
|
10333 - | map_of_maps: ::std::option::Option::None,
|
10334 - | map_of_strings: ::std::option::Option::None,
|
10335 - | map_of_structs: ::std::option::Option::None,
|
10336 - | recursive_map: ::std::option::Option::None,
|
10337 - | recursive_struct: ::std::option::Option::None,
|
10338 - | simple_struct: ::std::option::Option::None,
|
10339 - | struct_with_json_name: ::std::option::Option::None,
|
10340 - | timestamp: ::std::option::Option::None,
|
10341 - | unix_timestamp: ::std::option::Option::None,
|
10342 - | },
|
10343 - | )),
|
10344 - | blob: ::std::option::Option::None,
|
10345 - | double: ::std::option::Option::None,
|
10346 - | empty_struct: ::std::option::Option::None,
|
10347 - | float: ::std::option::Option::None,
|
10348 - | httpdate_timestamp: ::std::option::Option::None,
|
10349 - | integer: ::std::option::Option::None,
|
10350 - | iso8601_timestamp: ::std::option::Option::None,
|
10351 - | json_value: ::std::option::Option::None,
|
10352 - | list_of_lists: ::std::option::Option::None,
|
10353 - | list_of_maps_of_strings: ::std::option::Option::None,
|
10354 - | list_of_strings: ::std::option::Option::None,
|
10355 - | list_of_structs: ::std::option::Option::None,
|
10356 - | long: ::std::option::Option::None,
|
10357 - | map_of_lists_of_strings: ::std::option::Option::None,
|
10358 - | map_of_maps: ::std::option::Option::None,
|
10359 - | map_of_strings: ::std::option::Option::None,
|
10360 - | map_of_structs: ::std::option::Option::None,
|
10361 - | recursive_list: ::std::option::Option::None,
|
10362 - | recursive_map: ::std::option::Option::None,
|
10363 - | simple_struct: ::std::option::Option::None,
|
10364 - | struct_with_json_name: ::std::option::Option::None,
|
10365 - | timestamp: ::std::option::Option::None,
|
10366 - | unix_timestamp: ::std::option::Option::None,
|
10367 - | };
|
10368 - | ::pretty_assertions::assert_eq!(
|
10369 - | input.blob,
|
10370 - | expected.blob,
|
10371 - | "Unexpected value for `blob`"
|
10372 - | );
|
10373 - | ::pretty_assertions::assert_eq!(
|
10374 - | input.boolean,
|
10375 - | expected.boolean,
|
10376 - | "Unexpected value for `boolean`"
|
10377 - | );
|
10378 - | assert!(
|
10379 - | input.double.float_equals(&expected.double),
|
10380 - | "Unexpected value for `double` {:?} vs. {:?}",
|
10381 - | expected.double,
|
10382 - | input.double
|
10383 - | );
|
10384 - | ::pretty_assertions::assert_eq!(
|
10385 - | input.empty_struct,
|
10386 - | expected.empty_struct,
|
10387 - | "Unexpected value for `empty_struct`"
|
10388 - | );
|
10389 - | assert!(
|
10390 - | input.float.float_equals(&expected.float),
|
10391 - | "Unexpected value for `float` {:?} vs. {:?}",
|
10392 - | expected.float,
|
10393 - | input.float
|
10394 - | );
|
10395 - | ::pretty_assertions::assert_eq!(
|
10396 - | input.httpdate_timestamp,
|
10397 - | expected.httpdate_timestamp,
|
10398 - | "Unexpected value for `httpdate_timestamp`"
|
10399 - | );
|
10400 - | ::pretty_assertions::assert_eq!(
|
10401 - | input.integer,
|
10402 - | expected.integer,
|
10403 - | "Unexpected value for `integer`"
|
10404 - | );
|
10405 - | ::pretty_assertions::assert_eq!(
|
10406 - | input.iso8601_timestamp,
|
10407 - | expected.iso8601_timestamp,
|
10408 - | "Unexpected value for `iso8601_timestamp`"
|
10409 - | );
|
10410 - | ::pretty_assertions::assert_eq!(
|
10411 - | input.json_value,
|
10412 - | expected.json_value,
|
10413 - | "Unexpected value for `json_value`"
|
10414 - | );
|
10415 - | ::pretty_assertions::assert_eq!(
|
10416 - | input.list_of_lists,
|
10417 - | expected.list_of_lists,
|
10418 - | "Unexpected value for `list_of_lists`"
|
10419 - | );
|
10420 - | ::pretty_assertions::assert_eq!(
|
10421 - | input.list_of_maps_of_strings,
|
10422 - | expected.list_of_maps_of_strings,
|
10423 - | "Unexpected value for `list_of_maps_of_strings`"
|
10424 - | );
|
10425 - | ::pretty_assertions::assert_eq!(
|
10426 - | input.list_of_strings,
|
10427 - | expected.list_of_strings,
|
10428 - | "Unexpected value for `list_of_strings`"
|
10429 - | );
|
10430 - | ::pretty_assertions::assert_eq!(
|
10431 - | input.list_of_structs,
|
10432 - | expected.list_of_structs,
|
10433 - | "Unexpected value for `list_of_structs`"
|
10434 - | );
|
10435 - | ::pretty_assertions::assert_eq!(
|
10436 - | input.long,
|
10437 - | expected.long,
|
10438 - | "Unexpected value for `long`"
|
10439 - | );
|
10440 - | ::pretty_assertions::assert_eq!(
|
10441 - | input.map_of_lists_of_strings,
|
10442 - | expected.map_of_lists_of_strings,
|
10443 - | "Unexpected value for `map_of_lists_of_strings`"
|
10444 - | );
|
10445 - | ::pretty_assertions::assert_eq!(
|
10446 - | input.map_of_maps,
|
10447 - | expected.map_of_maps,
|
10448 - | "Unexpected value for `map_of_maps`"
|
10449 - | );
|
10450 - | ::pretty_assertions::assert_eq!(
|
10451 - | input.map_of_strings,
|
10452 - | expected.map_of_strings,
|
10453 - | "Unexpected value for `map_of_strings`"
|
10454 - | );
|
10455 - | ::pretty_assertions::assert_eq!(
|
10456 - | input.map_of_structs,
|
10457 - | expected.map_of_structs,
|
10458 - | "Unexpected value for `map_of_structs`"
|
10459 - | );
|
10460 - | ::pretty_assertions::assert_eq!(
|
10461 - | input.recursive_list,
|
10462 - | expected.recursive_list,
|
10463 - | "Unexpected value for `recursive_list`"
|
10464 - | );
|
10465 - | ::pretty_assertions::assert_eq!(
|
10466 - | input.recursive_map,
|
10467 - | expected.recursive_map,
|
10468 - | "Unexpected value for `recursive_map`"
|
10469 - | );
|
10470 - | ::pretty_assertions::assert_eq!(
|
10471 - | input.recursive_struct,
|
10472 - | expected.recursive_struct,
|
10473 - | "Unexpected value for `recursive_struct`"
|
10474 - | );
|
10475 - | ::pretty_assertions::assert_eq!(
|
10476 - | input.simple_struct,
|
10477 - | expected.simple_struct,
|
10478 - | "Unexpected value for `simple_struct`"
|
10479 - | );
|
10480 - | ::pretty_assertions::assert_eq!(
|
10481 - | input.string,
|
10482 - | expected.string,
|
10483 - | "Unexpected value for `string`"
|
10484 - | );
|
10485 - | ::pretty_assertions::assert_eq!(
|
10486 - | input.struct_with_json_name,
|
10487 - | expected.struct_with_json_name,
|
10488 - | "Unexpected value for `struct_with_json_name`"
|
10489 - | );
|
10490 - | ::pretty_assertions::assert_eq!(
|
10491 - | input.timestamp,
|
10492 - | expected.timestamp,
|
10493 - | "Unexpected value for `timestamp`"
|
10494 - | );
|
10495 - | ::pretty_assertions::assert_eq!(
|
10496 - | input.unix_timestamp,
|
10497 - | expected.unix_timestamp,
|
10498 - | "Unexpected value for `unix_timestamp`"
|
10499 - | );
|
10500 - | let output = crate::output::KitchenSinkOperationOutput {
|
10501 - | blob: ::std::option::Option::None,
|
10502 - | boolean: ::std::option::Option::None,
|
10503 - | double: ::std::option::Option::None,
|
10504 - | empty_struct: ::std::option::Option::None,
|
10505 - | float: ::std::option::Option::None,
|
10506 - | httpdate_timestamp: ::std::option::Option::None,
|
10507 - | integer: ::std::option::Option::None,
|
10508 - | iso8601_timestamp: ::std::option::Option::None,
|
10509 - | json_value: ::std::option::Option::None,
|
10510 - | list_of_lists: ::std::option::Option::None,
|
10511 - | list_of_maps_of_strings: ::std::option::Option::None,
|
10512 - | list_of_strings: ::std::option::Option::None,
|
10513 - | list_of_structs: ::std::option::Option::None,
|
10514 - | long: ::std::option::Option::None,
|
10515 - | map_of_lists_of_strings: ::std::option::Option::None,
|
10516 - | map_of_maps: ::std::option::Option::None,
|
10517 - | map_of_strings: ::std::option::Option::None,
|
10518 - | map_of_structs: ::std::option::Option::None,
|
10519 - | recursive_list: ::std::option::Option::None,
|
10520 - | recursive_map: ::std::option::Option::None,
|
10521 - | recursive_struct: ::std::option::Option::None,
|
10522 - | simple_struct: ::std::option::Option::None,
|
10523 - | string: ::std::option::Option::None,
|
10524 - | struct_with_json_name: ::std::option::Option::None,
|
10525 - | timestamp: ::std::option::Option::None,
|
10526 - | unix_timestamp: ::std::option::Option::None,
|
10527 - | };
|
10528 - | Ok(output)
|
10635 + | blob: ::std::option::Option::None,
|
10636 + | boolean: ::std::option::Option::None,
|
10637 + | double: ::std::option::Option::None,
|
10638 + | empty_struct: ::std::option::Option::None,
|
10639 + | float: ::std::option::Option::None,
|
10640 + | httpdate_timestamp: ::std::option::Option::None,
|
10641 + | integer: ::std::option::Option::None,
|
10642 + | iso8601_timestamp: ::std::option::Option::None,
|
10643 + | json_value: ::std::option::Option::None,
|
10644 + | list_of_lists: ::std::option::Option::None,
|
10645 + | list_of_maps_of_strings:
|
10646 + | ::std::option::Option::None,
|
10647 + | list_of_strings: ::std::option::Option::None,
|
10648 + | list_of_structs: ::std::option::Option::None,
|
10649 + | long: ::std::option::Option::None,
|
10650 + | map_of_lists_of_strings:
|
10651 + | ::std::option::Option::None,
|
10652 + | map_of_maps: ::std::option::Option::None,
|
10653 + | map_of_structs: ::std::option::Option::None,
|
10654 + | recursive_list: ::std::option::Option::None,
|
10655 + | recursive_map: ::std::option::Option::None,
|
10656 + | recursive_struct: ::std::option::Option::None,
|
10657 + | simple_struct: ::std::option::Option::None,
|
10658 + | string: ::std::option::Option::None,
|
10659 + | struct_with_json_name: ::std::option::Option::None,
|
10660 + | timestamp: ::std::option::Option::None,
|
10661 + | unix_timestamp: ::std::option::Option::None,
|
10662 + | }),
|
10663 + | ),
|
10664 + | blob: ::std::option::Option::None,
|
10665 + | boolean: ::std::option::Option::None,
|
10666 + | double: ::std::option::Option::None,
|
10667 + | empty_struct: ::std::option::Option::None,
|
10668 + | float: ::std::option::Option::None,
|
10669 + | httpdate_timestamp: ::std::option::Option::None,
|
10670 + | integer: ::std::option::Option::None,
|
10671 + | iso8601_timestamp: ::std::option::Option::None,
|
10672 + | json_value: ::std::option::Option::None,
|
10673 + | list_of_lists: ::std::option::Option::None,
|
10674 + | list_of_maps_of_strings: ::std::option::Option::None,
|
10675 + | list_of_strings: ::std::option::Option::None,
|
10676 + | list_of_structs: ::std::option::Option::None,
|
10677 + | long: ::std::option::Option::None,
|
10678 + | map_of_lists_of_strings: ::std::option::Option::None,
|
10679 + | map_of_maps: ::std::option::Option::None,
|
10680 + | map_of_strings: ::std::option::Option::None,
|
10681 + | map_of_structs: ::std::option::Option::None,
|
10682 + | recursive_list: ::std::option::Option::None,
|
10683 + | recursive_map: ::std::option::Option::None,
|
10684 + | simple_struct: ::std::option::Option::None,
|
10685 + | string: ::std::option::Option::None,
|
10686 + | struct_with_json_name: ::std::option::Option::None,
|
10687 + | timestamp: ::std::option::Option::None,
|
10688 + | unix_timestamp: ::std::option::Option::None,
|
10689 + | },
|
10690 + | ]),
|
10691 + | blob: ::std::option::Option::None,
|
10692 + | double: ::std::option::Option::None,
|
10693 + | empty_struct: ::std::option::Option::None,
|
10694 + | float: ::std::option::Option::None,
|
10695 + | httpdate_timestamp: ::std::option::Option::None,
|
10696 + | integer: ::std::option::Option::None,
|
10697 + | iso8601_timestamp: ::std::option::Option::None,
|
10698 + | json_value: ::std::option::Option::None,
|
10699 + | list_of_lists: ::std::option::Option::None,
|
10700 + | list_of_maps_of_strings: ::std::option::Option::None,
|
10701 + | list_of_strings: ::std::option::Option::None,
|
10702 + | list_of_structs: ::std::option::Option::None,
|
10703 + | long: ::std::option::Option::None,
|
10704 + | map_of_lists_of_strings: ::std::option::Option::None,
|
10705 + | map_of_maps: ::std::option::Option::None,
|
10706 + | map_of_strings: ::std::option::Option::None,
|
10707 + | map_of_structs: ::std::option::Option::None,
|
10708 + | recursive_map: ::std::option::Option::None,
|
10709 + | recursive_struct: ::std::option::Option::None,
|
10710 + | simple_struct: ::std::option::Option::None,
|
10711 + | struct_with_json_name: ::std::option::Option::None,
|
10712 + | timestamp: ::std::option::Option::None,
|
10713 + | unix_timestamp: ::std::option::Option::None,
|
10714 + | },
|
10715 + | )),
|
10716 + | blob: ::std::option::Option::None,
|
10717 + | double: ::std::option::Option::None,
|
10718 + | empty_struct: ::std::option::Option::None,
|
10719 + | float: ::std::option::Option::None,
|
10720 + | httpdate_timestamp: ::std::option::Option::None,
|
10721 + | integer: ::std::option::Option::None,
|
10722 + | iso8601_timestamp: ::std::option::Option::None,
|
10723 + | json_value: ::std::option::Option::None,
|
10724 + | list_of_lists: ::std::option::Option::None,
|
10725 + | list_of_maps_of_strings: ::std::option::Option::None,
|
10726 + | list_of_strings: ::std::option::Option::None,
|
10727 + | list_of_structs: ::std::option::Option::None,
|
10728 + | long: ::std::option::Option::None,
|
10729 + | map_of_lists_of_strings: ::std::option::Option::None,
|
10730 + | map_of_maps: ::std::option::Option::None,
|
10731 + | map_of_strings: ::std::option::Option::None,
|
10732 + | map_of_structs: ::std::option::Option::None,
|
10733 + | recursive_list: ::std::option::Option::None,
|
10734 + | recursive_map: ::std::option::Option::None,
|
10735 + | simple_struct: ::std::option::Option::None,
|
10736 + | struct_with_json_name: ::std::option::Option::None,
|
10737 + | timestamp: ::std::option::Option::None,
|
10738 + | unix_timestamp: ::std::option::Option::None,
|
10529 10739 | };
|
10530 - | sender.send(()).await.expect("receiver dropped early");
|
10531 - | result
|
10532 - | }
|
10533 - | })
|
10534 - | .build_unchecked();
|
10740 + | ::pretty_assertions::assert_eq!(
|
10741 + | input.blob,
|
10742 + | expected.blob,
|
10743 + | "Unexpected value for `blob`"
|
10744 + | );
|
10745 + | ::pretty_assertions::assert_eq!(
|
10746 + | input.boolean,
|
10747 + | expected.boolean,
|
10748 + | "Unexpected value for `boolean`"
|
10749 + | );
|
10750 + | assert!(
|
10751 + | input.double.float_equals(&expected.double),
|
10752 + | "Unexpected value for `double` {:?} vs. {:?}",
|
10753 + | expected.double,
|
10754 + | input.double
|
10755 + | );
|
10756 + | ::pretty_assertions::assert_eq!(
|
10757 + | input.empty_struct,
|
10758 + | expected.empty_struct,
|
10759 + | "Unexpected value for `empty_struct`"
|
10760 + | );
|
10761 + | assert!(
|
10762 + | input.float.float_equals(&expected.float),
|
10763 + | "Unexpected value for `float` {:?} vs. {:?}",
|
10764 + | expected.float,
|
10765 + | input.float
|
10766 + | );
|
10767 + | ::pretty_assertions::assert_eq!(
|
10768 + | input.httpdate_timestamp,
|
10769 + | expected.httpdate_timestamp,
|
10770 + | "Unexpected value for `httpdate_timestamp`"
|
10771 + | );
|
10772 + | ::pretty_assertions::assert_eq!(
|
10773 + | input.integer,
|
10774 + | expected.integer,
|
10775 + | "Unexpected value for `integer`"
|
10776 + | );
|
10777 + | ::pretty_assertions::assert_eq!(
|
10778 + | input.iso8601_timestamp,
|
10779 + | expected.iso8601_timestamp,
|
10780 + | "Unexpected value for `iso8601_timestamp`"
|
10781 + | );
|
10782 + | ::pretty_assertions::assert_eq!(
|
10783 + | input.json_value,
|
10784 + | expected.json_value,
|
10785 + | "Unexpected value for `json_value`"
|
10786 + | );
|
10787 + | ::pretty_assertions::assert_eq!(
|
10788 + | input.list_of_lists,
|
10789 + | expected.list_of_lists,
|
10790 + | "Unexpected value for `list_of_lists`"
|
10791 + | );
|
10792 + | ::pretty_assertions::assert_eq!(
|
10793 + | input.list_of_maps_of_strings,
|
10794 + | expected.list_of_maps_of_strings,
|
10795 + | "Unexpected value for `list_of_maps_of_strings`"
|
10796 + | );
|
10797 + | ::pretty_assertions::assert_eq!(
|
10798 + | input.list_of_strings,
|
10799 + | expected.list_of_strings,
|
10800 + | "Unexpected value for `list_of_strings`"
|
10801 + | );
|
10802 + | ::pretty_assertions::assert_eq!(
|
10803 + | input.list_of_structs,
|
10804 + | expected.list_of_structs,
|
10805 + | "Unexpected value for `list_of_structs`"
|
10806 + | );
|
10807 + | ::pretty_assertions::assert_eq!(
|
10808 + | input.long,
|
10809 + | expected.long,
|
10810 + | "Unexpected value for `long`"
|
10811 + | );
|
10812 + | ::pretty_assertions::assert_eq!(
|
10813 + | input.map_of_lists_of_strings,
|
10814 + | expected.map_of_lists_of_strings,
|
10815 + | "Unexpected value for `map_of_lists_of_strings`"
|
10816 + | );
|
10817 + | ::pretty_assertions::assert_eq!(
|
10818 + | input.map_of_maps,
|
10819 + | expected.map_of_maps,
|
10820 + | "Unexpected value for `map_of_maps`"
|
10821 + | );
|
10822 + | ::pretty_assertions::assert_eq!(
|
10823 + | input.map_of_strings,
|
10824 + | expected.map_of_strings,
|
10825 + | "Unexpected value for `map_of_strings`"
|
10826 + | );
|
10827 + | ::pretty_assertions::assert_eq!(
|
10828 + | input.map_of_structs,
|
10829 + | expected.map_of_structs,
|
10830 + | "Unexpected value for `map_of_structs`"
|
10831 + | );
|
10832 + | ::pretty_assertions::assert_eq!(
|
10833 + | input.recursive_list,
|
10834 + | expected.recursive_list,
|
10835 + | "Unexpected value for `recursive_list`"
|
10836 + | );
|
10837 + | ::pretty_assertions::assert_eq!(
|
10838 + | input.recursive_map,
|
10839 + | expected.recursive_map,
|
10840 + | "Unexpected value for `recursive_map`"
|
10841 + | );
|
10842 + | ::pretty_assertions::assert_eq!(
|
10843 + | input.recursive_struct,
|
10844 + | expected.recursive_struct,
|
10845 + | "Unexpected value for `recursive_struct`"
|
10846 + | );
|
10847 + | ::pretty_assertions::assert_eq!(
|
10848 + | input.simple_struct,
|
10849 + | expected.simple_struct,
|
10850 + | "Unexpected value for `simple_struct`"
|
10851 + | );
|
10852 + | ::pretty_assertions::assert_eq!(
|
10853 + | input.string,
|
10854 + | expected.string,
|
10855 + | "Unexpected value for `string`"
|
10856 + | );
|
10857 + | ::pretty_assertions::assert_eq!(
|
10858 + | input.struct_with_json_name,
|
10859 + | expected.struct_with_json_name,
|
10860 + | "Unexpected value for `struct_with_json_name`"
|
10861 + | );
|
10862 + | ::pretty_assertions::assert_eq!(
|
10863 + | input.timestamp,
|
10864 + | expected.timestamp,
|
10865 + | "Unexpected value for `timestamp`"
|
10866 + | );
|
10867 + | ::pretty_assertions::assert_eq!(
|
10868 + | input.unix_timestamp,
|
10869 + | expected.unix_timestamp,
|
10870 + | "Unexpected value for `unix_timestamp`"
|
10871 + | );
|
10872 + | let output = crate::output::KitchenSinkOperationOutput {
|
10873 + | blob: ::std::option::Option::None,
|
10874 + | boolean: ::std::option::Option::None,
|
10875 + | double: ::std::option::Option::None,
|
10876 + | empty_struct: ::std::option::Option::None,
|
10877 + | float: ::std::option::Option::None,
|
10878 + | httpdate_timestamp: ::std::option::Option::None,
|
10879 + | integer: ::std::option::Option::None,
|
10880 + | iso8601_timestamp: ::std::option::Option::None,
|
10881 + | json_value: ::std::option::Option::None,
|
10882 + | list_of_lists: ::std::option::Option::None,
|
10883 + | list_of_maps_of_strings: ::std::option::Option::None,
|
10884 + | list_of_strings: ::std::option::Option::None,
|
10885 + | list_of_structs: ::std::option::Option::None,
|
10886 + | long: ::std::option::Option::None,
|
10887 + | map_of_lists_of_strings: ::std::option::Option::None,
|
10888 + | map_of_maps: ::std::option::Option::None,
|
10889 + | map_of_strings: ::std::option::Option::None,
|
10890 + | map_of_structs: ::std::option::Option::None,
|
10891 + | recursive_list: ::std::option::Option::None,
|
10892 + | recursive_map: ::std::option::Option::None,
|
10893 + | recursive_struct: ::std::option::Option::None,
|
10894 + | simple_struct: ::std::option::Option::None,
|
10895 + | string: ::std::option::Option::None,
|
10896 + | struct_with_json_name: ::std::option::Option::None,
|
10897 + | timestamp: ::std::option::Option::None,
|
10898 + | unix_timestamp: ::std::option::Option::None,
|
10899 + | };
|
10900 + | Ok(output)
|
10901 + | };
|
10902 + | sender.send(()).await.expect("receiver dropped early");
|
10903 + | result
|
10904 + | }
|
10905 + | })
|
10906 + | .build_unchecked();
|
10535 10907 | let http_response = ::tower::ServiceExt::oneshot(service, http_request)
|
10536 10908 | .await
|
10537 10909 | .expect("unable to make an HTTP request");
|
10538 10910 | assert!(
|
10539 10911 | receiver.recv().await.is_some(),
|
10540 10912 | "we expected operation handler to be invoked but it was not entered"
|
10541 10913 | );
|
10542 10914 | }
|
10543 10915 |
|
10544 10916 | /// Parses operations with empty JSON bodies
|
10545 10917 | /// Test ID: parses_operations_with_empty_json_bodies
|
10546 10918 | #[::tokio::test]
|
10547 10919 | #[::tracing_test::traced_test]
|
10548 10920 | async fn parses_operations_with_empty_json_bodies_response() {
|
10549 10921 | let output = crate::output::KitchenSinkOperationOutput {
|
10550 10922 | blob: ::std::option::Option::None,
|
10551 10923 | boolean: ::std::option::Option::None,
|
10552 10924 | double: ::std::option::Option::None,
|
10553 10925 | empty_struct: ::std::option::Option::None,
|
10554 10926 | float: ::std::option::Option::None,
|
10555 10927 | httpdate_timestamp: ::std::option::Option::None,
|
10556 10928 | integer: ::std::option::Option::None,
|
10557 10929 | iso8601_timestamp: ::std::option::Option::None,
|
10558 10930 | json_value: ::std::option::Option::None,
|
10559 10931 | list_of_lists: ::std::option::Option::None,
|
10560 10932 | list_of_maps_of_strings: ::std::option::Option::None,
|
10561 10933 | list_of_strings: ::std::option::Option::None,
|
10562 10934 | list_of_structs: ::std::option::Option::None,
|
10563 10935 | long: ::std::option::Option::None,
|
10564 10936 | map_of_lists_of_strings: ::std::option::Option::None,
|
10565 10937 | map_of_maps: ::std::option::Option::None,
|
10566 10938 | map_of_strings: ::std::option::Option::None,
|
10567 10939 | map_of_structs: ::std::option::Option::None,
|
10568 10940 | recursive_list: ::std::option::Option::None,
|
10569 10941 | recursive_map: ::std::option::Option::None,
|
10570 10942 | recursive_struct: ::std::option::Option::None,
|
10571 10943 | simple_struct: ::std::option::Option::None,
|
10572 10944 | string: ::std::option::Option::None,
|
10573 10945 | struct_with_json_name: ::std::option::Option::None,
|
10574 10946 | timestamp: ::std::option::Option::None,
|
10575 10947 | unix_timestamp: ::std::option::Option::None,
|
10576 10948 | };
|
10577 10949 | use ::aws_smithy_http_server::response::IntoResponse;
|
10578 10950 | let http_response = output.into_response();
|
10579 10951 | ::pretty_assertions::assert_eq!(
|
10580 - | http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
|
10952 + | ::http_1x::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
|
10581 10953 | http_response.status()
|
10582 10954 | );
|
10583 10955 | let expected_headers = [("Content-Type", "application/x-amz-json-1.1")];
|
10584 10956 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
|
10585 10957 | http_response.headers(),
|
10586 10958 | expected_headers,
|
10587 10959 | ));
|
10588 - | let body = ::hyper::body::to_bytes(http_response.into_body())
|
10960 + | use ::http_body_util::BodyExt;
|
10961 + | let body = http_response
|
10962 + | .into_body()
|
10963 + | .collect()
|
10589 10964 | .await
|
10590 - | .expect("unable to extract body to bytes");
|
10965 + | .expect("unable to collect body")
|
10966 + | .to_bytes();
|
10591 10967 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
|
10592 10968 | &body,
|
10593 10969 | "{}",
|
10594 10970 | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
10595 10971 | ));
|
10596 10972 | }
|
10597 10973 |
|
10598 10974 | /// Parses string shapes
|
10599 10975 | /// Test ID: parses_string_shapes
|
10600 10976 | #[::tokio::test]
|
10601 10977 | #[::tracing_test::traced_test]
|
10602 10978 | async fn parses_string_shapes_response() {
|
10603 10979 | let output = crate::output::KitchenSinkOperationOutput {
|
10604 10980 | string: ::std::option::Option::Some("string-value".to_owned()),
|
10605 10981 | blob: ::std::option::Option::None,
|
10606 10982 | boolean: ::std::option::Option::None,
|
10607 10983 | double: ::std::option::Option::None,
|
10608 10984 | empty_struct: ::std::option::Option::None,
|
10609 10985 | float: ::std::option::Option::None,
|
10610 10986 | httpdate_timestamp: ::std::option::Option::None,
|
10611 10987 | integer: ::std::option::Option::None,
|
10612 10988 | iso8601_timestamp: ::std::option::Option::None,
|
10613 10989 | json_value: ::std::option::Option::None,
|
10614 10990 | list_of_lists: ::std::option::Option::None,
|
10615 10991 | list_of_maps_of_strings: ::std::option::Option::None,
|
10616 10992 | list_of_strings: ::std::option::Option::None,
|
10617 10993 | list_of_structs: ::std::option::Option::None,
|
10618 10994 | long: ::std::option::Option::None,
|
10619 10995 | map_of_lists_of_strings: ::std::option::Option::None,
|
10620 10996 | map_of_maps: ::std::option::Option::None,
|
10621 10997 | map_of_strings: ::std::option::Option::None,
|
10622 10998 | map_of_structs: ::std::option::Option::None,
|
10623 10999 | recursive_list: ::std::option::Option::None,
|
10624 11000 | recursive_map: ::std::option::Option::None,
|
10625 11001 | recursive_struct: ::std::option::Option::None,
|
10626 11002 | simple_struct: ::std::option::Option::None,
|
10627 11003 | struct_with_json_name: ::std::option::Option::None,
|
10628 11004 | timestamp: ::std::option::Option::None,
|
10629 11005 | unix_timestamp: ::std::option::Option::None,
|
10630 11006 | };
|
10631 11007 | use ::aws_smithy_http_server::response::IntoResponse;
|
10632 11008 | let http_response = output.into_response();
|
10633 11009 | ::pretty_assertions::assert_eq!(
|
10634 - | http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
|
11010 + | ::http_1x::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
|
10635 11011 | http_response.status()
|
10636 11012 | );
|
10637 11013 | let expected_headers = [("Content-Type", "application/x-amz-json-1.1")];
|
10638 11014 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
|
10639 11015 | http_response.headers(),
|
10640 11016 | expected_headers,
|
10641 11017 | ));
|
10642 - | let body = ::hyper::body::to_bytes(http_response.into_body())
|
11018 + | use ::http_body_util::BodyExt;
|
11019 + | let body = http_response
|
11020 + | .into_body()
|
11021 + | .collect()
|
10643 11022 | .await
|
10644 - | .expect("unable to extract body to bytes");
|
11023 + | .expect("unable to collect body")
|
11024 + | .to_bytes();
|
10645 11025 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
|
10646 11026 | &body,
|
10647 11027 | "{\"String\":\"string-value\"}",
|
10648 11028 | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
10649 11029 | ));
|
10650 11030 | }
|
10651 11031 |
|
10652 11032 | /// Parses integer shapes
|
10653 11033 | /// Test ID: parses_integer_shapes
|
10654 11034 | #[::tokio::test]
|
10655 11035 | #[::tracing_test::traced_test]
|
10656 11036 | async fn parses_integer_shapes_response() {
|
10657 11037 | let output = crate::output::KitchenSinkOperationOutput {
|
10658 11038 | integer: ::std::option::Option::Some(1234),
|
10659 11039 | blob: ::std::option::Option::None,
|
10660 11040 | boolean: ::std::option::Option::None,
|
10661 11041 | double: ::std::option::Option::None,
|
10662 11042 | empty_struct: ::std::option::Option::None,
|
10663 11043 | float: ::std::option::Option::None,
|
10664 11044 | httpdate_timestamp: ::std::option::Option::None,
|
10665 11045 | iso8601_timestamp: ::std::option::Option::None,
|
10666 11046 | json_value: ::std::option::Option::None,
|
10667 11047 | list_of_lists: ::std::option::Option::None,
|
10668 11048 | list_of_maps_of_strings: ::std::option::Option::None,
|
10669 11049 | list_of_strings: ::std::option::Option::None,
|
10670 11050 | list_of_structs: ::std::option::Option::None,
|
10671 11051 | long: ::std::option::Option::None,
|
10672 11052 | map_of_lists_of_strings: ::std::option::Option::None,
|
10673 11053 | map_of_maps: ::std::option::Option::None,
|
10674 11054 | map_of_strings: ::std::option::Option::None,
|
10675 11055 | map_of_structs: ::std::option::Option::None,
|
10676 11056 | recursive_list: ::std::option::Option::None,
|
10677 11057 | recursive_map: ::std::option::Option::None,
|
10678 11058 | recursive_struct: ::std::option::Option::None,
|
10679 11059 | simple_struct: ::std::option::Option::None,
|
10680 11060 | string: ::std::option::Option::None,
|
10681 11061 | struct_with_json_name: ::std::option::Option::None,
|
10682 11062 | timestamp: ::std::option::Option::None,
|
10683 11063 | unix_timestamp: ::std::option::Option::None,
|
10684 11064 | };
|
10685 11065 | use ::aws_smithy_http_server::response::IntoResponse;
|
10686 11066 | let http_response = output.into_response();
|
10687 11067 | ::pretty_assertions::assert_eq!(
|
10688 - | http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
|
11068 + | ::http_1x::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
|
10689 11069 | http_response.status()
|
10690 11070 | );
|
10691 11071 | let expected_headers = [("Content-Type", "application/x-amz-json-1.1")];
|
10692 11072 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
|
10693 11073 | http_response.headers(),
|
10694 11074 | expected_headers,
|
10695 11075 | ));
|
10696 - | let body = ::hyper::body::to_bytes(http_response.into_body())
|
11076 + | use ::http_body_util::BodyExt;
|
11077 + | let body = http_response
|
11078 + | .into_body()
|
11079 + | .collect()
|
10697 11080 | .await
|
10698 - | .expect("unable to extract body to bytes");
|
11081 + | .expect("unable to collect body")
|
11082 + | .to_bytes();
|
10699 11083 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
|
10700 11084 | &body,
|
10701 11085 | "{\"Integer\":1234}",
|
10702 11086 | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
10703 11087 | ));
|
10704 11088 | }
|
10705 11089 |
|
10706 11090 | /// Parses long shapes
|
10707 11091 | /// Test ID: parses_long_shapes
|
10708 11092 | #[::tokio::test]
|
10709 11093 | #[::tracing_test::traced_test]
|
10710 11094 | async fn parses_long_shapes_response() {
|
10711 11095 | let output = crate::output::KitchenSinkOperationOutput {
|
10712 11096 | long: ::std::option::Option::Some(1234567890123456789),
|
10713 11097 | blob: ::std::option::Option::None,
|
10714 11098 | boolean: ::std::option::Option::None,
|
10715 11099 | double: ::std::option::Option::None,
|
10716 11100 | empty_struct: ::std::option::Option::None,
|
10717 11101 | float: ::std::option::Option::None,
|
10718 11102 | httpdate_timestamp: ::std::option::Option::None,
|
10719 11103 | integer: ::std::option::Option::None,
|
10720 11104 | iso8601_timestamp: ::std::option::Option::None,
|
10721 11105 | json_value: ::std::option::Option::None,
|
10722 11106 | list_of_lists: ::std::option::Option::None,
|
10723 11107 | list_of_maps_of_strings: ::std::option::Option::None,
|
10724 11108 | list_of_strings: ::std::option::Option::None,
|
10725 11109 | list_of_structs: ::std::option::Option::None,
|
10726 11110 | map_of_lists_of_strings: ::std::option::Option::None,
|
10727 11111 | map_of_maps: ::std::option::Option::None,
|
10728 11112 | map_of_strings: ::std::option::Option::None,
|
10729 11113 | map_of_structs: ::std::option::Option::None,
|
10730 11114 | recursive_list: ::std::option::Option::None,
|
10731 11115 | recursive_map: ::std::option::Option::None,
|
10732 11116 | recursive_struct: ::std::option::Option::None,
|
10733 11117 | simple_struct: ::std::option::Option::None,
|
10734 11118 | string: ::std::option::Option::None,
|
10735 11119 | struct_with_json_name: ::std::option::Option::None,
|
10736 11120 | timestamp: ::std::option::Option::None,
|
10737 11121 | unix_timestamp: ::std::option::Option::None,
|
10738 11122 | };
|
10739 11123 | use ::aws_smithy_http_server::response::IntoResponse;
|
10740 11124 | let http_response = output.into_response();
|
10741 11125 | ::pretty_assertions::assert_eq!(
|
10742 - | http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
|
11126 + | ::http_1x::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
|
10743 11127 | http_response.status()
|
10744 11128 | );
|
10745 11129 | let expected_headers = [("Content-Type", "application/x-amz-json-1.1")];
|
10746 11130 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
|
10747 11131 | http_response.headers(),
|
10748 11132 | expected_headers,
|
10749 11133 | ));
|
10750 - | let body = ::hyper::body::to_bytes(http_response.into_body())
|
11134 + | use ::http_body_util::BodyExt;
|
11135 + | let body = http_response
|
11136 + | .into_body()
|
11137 + | .collect()
|
10751 11138 | .await
|
10752 - | .expect("unable to extract body to bytes");
|
11139 + | .expect("unable to collect body")
|
11140 + | .to_bytes();
|
10753 11141 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
|
10754 11142 | &body,
|
10755 11143 | "{\"Long\":1234567890123456789}",
|
10756 11144 | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
10757 11145 | ));
|
10758 11146 | }
|
10759 11147 |
|
10760 11148 | /// Parses float shapes
|
10761 11149 | /// Test ID: parses_float_shapes
|
10762 11150 | #[::tokio::test]
|
10763 11151 | #[::tracing_test::traced_test]
|
10764 11152 | async fn parses_float_shapes_response() {
|
10765 11153 | let output = crate::output::KitchenSinkOperationOutput {
|
10766 11154 | float: ::std::option::Option::Some(1234.5_f32),
|
10767 11155 | blob: ::std::option::Option::None,
|
10768 11156 | boolean: ::std::option::Option::None,
|
10769 11157 | double: ::std::option::Option::None,
|
10770 11158 | empty_struct: ::std::option::Option::None,
|
10771 11159 | httpdate_timestamp: ::std::option::Option::None,
|
10772 11160 | integer: ::std::option::Option::None,
|
10773 11161 | iso8601_timestamp: ::std::option::Option::None,
|
10774 11162 | json_value: ::std::option::Option::None,
|
10775 11163 | list_of_lists: ::std::option::Option::None,
|
10776 11164 | list_of_maps_of_strings: ::std::option::Option::None,
|
10777 11165 | list_of_strings: ::std::option::Option::None,
|
10778 11166 | list_of_structs: ::std::option::Option::None,
|
10779 11167 | long: ::std::option::Option::None,
|
10780 11168 | map_of_lists_of_strings: ::std::option::Option::None,
|
10781 11169 | map_of_maps: ::std::option::Option::None,
|
10782 11170 | map_of_strings: ::std::option::Option::None,
|
10783 11171 | map_of_structs: ::std::option::Option::None,
|
10784 11172 | recursive_list: ::std::option::Option::None,
|
10785 11173 | recursive_map: ::std::option::Option::None,
|
10786 11174 | recursive_struct: ::std::option::Option::None,
|
10787 11175 | simple_struct: ::std::option::Option::None,
|
10788 11176 | string: ::std::option::Option::None,
|
10789 11177 | struct_with_json_name: ::std::option::Option::None,
|
10790 11178 | timestamp: ::std::option::Option::None,
|
10791 11179 | unix_timestamp: ::std::option::Option::None,
|
10792 11180 | };
|
10793 11181 | use ::aws_smithy_http_server::response::IntoResponse;
|
10794 11182 | let http_response = output.into_response();
|
10795 11183 | ::pretty_assertions::assert_eq!(
|
10796 - | http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
|
11184 + | ::http_1x::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
|
10797 11185 | http_response.status()
|
10798 11186 | );
|
10799 11187 | let expected_headers = [("Content-Type", "application/x-amz-json-1.1")];
|
10800 11188 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
|
10801 11189 | http_response.headers(),
|
10802 11190 | expected_headers,
|
10803 11191 | ));
|
10804 - | let body = ::hyper::body::to_bytes(http_response.into_body())
|
11192 + | use ::http_body_util::BodyExt;
|
11193 + | let body = http_response
|
11194 + | .into_body()
|
11195 + | .collect()
|
10805 11196 | .await
|
10806 - | .expect("unable to extract body to bytes");
|
11197 + | .expect("unable to collect body")
|
11198 + | .to_bytes();
|
10807 11199 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
|
10808 11200 | &body,
|
10809 11201 | "{\"Float\":1234.5}",
|
10810 11202 | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
10811 11203 | ));
|
10812 11204 | }
|
10813 11205 |
|
10814 11206 | /// Parses double shapes
|
10815 11207 | /// Test ID: parses_double_shapes
|
10816 11208 | #[::tokio::test]
|
10817 11209 | #[::tracing_test::traced_test]
|
10818 11210 | async fn parses_double_shapes_response() {
|
10819 11211 | let output = crate::output::KitchenSinkOperationOutput {
|
10820 11212 | double: ::std::option::Option::Some(1.2345678912345679E8_f64),
|
10821 11213 | blob: ::std::option::Option::None,
|
10822 11214 | boolean: ::std::option::Option::None,
|
10823 11215 | empty_struct: ::std::option::Option::None,
|
10824 11216 | float: ::std::option::Option::None,
|
10825 11217 | httpdate_timestamp: ::std::option::Option::None,
|
10826 11218 | integer: ::std::option::Option::None,
|
10827 11219 | iso8601_timestamp: ::std::option::Option::None,
|
10828 11220 | json_value: ::std::option::Option::None,
|
10829 11221 | list_of_lists: ::std::option::Option::None,
|
10830 11222 | list_of_maps_of_strings: ::std::option::Option::None,
|
10831 11223 | list_of_strings: ::std::option::Option::None,
|
10832 11224 | list_of_structs: ::std::option::Option::None,
|
10833 11225 | long: ::std::option::Option::None,
|
10834 11226 | map_of_lists_of_strings: ::std::option::Option::None,
|
10835 11227 | map_of_maps: ::std::option::Option::None,
|
10836 11228 | map_of_strings: ::std::option::Option::None,
|
10837 11229 | map_of_structs: ::std::option::Option::None,
|
10838 11230 | recursive_list: ::std::option::Option::None,
|
10839 11231 | recursive_map: ::std::option::Option::None,
|
10840 11232 | recursive_struct: ::std::option::Option::None,
|
10841 11233 | simple_struct: ::std::option::Option::None,
|
10842 11234 | string: ::std::option::Option::None,
|
10843 11235 | struct_with_json_name: ::std::option::Option::None,
|
10844 11236 | timestamp: ::std::option::Option::None,
|
10845 11237 | unix_timestamp: ::std::option::Option::None,
|
10846 11238 | };
|
10847 11239 | use ::aws_smithy_http_server::response::IntoResponse;
|
10848 11240 | let http_response = output.into_response();
|
10849 11241 | ::pretty_assertions::assert_eq!(
|
10850 - | http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
|
11242 + | ::http_1x::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
|
10851 11243 | http_response.status()
|
10852 11244 | );
|
10853 11245 | let expected_headers = [("Content-Type", "application/x-amz-json-1.1")];
|
10854 11246 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
|
10855 11247 | http_response.headers(),
|
10856 11248 | expected_headers,
|
10857 11249 | ));
|
10858 - | let body = ::hyper::body::to_bytes(http_response.into_body())
|
11250 + | use ::http_body_util::BodyExt;
|
11251 + | let body = http_response
|
11252 + | .into_body()
|
11253 + | .collect()
|
10859 11254 | .await
|
10860 - | .expect("unable to extract body to bytes");
|
11255 + | .expect("unable to collect body")
|
11256 + | .to_bytes();
|
10861 11257 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
|
10862 11258 | &body,
|
10863 11259 | "{\"Double\":123456789.12345679}",
|
10864 11260 | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
10865 11261 | ));
|
10866 11262 | }
|
10867 11263 |
|
10868 11264 | /// Parses boolean shapes (true)
|
10869 11265 | /// Test ID: parses_boolean_shapes_true
|
10870 11266 | #[::tokio::test]
|
10871 11267 | #[::tracing_test::traced_test]
|
10872 11268 | async fn parses_boolean_shapes_true_response() {
|
10873 11269 | let output = crate::output::KitchenSinkOperationOutput {
|
10874 11270 | boolean: ::std::option::Option::Some(true),
|
10875 11271 | blob: ::std::option::Option::None,
|
10876 11272 | double: ::std::option::Option::None,
|
10877 11273 | empty_struct: ::std::option::Option::None,
|
10878 11274 | float: ::std::option::Option::None,
|
10879 11275 | httpdate_timestamp: ::std::option::Option::None,
|
10880 11276 | integer: ::std::option::Option::None,
|
10881 11277 | iso8601_timestamp: ::std::option::Option::None,
|
10882 11278 | json_value: ::std::option::Option::None,
|
10883 11279 | list_of_lists: ::std::option::Option::None,
|
10884 11280 | list_of_maps_of_strings: ::std::option::Option::None,
|
10885 11281 | list_of_strings: ::std::option::Option::None,
|
10886 11282 | list_of_structs: ::std::option::Option::None,
|
10887 11283 | long: ::std::option::Option::None,
|
10888 11284 | map_of_lists_of_strings: ::std::option::Option::None,
|
10889 11285 | map_of_maps: ::std::option::Option::None,
|
10890 11286 | map_of_strings: ::std::option::Option::None,
|
10891 11287 | map_of_structs: ::std::option::Option::None,
|
10892 11288 | recursive_list: ::std::option::Option::None,
|
10893 11289 | recursive_map: ::std::option::Option::None,
|
10894 11290 | recursive_struct: ::std::option::Option::None,
|
10895 11291 | simple_struct: ::std::option::Option::None,
|
10896 11292 | string: ::std::option::Option::None,
|
10897 11293 | struct_with_json_name: ::std::option::Option::None,
|
10898 11294 | timestamp: ::std::option::Option::None,
|
10899 11295 | unix_timestamp: ::std::option::Option::None,
|
10900 11296 | };
|
10901 11297 | use ::aws_smithy_http_server::response::IntoResponse;
|
10902 11298 | let http_response = output.into_response();
|
10903 11299 | ::pretty_assertions::assert_eq!(
|
10904 - | http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
|
11300 + | ::http_1x::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
|
10905 11301 | http_response.status()
|
10906 11302 | );
|
10907 11303 | let expected_headers = [("Content-Type", "application/x-amz-json-1.1")];
|
10908 11304 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
|
10909 11305 | http_response.headers(),
|
10910 11306 | expected_headers,
|
10911 11307 | ));
|
10912 - | let body = ::hyper::body::to_bytes(http_response.into_body())
|
11308 + | use ::http_body_util::BodyExt;
|
11309 + | let body = http_response
|
11310 + | .into_body()
|
11311 + | .collect()
|
10913 11312 | .await
|
10914 - | .expect("unable to extract body to bytes");
|
11313 + | .expect("unable to collect body")
|
11314 + | .to_bytes();
|
10915 11315 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
|
10916 11316 | &body,
|
10917 11317 | "{\"Boolean\":true}",
|
10918 11318 | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
10919 11319 | ));
|
10920 11320 | }
|
10921 11321 |
|
10922 11322 | /// Parses boolean (false)
|
10923 11323 | /// Test ID: parses_boolean_false
|
10924 11324 | #[::tokio::test]
|
10925 11325 | #[::tracing_test::traced_test]
|
10926 11326 | async fn parses_boolean_false_response() {
|
10927 11327 | let output = crate::output::KitchenSinkOperationOutput {
|
10928 11328 | boolean: ::std::option::Option::Some(false),
|
10929 11329 | blob: ::std::option::Option::None,
|
10930 11330 | double: ::std::option::Option::None,
|
10931 11331 | empty_struct: ::std::option::Option::None,
|
10932 11332 | float: ::std::option::Option::None,
|
10933 11333 | httpdate_timestamp: ::std::option::Option::None,
|
10934 11334 | integer: ::std::option::Option::None,
|
10935 11335 | iso8601_timestamp: ::std::option::Option::None,
|
10936 11336 | json_value: ::std::option::Option::None,
|
10937 11337 | list_of_lists: ::std::option::Option::None,
|
10938 11338 | list_of_maps_of_strings: ::std::option::Option::None,
|
10939 11339 | list_of_strings: ::std::option::Option::None,
|
10940 11340 | list_of_structs: ::std::option::Option::None,
|
10941 11341 | long: ::std::option::Option::None,
|
10942 11342 | map_of_lists_of_strings: ::std::option::Option::None,
|
10943 11343 | map_of_maps: ::std::option::Option::None,
|
10944 11344 | map_of_strings: ::std::option::Option::None,
|
10945 11345 | map_of_structs: ::std::option::Option::None,
|
10946 11346 | recursive_list: ::std::option::Option::None,
|
10947 11347 | recursive_map: ::std::option::Option::None,
|
10948 11348 | recursive_struct: ::std::option::Option::None,
|
10949 11349 | simple_struct: ::std::option::Option::None,
|
10950 11350 | string: ::std::option::Option::None,
|
10951 11351 | struct_with_json_name: ::std::option::Option::None,
|
10952 11352 | timestamp: ::std::option::Option::None,
|
10953 11353 | unix_timestamp: ::std::option::Option::None,
|
10954 11354 | };
|
10955 11355 | use ::aws_smithy_http_server::response::IntoResponse;
|
10956 11356 | let http_response = output.into_response();
|
10957 11357 | ::pretty_assertions::assert_eq!(
|
10958 - | http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
|
11358 + | ::http_1x::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
|
10959 11359 | http_response.status()
|
10960 11360 | );
|
10961 11361 | let expected_headers = [("Content-Type", "application/x-amz-json-1.1")];
|
10962 11362 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
|
10963 11363 | http_response.headers(),
|
10964 11364 | expected_headers,
|
10965 11365 | ));
|
10966 - | let body = ::hyper::body::to_bytes(http_response.into_body())
|
11366 + | use ::http_body_util::BodyExt;
|
11367 + | let body = http_response
|
11368 + | .into_body()
|
11369 + | .collect()
|
10967 11370 | .await
|
10968 - | .expect("unable to extract body to bytes");
|
11371 + | .expect("unable to collect body")
|
11372 + | .to_bytes();
|
10969 11373 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
|
10970 11374 | &body,
|
10971 11375 | "{\"Boolean\":false}",
|
10972 11376 | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
10973 11377 | ));
|
10974 11378 | }
|
10975 11379 |
|
10976 11380 | /// Parses blob shapes
|
10977 11381 | /// Test ID: parses_blob_shapes
|
10978 11382 | #[::tokio::test]
|
10979 11383 | #[::tracing_test::traced_test]
|
10980 11384 | async fn parses_blob_shapes_response() {
|
10981 11385 | let output = crate::output::KitchenSinkOperationOutput {
|
10982 11386 | blob: ::std::option::Option::Some(::aws_smithy_types::Blob::new("binary-value")),
|
10983 11387 | boolean: ::std::option::Option::None,
|
10984 11388 | double: ::std::option::Option::None,
|
10985 11389 | empty_struct: ::std::option::Option::None,
|
10986 11390 | float: ::std::option::Option::None,
|
10987 11391 | httpdate_timestamp: ::std::option::Option::None,
|
10988 11392 | integer: ::std::option::Option::None,
|
10989 11393 | iso8601_timestamp: ::std::option::Option::None,
|
10990 11394 | json_value: ::std::option::Option::None,
|
10991 11395 | list_of_lists: ::std::option::Option::None,
|
10992 11396 | list_of_maps_of_strings: ::std::option::Option::None,
|
10993 11397 | list_of_strings: ::std::option::Option::None,
|
10994 11398 | list_of_structs: ::std::option::Option::None,
|
10995 11399 | long: ::std::option::Option::None,
|
10996 11400 | map_of_lists_of_strings: ::std::option::Option::None,
|
10997 11401 | map_of_maps: ::std::option::Option::None,
|
10998 11402 | map_of_strings: ::std::option::Option::None,
|
10999 11403 | map_of_structs: ::std::option::Option::None,
|
11000 11404 | recursive_list: ::std::option::Option::None,
|
11001 11405 | recursive_map: ::std::option::Option::None,
|
11002 11406 | recursive_struct: ::std::option::Option::None,
|
11003 11407 | simple_struct: ::std::option::Option::None,
|
11004 11408 | string: ::std::option::Option::None,
|
11005 11409 | struct_with_json_name: ::std::option::Option::None,
|
11006 11410 | timestamp: ::std::option::Option::None,
|
11007 11411 | unix_timestamp: ::std::option::Option::None,
|
11008 11412 | };
|
11009 11413 | use ::aws_smithy_http_server::response::IntoResponse;
|
11010 11414 | let http_response = output.into_response();
|
11011 11415 | ::pretty_assertions::assert_eq!(
|
11012 - | http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
|
11416 + | ::http_1x::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
|
11013 11417 | http_response.status()
|
11014 11418 | );
|
11015 11419 | let expected_headers = [("Content-Type", "application/x-amz-json-1.1")];
|
11016 11420 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
|
11017 11421 | http_response.headers(),
|
11018 11422 | expected_headers,
|
11019 11423 | ));
|
11020 - | let body = ::hyper::body::to_bytes(http_response.into_body())
|
11424 + | use ::http_body_util::BodyExt;
|
11425 + | let body = http_response
|
11426 + | .into_body()
|
11427 + | .collect()
|
11021 11428 | .await
|
11022 - | .expect("unable to extract body to bytes");
|
11429 + | .expect("unable to collect body")
|
11430 + | .to_bytes();
|
11023 11431 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
|
11024 11432 | &body,
|
11025 11433 | "{\"Blob\":\"YmluYXJ5LXZhbHVl\"}",
|
11026 11434 | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
11027 11435 | ));
|
11028 11436 | }
|
11029 11437 |
|
11030 11438 | /// Parses timestamp shapes
|
11031 11439 | /// Test ID: parses_timestamp_shapes
|
11032 11440 | #[::tokio::test]
|
11033 11441 | #[::tracing_test::traced_test]
|
11034 11442 | async fn parses_timestamp_shapes_response() {
|
11035 11443 | let output = crate::output::KitchenSinkOperationOutput {
|
11036 11444 | timestamp: ::std::option::Option::Some(
|
11037 11445 | ::aws_smithy_types::DateTime::from_fractional_secs(946845296, 0_f64),
|
11038 11446 | ),
|
11039 11447 | blob: ::std::option::Option::None,
|
11040 11448 | boolean: ::std::option::Option::None,
|
11041 11449 | double: ::std::option::Option::None,
|
11042 11450 | empty_struct: ::std::option::Option::None,
|
11043 11451 | float: ::std::option::Option::None,
|
11044 11452 | httpdate_timestamp: ::std::option::Option::None,
|
11045 11453 | integer: ::std::option::Option::None,
|
11046 11454 | iso8601_timestamp: ::std::option::Option::None,
|
11047 11455 | json_value: ::std::option::Option::None,
|
11048 11456 | list_of_lists: ::std::option::Option::None,
|
11049 11457 | list_of_maps_of_strings: ::std::option::Option::None,
|
11050 11458 | list_of_strings: ::std::option::Option::None,
|
11051 11459 | list_of_structs: ::std::option::Option::None,
|
11052 11460 | long: ::std::option::Option::None,
|
11053 11461 | map_of_lists_of_strings: ::std::option::Option::None,
|
11054 11462 | map_of_maps: ::std::option::Option::None,
|
11055 11463 | map_of_strings: ::std::option::Option::None,
|
11056 11464 | map_of_structs: ::std::option::Option::None,
|
11057 11465 | recursive_list: ::std::option::Option::None,
|
11058 11466 | recursive_map: ::std::option::Option::None,
|
11059 11467 | recursive_struct: ::std::option::Option::None,
|
11060 11468 | simple_struct: ::std::option::Option::None,
|
11061 11469 | string: ::std::option::Option::None,
|
11062 11470 | struct_with_json_name: ::std::option::Option::None,
|
11063 11471 | unix_timestamp: ::std::option::Option::None,
|
11064 11472 | };
|
11065 11473 | use ::aws_smithy_http_server::response::IntoResponse;
|
11066 11474 | let http_response = output.into_response();
|
11067 11475 | ::pretty_assertions::assert_eq!(
|
11068 - | http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
|
11476 + | ::http_1x::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
|
11069 11477 | http_response.status()
|
11070 11478 | );
|
11071 11479 | let expected_headers = [("Content-Type", "application/x-amz-json-1.1")];
|
11072 11480 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
|
11073 11481 | http_response.headers(),
|
11074 11482 | expected_headers,
|
11075 11483 | ));
|
11076 - | let body = ::hyper::body::to_bytes(http_response.into_body())
|
11484 + | use ::http_body_util::BodyExt;
|
11485 + | let body = http_response
|
11486 + | .into_body()
|
11487 + | .collect()
|
11077 11488 | .await
|
11078 - | .expect("unable to extract body to bytes");
|
11489 + | .expect("unable to collect body")
|
11490 + | .to_bytes();
|
11079 11491 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
|
11080 11492 | &body,
|
11081 11493 | "{\"Timestamp\":946845296}",
|
11082 11494 | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
11083 11495 | ));
|
11084 11496 | }
|
11085 11497 |
|
11086 11498 | /// Parses iso8601 timestamps
|
11087 11499 | /// Test ID: parses_iso8601_timestamps
|
11088 11500 | #[::tokio::test]
|
11089 11501 | #[::tracing_test::traced_test]
|
11090 11502 | async fn parses_iso8601_timestamps_response() {
|
11091 11503 | let output = crate::output::KitchenSinkOperationOutput {
|
11092 11504 | iso8601_timestamp: ::std::option::Option::Some(
|
11093 11505 | ::aws_smithy_types::DateTime::from_fractional_secs(946845296, 0_f64),
|
11094 11506 | ),
|
11095 11507 | blob: ::std::option::Option::None,
|
11096 11508 | boolean: ::std::option::Option::None,
|
11097 11509 | double: ::std::option::Option::None,
|
11098 11510 | empty_struct: ::std::option::Option::None,
|
11099 11511 | float: ::std::option::Option::None,
|
11100 11512 | httpdate_timestamp: ::std::option::Option::None,
|
11101 11513 | integer: ::std::option::Option::None,
|
11102 11514 | json_value: ::std::option::Option::None,
|
11103 11515 | list_of_lists: ::std::option::Option::None,
|
11104 11516 | list_of_maps_of_strings: ::std::option::Option::None,
|
11105 11517 | list_of_strings: ::std::option::Option::None,
|
11106 11518 | list_of_structs: ::std::option::Option::None,
|
11107 11519 | long: ::std::option::Option::None,
|
11108 11520 | map_of_lists_of_strings: ::std::option::Option::None,
|
11109 11521 | map_of_maps: ::std::option::Option::None,
|
11110 11522 | map_of_strings: ::std::option::Option::None,
|
11111 11523 | map_of_structs: ::std::option::Option::None,
|
11112 11524 | recursive_list: ::std::option::Option::None,
|
11113 11525 | recursive_map: ::std::option::Option::None,
|
11114 11526 | recursive_struct: ::std::option::Option::None,
|
11115 11527 | simple_struct: ::std::option::Option::None,
|
11116 11528 | string: ::std::option::Option::None,
|
11117 11529 | struct_with_json_name: ::std::option::Option::None,
|
11118 11530 | timestamp: ::std::option::Option::None,
|
11119 11531 | unix_timestamp: ::std::option::Option::None,
|
11120 11532 | };
|
11121 11533 | use ::aws_smithy_http_server::response::IntoResponse;
|
11122 11534 | let http_response = output.into_response();
|
11123 11535 | ::pretty_assertions::assert_eq!(
|
11124 - | http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
|
11536 + | ::http_1x::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
|
11125 11537 | http_response.status()
|
11126 11538 | );
|
11127 11539 | let expected_headers = [("Content-Type", "application/x-amz-json-1.1")];
|
11128 11540 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
|
11129 11541 | http_response.headers(),
|
11130 11542 | expected_headers,
|
11131 11543 | ));
|
11132 - | let body = ::hyper::body::to_bytes(http_response.into_body())
|
11544 + | use ::http_body_util::BodyExt;
|
11545 + | let body = http_response
|
11546 + | .into_body()
|
11547 + | .collect()
|
11133 11548 | .await
|
11134 - | .expect("unable to extract body to bytes");
|
11549 + | .expect("unable to collect body")
|
11550 + | .to_bytes();
|
11135 11551 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
|
11136 11552 | &body,
|
11137 11553 | "{\"Iso8601Timestamp\":\"2000-01-02T20:34:56Z\"}",
|
11138 11554 | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
11139 11555 | ));
|
11140 11556 | }
|
11141 11557 |
|
11142 11558 | /// Parses httpdate timestamps
|
11143 11559 | /// Test ID: parses_httpdate_timestamps
|
11144 11560 | #[::tokio::test]
|
11145 11561 | #[::tracing_test::traced_test]
|
11146 11562 | async fn parses_httpdate_timestamps_response() {
|
11147 11563 | let output = crate::output::KitchenSinkOperationOutput {
|
11148 11564 | httpdate_timestamp: ::std::option::Option::Some(
|
11149 11565 | ::aws_smithy_types::DateTime::from_fractional_secs(946845296, 0_f64),
|
11150 11566 | ),
|
11151 11567 | blob: ::std::option::Option::None,
|
11152 11568 | boolean: ::std::option::Option::None,
|
11153 11569 | double: ::std::option::Option::None,
|
11154 11570 | empty_struct: ::std::option::Option::None,
|
11155 11571 | float: ::std::option::Option::None,
|
11156 11572 | integer: ::std::option::Option::None,
|
11157 11573 | iso8601_timestamp: ::std::option::Option::None,
|
11158 11574 | json_value: ::std::option::Option::None,
|
11159 11575 | list_of_lists: ::std::option::Option::None,
|
11160 11576 | list_of_maps_of_strings: ::std::option::Option::None,
|
11161 11577 | list_of_strings: ::std::option::Option::None,
|
11162 11578 | list_of_structs: ::std::option::Option::None,
|
11163 11579 | long: ::std::option::Option::None,
|
11164 11580 | map_of_lists_of_strings: ::std::option::Option::None,
|
11165 11581 | map_of_maps: ::std::option::Option::None,
|
11166 11582 | map_of_strings: ::std::option::Option::None,
|
11167 11583 | map_of_structs: ::std::option::Option::None,
|
11168 11584 | recursive_list: ::std::option::Option::None,
|
11169 11585 | recursive_map: ::std::option::Option::None,
|
11170 11586 | recursive_struct: ::std::option::Option::None,
|
11171 11587 | simple_struct: ::std::option::Option::None,
|
11172 11588 | string: ::std::option::Option::None,
|
11173 11589 | struct_with_json_name: ::std::option::Option::None,
|
11174 11590 | timestamp: ::std::option::Option::None,
|
11175 11591 | unix_timestamp: ::std::option::Option::None,
|
11176 11592 | };
|
11177 11593 | use ::aws_smithy_http_server::response::IntoResponse;
|
11178 11594 | let http_response = output.into_response();
|
11179 11595 | ::pretty_assertions::assert_eq!(
|
11180 - | http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
|
11596 + | ::http_1x::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
|
11181 11597 | http_response.status()
|
11182 11598 | );
|
11183 11599 | let expected_headers = [("Content-Type", "application/x-amz-json-1.1")];
|
11184 11600 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
|
11185 11601 | http_response.headers(),
|
11186 11602 | expected_headers,
|
11187 11603 | ));
|
11188 - | let body = ::hyper::body::to_bytes(http_response.into_body())
|
11604 + | use ::http_body_util::BodyExt;
|
11605 + | let body = http_response
|
11606 + | .into_body()
|
11607 + | .collect()
|
11189 11608 | .await
|
11190 - | .expect("unable to extract body to bytes");
|
11609 + | .expect("unable to collect body")
|
11610 + | .to_bytes();
|
11191 11611 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
|
11192 11612 | &body,
|
11193 11613 | "{\"HttpdateTimestamp\":\"Sun, 02 Jan 2000 20:34:56 GMT\"}",
|
11194 11614 | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
11195 11615 | ));
|
11196 11616 | }
|
11197 11617 |
|
11198 11618 | /// Parses list shapes
|
11199 11619 | /// Test ID: parses_list_shapes
|
11200 11620 | #[::tokio::test]
|
11201 11621 | #[::tracing_test::traced_test]
|
11202 11622 | async fn parses_list_shapes_response() {
|
11203 11623 | let output = crate::output::KitchenSinkOperationOutput {
|
11204 11624 | list_of_strings: ::std::option::Option::Some(vec![
|
11205 11625 | "abc".to_owned(),
|
11206 11626 | "mno".to_owned(),
|
11207 11627 | "xyz".to_owned(),
|
11208 11628 | ]),
|
11209 11629 | blob: ::std::option::Option::None,
|
11210 11630 | boolean: ::std::option::Option::None,
|
11211 11631 | double: ::std::option::Option::None,
|
11212 11632 | empty_struct: ::std::option::Option::None,
|
11213 11633 | float: ::std::option::Option::None,
|
11214 11634 | httpdate_timestamp: ::std::option::Option::None,
|
11215 11635 | integer: ::std::option::Option::None,
|
11216 11636 | iso8601_timestamp: ::std::option::Option::None,
|
11217 11637 | json_value: ::std::option::Option::None,
|
11218 11638 | list_of_lists: ::std::option::Option::None,
|
11219 11639 | list_of_maps_of_strings: ::std::option::Option::None,
|
11220 11640 | list_of_structs: ::std::option::Option::None,
|
11221 11641 | long: ::std::option::Option::None,
|
11222 11642 | map_of_lists_of_strings: ::std::option::Option::None,
|
11223 11643 | map_of_maps: ::std::option::Option::None,
|
11224 11644 | map_of_strings: ::std::option::Option::None,
|
11225 11645 | map_of_structs: ::std::option::Option::None,
|
11226 11646 | recursive_list: ::std::option::Option::None,
|
11227 11647 | recursive_map: ::std::option::Option::None,
|
11228 11648 | recursive_struct: ::std::option::Option::None,
|
11229 11649 | simple_struct: ::std::option::Option::None,
|
11230 11650 | string: ::std::option::Option::None,
|
11231 11651 | struct_with_json_name: ::std::option::Option::None,
|
11232 11652 | timestamp: ::std::option::Option::None,
|
11233 11653 | unix_timestamp: ::std::option::Option::None,
|
11234 11654 | };
|
11235 11655 | use ::aws_smithy_http_server::response::IntoResponse;
|
11236 11656 | let http_response = output.into_response();
|
11237 11657 | ::pretty_assertions::assert_eq!(
|
11238 - | http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
|
11658 + | ::http_1x::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
|
11239 11659 | http_response.status()
|
11240 11660 | );
|
11241 11661 | let expected_headers = [("Content-Type", "application/x-amz-json-1.1")];
|
11242 11662 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
|
11243 11663 | http_response.headers(),
|
11244 11664 | expected_headers,
|
11245 11665 | ));
|
11246 - | let body = ::hyper::body::to_bytes(http_response.into_body())
|
11666 + | use ::http_body_util::BodyExt;
|
11667 + | let body = http_response
|
11668 + | .into_body()
|
11669 + | .collect()
|
11247 11670 | .await
|
11248 - | .expect("unable to extract body to bytes");
|
11671 + | .expect("unable to collect body")
|
11672 + | .to_bytes();
|
11249 11673 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
|
11250 11674 | &body,
|
11251 11675 | "{\"ListOfStrings\":[\"abc\",\"mno\",\"xyz\"]}",
|
11252 11676 | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
11253 11677 | ));
|
11254 11678 | }
|
11255 11679 |
|
11256 11680 | /// Parses list of map shapes
|
11257 11681 | /// Test ID: parses_list_of_map_shapes
|
11258 11682 | #[::tokio::test]
|
11259 11683 | #[::tracing_test::traced_test]
|
11260 11684 | async fn parses_list_of_map_shapes_response() {
|
11261 11685 | let output = crate::output::KitchenSinkOperationOutput {
|
11262 11686 | list_of_maps_of_strings: ::std::option::Option::Some(vec![
|
11263 11687 | {
|
11264 11688 | let mut ret = ::std::collections::HashMap::new();
|
11265 11689 | ret.insert("size".to_owned(), "large".to_owned());
|
11266 11690 | ret
|
11267 11691 | },
|
11268 11692 | {
|
11269 11693 | let mut ret = ::std::collections::HashMap::new();
|
11270 11694 | ret.insert("color".to_owned(), "red".to_owned());
|
11271 11695 | ret
|
11272 11696 | },
|
11273 11697 | ]),
|
11274 11698 | blob: ::std::option::Option::None,
|
11275 11699 | boolean: ::std::option::Option::None,
|
11276 11700 | double: ::std::option::Option::None,
|
11277 11701 | empty_struct: ::std::option::Option::None,
|
11278 11702 | float: ::std::option::Option::None,
|
11279 11703 | httpdate_timestamp: ::std::option::Option::None,
|
11280 11704 | integer: ::std::option::Option::None,
|
11281 11705 | iso8601_timestamp: ::std::option::Option::None,
|
11282 11706 | json_value: ::std::option::Option::None,
|
11283 11707 | list_of_lists: ::std::option::Option::None,
|
11284 11708 | list_of_strings: ::std::option::Option::None,
|
11285 11709 | list_of_structs: ::std::option::Option::None,
|
11286 11710 | long: ::std::option::Option::None,
|
11287 11711 | map_of_lists_of_strings: ::std::option::Option::None,
|
11288 11712 | map_of_maps: ::std::option::Option::None,
|
11289 11713 | map_of_strings: ::std::option::Option::None,
|
11290 11714 | map_of_structs: ::std::option::Option::None,
|
11291 11715 | recursive_list: ::std::option::Option::None,
|
11292 11716 | recursive_map: ::std::option::Option::None,
|
11293 11717 | recursive_struct: ::std::option::Option::None,
|
11294 11718 | simple_struct: ::std::option::Option::None,
|
11295 11719 | string: ::std::option::Option::None,
|
11296 11720 | struct_with_json_name: ::std::option::Option::None,
|
11297 11721 | timestamp: ::std::option::Option::None,
|
11298 11722 | unix_timestamp: ::std::option::Option::None,
|
11299 11723 | };
|
11300 11724 | use ::aws_smithy_http_server::response::IntoResponse;
|
11301 11725 | let http_response = output.into_response();
|
11302 11726 | ::pretty_assertions::assert_eq!(
|
11303 - | http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
|
11727 + | ::http_1x::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
|
11304 11728 | http_response.status()
|
11305 11729 | );
|
11306 11730 | let expected_headers = [("Content-Type", "application/x-amz-json-1.1")];
|
11307 11731 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
|
11308 11732 | http_response.headers(),
|
11309 11733 | expected_headers,
|
11310 11734 | ));
|
11311 - | let body = ::hyper::body::to_bytes(http_response.into_body())
|
11735 + | use ::http_body_util::BodyExt;
|
11736 + | let body = http_response
|
11737 + | .into_body()
|
11738 + | .collect()
|
11312 11739 | .await
|
11313 - | .expect("unable to extract body to bytes");
|
11740 + | .expect("unable to collect body")
|
11741 + | .to_bytes();
|
11314 11742 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
|
11315 11743 | &body,
|
11316 11744 | "{\"ListOfMapsOfStrings\":[{\"size\":\"large\"},{\"color\":\"red\"}]}",
|
11317 11745 | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
11318 11746 | ));
|
11319 11747 | }
|
11320 11748 |
|
11321 11749 | /// Parses list of list shapes
|
11322 11750 | /// Test ID: parses_list_of_list_shapes
|
11323 11751 | #[::tokio::test]
|
11324 11752 | #[::tracing_test::traced_test]
|
11325 11753 | async fn parses_list_of_list_shapes_response() {
|
11326 11754 | let output = crate::output::KitchenSinkOperationOutput {
|
11327 11755 | list_of_lists: ::std::option::Option::Some(vec![
|
11328 11756 | vec!["abc".to_owned(), "mno".to_owned(), "xyz".to_owned()],
|
11329 11757 | vec!["hjk".to_owned(), "qrs".to_owned(), "tuv".to_owned()],
|
11330 11758 | ]),
|
11331 11759 | blob: ::std::option::Option::None,
|
11332 11760 | boolean: ::std::option::Option::None,
|
11333 11761 | double: ::std::option::Option::None,
|
11334 11762 | empty_struct: ::std::option::Option::None,
|
11335 11763 | float: ::std::option::Option::None,
|
11336 11764 | httpdate_timestamp: ::std::option::Option::None,
|
11337 11765 | integer: ::std::option::Option::None,
|
11338 11766 | iso8601_timestamp: ::std::option::Option::None,
|
11339 11767 | json_value: ::std::option::Option::None,
|
11340 11768 | list_of_maps_of_strings: ::std::option::Option::None,
|
11341 11769 | list_of_strings: ::std::option::Option::None,
|
11342 11770 | list_of_structs: ::std::option::Option::None,
|
11343 11771 | long: ::std::option::Option::None,
|
11344 11772 | map_of_lists_of_strings: ::std::option::Option::None,
|
11345 11773 | map_of_maps: ::std::option::Option::None,
|
11346 11774 | map_of_strings: ::std::option::Option::None,
|
11347 11775 | map_of_structs: ::std::option::Option::None,
|
11348 11776 | recursive_list: ::std::option::Option::None,
|
11349 11777 | recursive_map: ::std::option::Option::None,
|
11350 11778 | recursive_struct: ::std::option::Option::None,
|
11351 11779 | simple_struct: ::std::option::Option::None,
|
11352 11780 | string: ::std::option::Option::None,
|
11353 11781 | struct_with_json_name: ::std::option::Option::None,
|
11354 11782 | timestamp: ::std::option::Option::None,
|
11355 11783 | unix_timestamp: ::std::option::Option::None,
|
11356 11784 | };
|
11357 11785 | use ::aws_smithy_http_server::response::IntoResponse;
|
11358 11786 | let http_response = output.into_response();
|
11359 11787 | ::pretty_assertions::assert_eq!(
|
11360 - | http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
|
11788 + | ::http_1x::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
|
11361 11789 | http_response.status()
|
11362 11790 | );
|
11363 11791 | let expected_headers = [("Content-Type", "application/x-amz-json-1.1")];
|
11364 11792 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
|
11365 11793 | http_response.headers(),
|
11366 11794 | expected_headers,
|
11367 11795 | ));
|
11368 - | let body = ::hyper::body::to_bytes(http_response.into_body())
|
11796 + | use ::http_body_util::BodyExt;
|
11797 + | let body = http_response
|
11798 + | .into_body()
|
11799 + | .collect()
|
11369 11800 | .await
|
11370 - | .expect("unable to extract body to bytes");
|
11801 + | .expect("unable to collect body")
|
11802 + | .to_bytes();
|
11371 11803 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
|
11372 11804 | &body,
|
11373 11805 | "{\"ListOfLists\":[[\"abc\",\"mno\",\"xyz\"],[\"hjk\",\"qrs\",\"tuv\"]]}",
|
11374 11806 | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
11375 11807 | ));
|
11376 11808 | }
|
11377 11809 |
|
11378 11810 | /// Parses list of structure shapes
|
11379 11811 | /// Test ID: parses_list_of_structure_shapes
|
11380 11812 | #[::tokio::test]
|
11381 11813 | #[::tracing_test::traced_test]
|
11382 11814 | async fn parses_list_of_structure_shapes_response() {
|
11383 11815 | let output = crate::output::KitchenSinkOperationOutput {
|
11384 11816 | list_of_structs: ::std::option::Option::Some(vec![
|
11385 11817 | crate::model::SimpleStruct {
|
11386 11818 | value: ::std::option::Option::Some("value-1".to_owned()),
|
11387 11819 | },
|
11388 11820 | crate::model::SimpleStruct {
|
11389 11821 | value: ::std::option::Option::Some("value-2".to_owned()),
|
11390 11822 | },
|
11391 11823 | ]),
|
11392 11824 | blob: ::std::option::Option::None,
|
11393 11825 | boolean: ::std::option::Option::None,
|
11394 11826 | double: ::std::option::Option::None,
|
11395 11827 | empty_struct: ::std::option::Option::None,
|
11396 11828 | float: ::std::option::Option::None,
|
11397 11829 | httpdate_timestamp: ::std::option::Option::None,
|
11398 11830 | integer: ::std::option::Option::None,
|
11399 11831 | iso8601_timestamp: ::std::option::Option::None,
|
11400 11832 | json_value: ::std::option::Option::None,
|
11401 11833 | list_of_lists: ::std::option::Option::None,
|
11402 11834 | list_of_maps_of_strings: ::std::option::Option::None,
|
11403 11835 | list_of_strings: ::std::option::Option::None,
|
11404 11836 | long: ::std::option::Option::None,
|
11405 11837 | map_of_lists_of_strings: ::std::option::Option::None,
|
11406 11838 | map_of_maps: ::std::option::Option::None,
|
11407 11839 | map_of_strings: ::std::option::Option::None,
|
11408 11840 | map_of_structs: ::std::option::Option::None,
|
11409 11841 | recursive_list: ::std::option::Option::None,
|
11410 11842 | recursive_map: ::std::option::Option::None,
|
11411 11843 | recursive_struct: ::std::option::Option::None,
|
11412 11844 | simple_struct: ::std::option::Option::None,
|
11413 11845 | string: ::std::option::Option::None,
|
11414 11846 | struct_with_json_name: ::std::option::Option::None,
|
11415 11847 | timestamp: ::std::option::Option::None,
|
11416 11848 | unix_timestamp: ::std::option::Option::None,
|
11417 11849 | };
|
11418 11850 | use ::aws_smithy_http_server::response::IntoResponse;
|
11419 11851 | let http_response = output.into_response();
|
11420 11852 | ::pretty_assertions::assert_eq!(
|
11421 - | http::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
|
11853 + | ::http_1x::StatusCode::from_u16(200).expect("invalid expected HTTP status code"),
|
11422 11854 | http_response.status()
|
11423 11855 | );
|
11424 11856 | let expected_headers = [("Content-Type", "application/x-amz-json-1.1")];
|
11425 11857 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
|
11426 11858 | http_response.headers(),
|
11427 11859 | expected_headers,
|
11428 11860 | ));
|
11429 - | let body = ::hyper::body::to_bytes(http_response.into_body())
|
11861 + | use ::http_body_util::BodyExt;
|
11862 + | let body = http_response
|
11863 + | .into_body()
|
11864 + | .collect()
|
11430 11865 | .await
|
11431 - | .expect("unable to extract body to bytes");
|
11866 + | .expect("unable to collect body")
|
11867 + | .to_bytes();
|
11432 11868 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
|
11433 11869 | &body,
|
11434 11870 | "{\"ListOfStructs\":[{\"Value\":\"value-1\"},{\"Value\":\"value-2\"}]}",
|
11435 11871 | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
11436 11872 | ));
|
11437 11873 | }
|
11438 11874 |
|
11439 11875 | /// Parses list of recursive structure shapes
|
11440 11876 | /// Test ID: parses_list_of_recursive_structure_shapes
|
11441 11877 | #[::tokio::test]
|