179 179 |
|
180 180 | /// Serializes null values in maps
|
181 181 | /// Test ID: RpcV2CborSparseMapsSerializeNullValues
|
182 182 | #[::tokio::test]
|
183 183 | #[::tracing_test::traced_test]
|
184 184 | async fn rpc_v2_cbor_sparse_maps_serialize_null_values_request() {
|
185 185 | #[allow(unused_mut)]
|
186 186 | let mut http_request = http::Request::builder()
|
187 187 | .uri("/service/RpcV2Protocol/operation/SparseNullsOperation")
|
188 188 | .method("POST")
|
189 - | .header("Accept", "application/cbor")
|
190 189 | .header("Content-Type", "application/cbor")
|
191 190 | .header("smithy-protocol", "rpc-v2-cbor")
|
192 191 | .body(::aws_smithy_http_server::body::Body::from(
|
193 192 | ::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
|
194 193 | "v29zcGFyc2VTdHJpbmdNYXC/Y2Zvb/b//w==".as_bytes(),
|
195 194 | ::aws_smithy_protocol_test::MediaType::from("application/cbor"),
|
196 195 | )),
|
197 196 | ))
|
198 197 | .unwrap();
|
199 198 | #[allow(unused_mut)]
|
200 199 | let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
|
201 200 | let config = crate::service::RpcV2ProtocolConfig::builder().build();
|
202 201 | let service =
|
203 202 | crate::service::RpcV2Protocol::builder::<::hyper::body::Body, _, _, _>(config)
|
204 203 | .sparse_nulls_operation(move |input: crate::input::SparseNullsOperationInput| {
|
205 204 | let sender = sender.clone();
|
206 205 | async move {
|
207 206 | let result = {
|
208 207 | let expected = crate::input::SparseNullsOperationInput {
|
209 208 | sparse_string_map: ::std::option::Option::Some({
|
210 209 | let mut ret = ::std::collections::HashMap::new();
|
211 210 | ret.insert("foo".to_owned(), ::std::option::Option::None);
|
212 211 | ret
|
213 212 | }),
|
214 213 | sparse_string_list: ::std::option::Option::None,
|
215 214 | };
|
216 215 | ::pretty_assertions::assert_eq!(input, expected);
|
217 216 | let output = crate::output::SparseNullsOperationOutput {
|
218 217 | sparse_string_list: ::std::option::Option::None,
|
219 218 | sparse_string_map: ::std::option::Option::None,
|
220 219 | };
|
221 220 | output
|
222 221 | };
|
223 222 | sender.send(()).await.expect("receiver dropped early");
|
224 223 | result
|
225 224 | }
|
226 225 | })
|
227 226 | .build_unchecked();
|
228 227 | let http_response = ::tower::ServiceExt::oneshot(service, http_request)
|
229 228 | .await
|
230 229 | .expect("unable to make an HTTP request");
|
231 230 | assert!(
|
232 231 | receiver.recv().await.is_some(),
|
233 232 | "we expected operation handler to be invoked but it was not entered"
|
234 233 | );
|
235 234 | }
|
236 235 |
|
237 236 | /// Serializes null values in lists
|
238 237 | /// Test ID: RpcV2CborSparseListsSerializeNull
|
239 238 | #[::tokio::test]
|
240 239 | #[::tracing_test::traced_test]
|
241 240 | async fn rpc_v2_cbor_sparse_lists_serialize_null_request() {
|
242 241 | #[allow(unused_mut)]
|
243 242 | let mut http_request = http::Request::builder()
|
244 243 | .uri("/service/RpcV2Protocol/operation/SparseNullsOperation")
|
245 244 | .method("POST")
|
246 - | .header("Accept", "application/cbor")
|
247 245 | .header("Content-Type", "application/cbor")
|
248 246 | .header("smithy-protocol", "rpc-v2-cbor")
|
249 247 | .body(::aws_smithy_http_server::body::Body::from(
|
250 248 | ::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
|
251 249 | "v3BzcGFyc2VTdHJpbmdMaXN0n/b//w==".as_bytes(),
|
252 250 | ::aws_smithy_protocol_test::MediaType::from("application/cbor"),
|
253 251 | )),
|
254 252 | ))
|
255 253 | .unwrap();
|
256 254 | #[allow(unused_mut)]
|
2621 2607 | let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
|
2622 2608 | let config = crate::service::RpcV2ProtocolConfig::builder().build();
|
2623 2609 | let service =
|
2624 2610 | crate::service::RpcV2Protocol::builder::<::hyper::body::Body, _, _, _>(config)
|
2625 2611 | .rpc_v2_cbor_lists(move |input: crate::input::RpcV2CborListsInput| {
|
2626 2612 | let sender = sender.clone();
|
2627 2613 | async move {
|
2628 2614 | let result = {
|
2629 2615 | let expected = crate::input::RpcV2CborListsInput {
|
2630 2616 | string_list: ::std::option::Option::Some(vec![]),
|
2631 2617 | string_set: ::std::option::Option::None,
|
2632 2618 | integer_list: ::std::option::Option::None,
|
2633 2619 | boolean_list: ::std::option::Option::None,
|
2634 2620 | timestamp_list: ::std::option::Option::None,
|
2635 2621 | enum_list: ::std::option::Option::None,
|
2636 2622 | int_enum_list: ::std::option::Option::None,
|
2637 2623 | nested_string_list: ::std::option::Option::None,
|
2638 2624 | structure_list: ::std::option::Option::None,
|
2639 2625 | blob_list: ::std::option::Option::None,
|
2640 2626 | };
|
2690 2675 | let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
|
2691 2676 | let config = crate::service::RpcV2ProtocolConfig::builder().build();
|
2692 2677 | let service =
|
2693 2678 | crate::service::RpcV2Protocol::builder::<::hyper::body::Body, _, _, _>(config)
|
2694 2679 | .rpc_v2_cbor_lists(move |input: crate::input::RpcV2CborListsInput| {
|
2695 2680 | let sender = sender.clone();
|
2696 2681 | async move {
|
2697 2682 | let result = {
|
2698 2683 | let expected = crate::input::RpcV2CborListsInput {
|
2699 2684 | string_list: ::std::option::Option::Some(vec![]),
|
2700 2685 | string_set: ::std::option::Option::None,
|
2701 2686 | integer_list: ::std::option::Option::None,
|
2702 2687 | boolean_list: ::std::option::Option::None,
|
2703 2688 | timestamp_list: ::std::option::Option::None,
|
2704 2689 | enum_list: ::std::option::Option::None,
|
2705 2690 | int_enum_list: ::std::option::Option::None,
|
2706 2691 | nested_string_list: ::std::option::Option::None,
|
2707 2692 | structure_list: ::std::option::Option::None,
|
2708 2693 | blob_list: ::std::option::Option::None,
|
2709 2694 | };
|
3105 3087 | let service =
|
3106 3088 | crate::service::RpcV2Protocol::builder::<::hyper::body::Body, _, _, _>(config)
|
3107 3089 | .simple_scalar_properties(
|
3108 3090 | move |input: crate::input::SimpleScalarPropertiesInput| {
|
3109 3091 | let sender = sender.clone();
|
3110 3092 | async move {
|
3111 3093 | let result = {
|
3112 3094 | use ::aws_smithy_protocol_test::FloatEquals;
|
3113 3095 | let expected = crate::input::SimpleScalarPropertiesInput {
|
3114 3096 | byte_value: ::std::option::Option::Some(5),
|
3115 3097 | double_value: ::std::option::Option::Some(1.889_f64),
|
3116 3098 | false_boolean_value: ::std::option::Option::Some(false),
|
3117 3099 | float_value: ::std::option::Option::Some(7.625_f32),
|
3118 3100 | integer_value: ::std::option::Option::Some(256),
|
3119 3101 | long_value: ::std::option::Option::Some(9873),
|
3120 3102 | short_value: ::std::option::Option::Some(9898),
|
3121 3103 | string_value: ::std::option::Option::Some("simple".to_owned()),
|
3122 3104 | true_boolean_value: ::std::option::Option::Some(true),
|
3123 3105 | blob_value: ::std::option::Option::Some(
|
3124 3106 | ::aws_smithy_types::Blob::new("foo"),
|
3230 3211 | let service =
|
3231 3212 | crate::service::RpcV2Protocol::builder::<::hyper::body::Body, _, _, _>(config)
|
3232 3213 | .simple_scalar_properties(
|
3233 3214 | move |input: crate::input::SimpleScalarPropertiesInput| {
|
3234 3215 | let sender = sender.clone();
|
3235 3216 | async move {
|
3236 3217 | let result = {
|
3237 3218 | use ::aws_smithy_protocol_test::FloatEquals;
|
3238 3219 | let expected = crate::input::SimpleScalarPropertiesInput {
|
3239 3220 | byte_value: ::std::option::Option::Some(5),
|
3240 3221 | double_value: ::std::option::Option::Some(1.889_f64),
|
3241 3222 | false_boolean_value: ::std::option::Option::Some(false),
|
3242 3223 | float_value: ::std::option::Option::Some(7.625_f32),
|
3243 3224 | integer_value: ::std::option::Option::Some(256),
|
3244 3225 | long_value: ::std::option::Option::Some(9873),
|
3245 3226 | short_value: ::std::option::Option::Some(9898),
|
3246 3227 | string_value: ::std::option::Option::Some("simple".to_owned()),
|
3247 3228 | true_boolean_value: ::std::option::Option::Some(true),
|
3248 3229 | blob_value: ::std::option::Option::Some(
|
3249 3230 | ::aws_smithy_types::Blob::new("foo"),
|
3353 3333 | let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
|
3354 3334 | let config = crate::service::RpcV2ProtocolConfig::builder().build();
|
3355 3335 | let service =
|
3356 3336 | crate::service::RpcV2Protocol::builder::<::hyper::body::Body, _, _, _>(config)
|
3357 3337 | .simple_scalar_properties(
|
3358 3338 | move |input: crate::input::SimpleScalarPropertiesInput| {
|
3359 3339 | let sender = sender.clone();
|
3360 3340 | async move {
|
3361 3341 | let result = {
|
3362 3342 | use ::aws_smithy_protocol_test::FloatEquals;
|
3363 3343 | let expected = crate::input::SimpleScalarPropertiesInput {
|
3364 3344 | true_boolean_value: ::std::option::Option::None,
|
3365 3345 | false_boolean_value: ::std::option::Option::None,
|
3366 3346 | byte_value: ::std::option::Option::None,
|
3367 3347 | double_value: ::std::option::Option::None,
|
3368 3348 | float_value: ::std::option::Option::None,
|
3369 3349 | integer_value: ::std::option::Option::None,
|
3370 3350 | long_value: ::std::option::Option::None,
|
3371 3351 | short_value: ::std::option::Option::None,
|
3372 3352 | string_value: ::std::option::Option::None,
|
3872 3848 | let service =
|
3873 3849 | crate::service::RpcV2Protocol::builder::<::hyper::body::Body, _, _, _>(config)
|
3874 3850 | .simple_scalar_properties(
|
3875 3851 | move |input: crate::input::SimpleScalarPropertiesInput| {
|
3876 3852 | let sender = sender.clone();
|
3877 3853 | async move {
|
3878 3854 | let result = {
|
3879 3855 | use ::aws_smithy_protocol_test::FloatEquals;
|
3880 3856 | let expected = crate::input::SimpleScalarPropertiesInput {
|
3881 3857 | string_value: ::std::option::Option::Some(
|
3882 3858 | "An example indefinite string, chunked on comma".to_owned(),
|
3883 3859 | ),
|
3884 3860 | true_boolean_value: ::std::option::Option::None,
|
3885 3861 | false_boolean_value: ::std::option::Option::None,
|
3886 3862 | byte_value: ::std::option::Option::None,
|
3887 3863 | double_value: ::std::option::Option::None,
|
3888 3864 | float_value: ::std::option::Option::None,
|
3889 3865 | integer_value: ::std::option::Option::None,
|
3890 3866 | long_value: ::std::option::Option::None,
|
3891 3867 | short_value: ::std::option::Option::None,
|
4120 4094 | let service =
|
4121 4095 | crate::service::RpcV2Protocol::builder::<::hyper::body::Body, _, _, _>(config)
|
4122 4096 | .simple_scalar_properties(
|
4123 4097 | move |input: crate::input::SimpleScalarPropertiesInput| {
|
4124 4098 | let sender = sender.clone();
|
4125 4099 | async move {
|
4126 4100 | let result = {
|
4127 4101 | use ::aws_smithy_protocol_test::FloatEquals;
|
4128 4102 | let expected = crate::input::SimpleScalarPropertiesInput {
|
4129 4103 | double_value: ::std::option::Option::Some(1.5_f64),
|
4130 4104 | float_value: ::std::option::Option::Some(7.625_f32),
|
4131 4105 | integer_value: ::std::option::Option::Some(56),
|
4132 4106 | long_value: ::std::option::Option::Some(256),
|
4133 4107 | short_value: ::std::option::Option::Some(10),
|
4134 4108 | true_boolean_value: ::std::option::Option::None,
|
4135 4109 | false_boolean_value: ::std::option::Option::None,
|
4136 4110 | byte_value: ::std::option::Option::None,
|
4137 4111 | string_value: ::std::option::Option::None,
|
4138 4112 | blob_value: ::std::option::Option::None,
|
4139 4113 | };
|
4243 4216 | let service =
|
4244 4217 | crate::service::RpcV2Protocol::builder::<::hyper::body::Body, _, _, _>(config)
|
4245 4218 | .simple_scalar_properties(
|
4246 4219 | move |input: crate::input::SimpleScalarPropertiesInput| {
|
4247 4220 | let sender = sender.clone();
|
4248 4221 | async move {
|
4249 4222 | let result = {
|
4250 4223 | use ::aws_smithy_protocol_test::FloatEquals;
|
4251 4224 | let expected = crate::input::SimpleScalarPropertiesInput {
|
4252 4225 | byte_value: ::std::option::Option::Some(5),
|
4253 4226 | double_value: ::std::option::Option::Some(1.889_f64),
|
4254 4227 | false_boolean_value: ::std::option::Option::Some(false),
|
4255 4228 | float_value: ::std::option::Option::Some(7.625_f32),
|
4256 4229 | integer_value: ::std::option::Option::Some(256),
|
4257 4230 | long_value: ::std::option::Option::Some(9873),
|
4258 4231 | short_value: ::std::option::Option::Some(9898),
|
4259 4232 | string_value: ::std::option::Option::Some("simple".to_owned()),
|
4260 4233 | true_boolean_value: ::std::option::Option::Some(true),
|
4261 4234 | blob_value: ::std::option::Option::Some(
|
4262 4235 | ::aws_smithy_types::Blob::new("foo"),
|
4336 4309 | .build_unchecked();
|
4337 4310 | let http_response = ::tower::ServiceExt::oneshot(service, http_request)
|
4338 4311 | .await
|
4339 4312 | .expect("unable to make an HTTP request");
|
4340 4313 | assert!(
|
4341 4314 | receiver.recv().await.is_some(),
|
4342 4315 | "we expected operation handler to be invoked but it was not entered"
|
4343 4316 | );
|
4344 4317 | }
|
4345 4318 |
|
4346 - | /// Servers should tolerate requests without an Accept header set.
|
4347 - | /// Test ID: RpcV2CborServersShouldHandleNoAcceptHeader
|
4348 - | #[::tokio::test]
|
4349 - | #[::tracing_test::traced_test]
|
4350 - | async fn rpc_v2_cbor_servers_should_handle_no_accept_header_request() {
|
4351 - | #[allow(unused_mut)]
|
4352 - | let mut http_request = http::Request::builder()
|
4353 - | .uri("/service/RpcV2Protocol/operation/SimpleScalarProperties")
|
4354 - | .method("POST")
|
4355 - | .header("Content-Type", "application/cbor")
|
4356 - | .header("smithy-protocol", "rpc-v2-cbor")
|
4357 - | .body(::aws_smithy_http_server::body::Body::from(
|
4358 - | ::bytes::Bytes::copy_from_slice(
|
4359 - | &::aws_smithy_protocol_test::decode_body_data("v2lieXRlVmFsdWUFa2RvdWJsZVZhbHVl+z/+OVgQYk3TcWZhbHNlQm9vbGVhblZhbHVl9GpmbG9hdFZhbHVl+kD0AABsaW50ZWdlclZhbHVlGQEAaWxvbmdWYWx1ZRkmkWpzaG9ydFZhbHVlGSaqa3N0cmluZ1ZhbHVlZnNpbXBsZXB0cnVlQm9vbGVhblZhbHVl9WlibG9iVmFsdWVDZm9v/w==".as_bytes(), ::aws_smithy_protocol_test::MediaType::from("application/cbor"))
|
4360 - | )
|
4361 - | )).unwrap();
|
4362 - | #[allow(unused_mut)]
|
4363 - | let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
|
4364 - | let config = crate::service::RpcV2ProtocolConfig::builder().build();
|
4365 - | let service =
|
4366 - | crate::service::RpcV2Protocol::builder::<::hyper::body::Body, _, _, _>(config)
|
4367 - | .simple_scalar_properties(
|
4368 - | move |input: crate::input::SimpleScalarPropertiesInput| {
|
4369 - | let sender = sender.clone();
|
4370 - | async move {
|
4371 - | let result = {
|
4372 - | use ::aws_smithy_protocol_test::FloatEquals;
|
4373 - | let expected = crate::input::SimpleScalarPropertiesInput {
|
4374 - | byte_value: ::std::option::Option::Some(5),
|
4375 - | double_value: ::std::option::Option::Some(1.889_f64),
|
4376 - | false_boolean_value: ::std::option::Option::Some(false),
|
4377 - | float_value: ::std::option::Option::Some(7.625_f32),
|
4378 - | integer_value: ::std::option::Option::Some(256),
|
4379 - | long_value: ::std::option::Option::Some(9873),
|
4380 - | short_value: ::std::option::Option::Some(9898),
|
4381 - | string_value: ::std::option::Option::Some("simple".to_owned()),
|
4382 - | true_boolean_value: ::std::option::Option::Some(true),
|
4383 - | blob_value: ::std::option::Option::Some(
|
4384 - | ::aws_smithy_types::Blob::new("foo"),
|
4385 - | ),
|
4386 - | };
|
4387 - | ::pretty_assertions::assert_eq!(
|
4388 - | input.true_boolean_value,
|
4389 - | expected.true_boolean_value,
|
4390 - | "Unexpected value for `true_boolean_value`"
|
4391 - | );
|
4392 - | ::pretty_assertions::assert_eq!(
|
4393 - | input.false_boolean_value,
|
4394 - | expected.false_boolean_value,
|
4395 - | "Unexpected value for `false_boolean_value`"
|
4396 - | );
|
4397 - | ::pretty_assertions::assert_eq!(
|
4398 - | input.byte_value,
|
4399 - | expected.byte_value,
|
4400 - | "Unexpected value for `byte_value`"
|
4401 - | );
|
4402 - | assert!(
|
4403 - | input.double_value.float_equals(&expected.double_value),
|
4404 - | "Unexpected value for `double_value` {:?} vs. {:?}",
|
4405 - | expected.double_value,
|
4406 - | input.double_value
|
4407 - | );
|
4408 - | assert!(
|
4409 - | input.float_value.float_equals(&expected.float_value),
|
4410 - | "Unexpected value for `float_value` {:?} vs. {:?}",
|
4411 - | expected.float_value,
|
4412 - | input.float_value
|
4413 - | );
|
4414 - | ::pretty_assertions::assert_eq!(
|
4415 - | input.integer_value,
|
4416 - | expected.integer_value,
|
4417 - | "Unexpected value for `integer_value`"
|
4418 - | );
|
4419 - | ::pretty_assertions::assert_eq!(
|
4420 - | input.long_value,
|
4421 - | expected.long_value,
|
4422 - | "Unexpected value for `long_value`"
|
4423 - | );
|
4424 - | ::pretty_assertions::assert_eq!(
|
4425 - | input.short_value,
|
4426 - | expected.short_value,
|
4427 - | "Unexpected value for `short_value`"
|
4428 - | );
|
4429 - | ::pretty_assertions::assert_eq!(
|
4430 - | input.string_value,
|
4431 - | expected.string_value,
|
4432 - | "Unexpected value for `string_value`"
|
4433 - | );
|
4434 - | ::pretty_assertions::assert_eq!(
|
4435 - | input.blob_value,
|
4436 - | expected.blob_value,
|
4437 - | "Unexpected value for `blob_value`"
|
4438 - | );
|
4439 - | let output = crate::output::SimpleScalarPropertiesOutput {
|
4440 - | true_boolean_value: ::std::option::Option::None,
|
4441 - | false_boolean_value: ::std::option::Option::None,
|
4442 - | byte_value: ::std::option::Option::None,
|
4443 - | double_value: ::std::option::Option::None,
|
4444 - | float_value: ::std::option::Option::None,
|
4445 - | integer_value: ::std::option::Option::None,
|
4446 - | long_value: ::std::option::Option::None,
|
4447 - | short_value: ::std::option::Option::None,
|
4448 - | string_value: ::std::option::Option::None,
|
4449 - | blob_value: ::std::option::Option::None,
|
4450 - | };
|
4451 - | output
|
4452 - | };
|
4453 - | sender.send(()).await.expect("receiver dropped early");
|
4454 - | result
|
4455 - | }
|
4456 - | },
|
4457 - | )
|
4458 - | .build_unchecked();
|
4459 - | let http_response = ::tower::ServiceExt::oneshot(service, http_request)
|
4460 - | .await
|
4461 - | .expect("unable to make an HTTP request");
|
4462 - | assert!(
|
4463 - | receiver.recv().await.is_some(),
|
4464 - | "we expected operation handler to be invoked but it was not entered"
|
4465 - | );
|
4466 - | }
|
4467 - |
|
4468 4319 | /// Serializes simple scalar properties
|
4469 4320 | /// Test ID: RpcV2CborSimpleScalarProperties
|
4470 4321 | #[::tokio::test]
|
4471 4322 | #[::tracing_test::traced_test]
|
4472 4323 | async fn rpc_v2_cbor_simple_scalar_properties_response() {
|
4473 4324 | let output = crate::output::SimpleScalarPropertiesOutput {
|
4474 4325 | true_boolean_value: ::std::option::Option::Some(true),
|
4475 4326 | false_boolean_value: ::std::option::Option::Some(false),
|
4476 4327 | byte_value: ::std::option::Option::Some(5),
|
4477 4328 | double_value: ::std::option::Option::Some(1.889_f64),
|
4959 4809 |
|
4960 4810 | /// When Input structure is empty we write CBOR equivalent of {}
|
4961 4811 | /// Test ID: empty_input
|
4962 4812 | #[::tokio::test]
|
4963 4813 | #[::tracing_test::traced_test]
|
4964 4814 | async fn empty_input_request() {
|
4965 4815 | #[allow(unused_mut)]
|
4966 4816 | let mut http_request = http::Request::builder()
|
4967 4817 | .uri("/service/RpcV2Protocol/operation/EmptyInputOutput")
|
4968 4818 | .method("POST")
|
4969 - | .header("Accept", "application/cbor")
|
4970 4819 | .header("Content-Type", "application/cbor")
|
4971 4820 | .header("smithy-protocol", "rpc-v2-cbor")
|
4972 4821 | .body(::aws_smithy_http_server::body::Body::from(
|
4973 4822 | ::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
|
4974 4823 | "v/8=".as_bytes(),
|
4975 4824 | ::aws_smithy_protocol_test::MediaType::from("application/cbor"),
|
4976 4825 | )),
|
4977 4826 | ))
|
4978 4827 | .unwrap();
|
4979 4828 | #[allow(unused_mut)]
|
4980 4829 | let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
|
4981 4830 | let config = crate::service::RpcV2ProtocolConfig::builder().build();
|
4982 4831 | let service =
|
4983 4832 | crate::service::RpcV2Protocol::builder::<::hyper::body::Body, _, _, _>(config)
|
4984 4833 | .empty_input_output(move |input: crate::input::EmptyInputOutputInput| {
|
4985 4834 | let sender = sender.clone();
|
4986 4835 | async move {
|
4987 4836 | let result = {
|
4988 4837 | let expected = crate::input::EmptyInputOutputInput {};
|
4989 4838 | ::pretty_assertions::assert_eq!(input, expected);
|
4990 4839 | let output = crate::output::EmptyInputOutputOutput {};
|
4991 4840 | output
|
4992 4841 | };
|
4993 4842 | sender.send(()).await.expect("receiver dropped early");
|
4994 4843 | result
|
4995 4844 | }
|
4996 4845 | })
|
4997 4846 | .build_unchecked();
|
4998 4847 | let http_response = ::tower::ServiceExt::oneshot(service, http_request)
|
4999 4848 | .await
|
5000 4849 | .expect("unable to make an HTTP request");
|
5001 4850 | assert!(
|
5002 4851 | receiver.recv().await.is_some(),
|
5003 4852 | "we expected operation handler to be invoked but it was not entered"
|
5004 4853 | );
|
5005 4854 | }
|
5006 4855 |
|
5007 4856 | /// When Input structure is empty the server should accept an empty body
|
5008 4857 | /// Test ID: empty_input_no_body
|
5009 4858 | #[::tokio::test]
|
5010 4859 | #[::tracing_test::traced_test]
|
5011 4860 | async fn empty_input_no_body_request() {
|
5012 4861 | #[allow(unused_mut)]
|
5013 4862 | let mut http_request = http::Request::builder()
|
5014 4863 | .uri("/service/RpcV2Protocol/operation/EmptyInputOutput")
|
5015 4864 | .method("POST")
|
5016 - | .header("Accept", "application/cbor")
|
5017 4865 | .header("Content-Type", "application/cbor")
|
5018 4866 | .header("smithy-protocol", "rpc-v2-cbor")
|
5019 4867 | .body(::aws_smithy_http_server::body::Body::from(
|
5020 4868 | ::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
|
5021 4869 | "".as_bytes(),
|
5022 4870 | ::aws_smithy_protocol_test::MediaType::from("application/cbor"),
|
5023 4871 | )),
|
5024 4872 | ))
|
5025 4873 | .unwrap();
|
5026 4874 | #[allow(unused_mut)]
|