222 222 |
|
223 223 | #[allow(unreachable_code, unused_variables)]
|
224 224 | #[cfg(test)]
|
225 225 | mod xml_timestamps_test {
|
226 226 |
|
227 227 | /// Tests how normal timestamps are serialized
|
228 228 | /// Test ID: XmlTimestamps
|
229 229 | #[::tokio::test]
|
230 230 | #[::tracing_test::traced_test]
|
231 231 | async fn xml_timestamps_request() {
|
232 - | let (http_client, request_receiver) = ::aws_smithy_runtime::client::http::test_util::capture_request(None);
|
232 + | let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
|
233 233 | let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
|
234 234 |
|
235 235 | let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
|
236 236 | let result = client
|
237 237 | .xml_timestamps()
|
238 238 | .set_normal(::std::option::Option::Some(::aws_smithy_types::DateTime::from_fractional_secs(
|
239 239 | 1398796238, 0_f64,
|
240 240 | )))
|
241 241 | .send()
|
242 242 | .await;
|
243 243 | let _ = dbg!(result);
|
244 244 | let http_request = request_receiver.expect_request();
|
245 245 | let expected_headers = [("Content-Type", "application/xml")];
|
246 246 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
|
247 247 | let body = http_request.body().bytes().expect("body should be strict");
|
248 248 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
|
249 249 | body,
|
250 250 | "<XmlTimestampsRequest>\n <normal>2014-04-29T18:30:38Z</normal>\n</XmlTimestampsRequest>\n",
|
251 251 | ::aws_smithy_protocol_test::MediaType::from("application/xml"),
|
252 252 | ));
|
253 253 | let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
|
254 254 | ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
|
255 255 | ::pretty_assertions::assert_eq!(uri.path(), "/XmlTimestamps", "path was incorrect");
|
256 256 | }
|
257 257 |
|
258 258 | /// Ensures that the timestampFormat of date-time works like normal timestamps
|
259 259 | /// Test ID: XmlTimestampsWithDateTimeFormat
|
260 260 | #[::tokio::test]
|
261 261 | #[::tracing_test::traced_test]
|
262 262 | async fn xml_timestamps_with_date_time_format_request() {
|
263 - | let (http_client, request_receiver) = ::aws_smithy_runtime::client::http::test_util::capture_request(None);
|
263 + | let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
|
264 264 | let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
|
265 265 |
|
266 266 | let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
|
267 267 | let result = client
|
268 268 | .xml_timestamps()
|
269 269 | .set_date_time(::std::option::Option::Some(::aws_smithy_types::DateTime::from_fractional_secs(
|
270 270 | 1398796238, 0_f64,
|
271 271 | )))
|
272 272 | .send()
|
273 273 | .await;
|
274 274 | let _ = dbg!(result);
|
275 275 | let http_request = request_receiver.expect_request();
|
276 276 | let expected_headers = [("Content-Type", "application/xml")];
|
277 277 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
|
278 278 | let body = http_request.body().bytes().expect("body should be strict");
|
279 279 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
|
280 280 | body,
|
281 281 | "<XmlTimestampsRequest>\n <dateTime>2014-04-29T18:30:38Z</dateTime>\n</XmlTimestampsRequest>\n",
|
282 282 | ::aws_smithy_protocol_test::MediaType::from("application/xml"),
|
283 283 | ));
|
284 284 | let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
|
285 285 | ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
|
286 286 | ::pretty_assertions::assert_eq!(uri.path(), "/XmlTimestamps", "path was incorrect");
|
287 287 | }
|
288 288 |
|
289 289 | /// Ensures that the timestampFormat of date-time on the target shape works like normal timestamps
|
290 290 | /// Test ID: XmlTimestampsWithDateTimeOnTargetFormat
|
291 291 | #[::tokio::test]
|
292 292 | #[::tracing_test::traced_test]
|
293 293 | async fn xml_timestamps_with_date_time_on_target_format_request() {
|
294 - | let (http_client, request_receiver) = ::aws_smithy_runtime::client::http::test_util::capture_request(None);
|
294 + | let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
|
295 295 | let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
|
296 296 |
|
297 297 | let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
|
298 298 | let result = client
|
299 299 | .xml_timestamps()
|
300 300 | .set_date_time_on_target(::std::option::Option::Some(::aws_smithy_types::DateTime::from_fractional_secs(
|
301 301 | 1398796238, 0_f64,
|
302 302 | )))
|
303 303 | .send()
|
304 304 | .await;
|
305 305 | let _ = dbg!(result);
|
306 306 | let http_request = request_receiver.expect_request();
|
307 307 | let expected_headers = [("Content-Type", "application/xml")];
|
308 308 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
|
309 309 | let body = http_request.body().bytes().expect("body should be strict");
|
310 310 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
|
311 311 | body,
|
312 312 | "<XmlTimestampsRequest>\n <dateTimeOnTarget>2014-04-29T18:30:38Z</dateTimeOnTarget>\n</XmlTimestampsRequest>\n",
|
313 313 | ::aws_smithy_protocol_test::MediaType::from("application/xml"),
|
314 314 | ));
|
315 315 | let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
|
316 316 | ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
|
317 317 | ::pretty_assertions::assert_eq!(uri.path(), "/XmlTimestamps", "path was incorrect");
|
318 318 | }
|
319 319 |
|
320 320 | /// Ensures that the timestampFormat of epoch-seconds works
|
321 321 | /// Test ID: XmlTimestampsWithEpochSecondsFormat
|
322 322 | #[::tokio::test]
|
323 323 | #[::tracing_test::traced_test]
|
324 324 | async fn xml_timestamps_with_epoch_seconds_format_request() {
|
325 - | let (http_client, request_receiver) = ::aws_smithy_runtime::client::http::test_util::capture_request(None);
|
325 + | let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
|
326 326 | let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
|
327 327 |
|
328 328 | let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
|
329 329 | let result = client
|
330 330 | .xml_timestamps()
|
331 331 | .set_epoch_seconds(::std::option::Option::Some(::aws_smithy_types::DateTime::from_fractional_secs(
|
332 332 | 1398796238, 0_f64,
|
333 333 | )))
|
334 334 | .send()
|
335 335 | .await;
|
336 336 | let _ = dbg!(result);
|
337 337 | let http_request = request_receiver.expect_request();
|
338 338 | let expected_headers = [("Content-Type", "application/xml")];
|
339 339 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
|
340 340 | let body = http_request.body().bytes().expect("body should be strict");
|
341 341 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
|
342 342 | body,
|
343 343 | "<XmlTimestampsRequest>\n <epochSeconds>1398796238</epochSeconds>\n</XmlTimestampsRequest>\n",
|
344 344 | ::aws_smithy_protocol_test::MediaType::from("application/xml"),
|
345 345 | ));
|
346 346 | let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
|
347 347 | ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
|
348 348 | ::pretty_assertions::assert_eq!(uri.path(), "/XmlTimestamps", "path was incorrect");
|
349 349 | }
|
350 350 |
|
351 351 | /// Ensures that the timestampFormat of epoch-seconds on the target shape works
|
352 352 | /// Test ID: XmlTimestampsWithEpochSecondsOnTargetFormat
|
353 353 | #[::tokio::test]
|
354 354 | #[::tracing_test::traced_test]
|
355 355 | async fn xml_timestamps_with_epoch_seconds_on_target_format_request() {
|
356 - | let (http_client, request_receiver) = ::aws_smithy_runtime::client::http::test_util::capture_request(None);
|
356 + | let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
|
357 357 | let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
|
358 358 |
|
359 359 | let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
|
360 360 | let result = client
|
361 361 | .xml_timestamps()
|
362 362 | .set_epoch_seconds_on_target(::std::option::Option::Some(::aws_smithy_types::DateTime::from_fractional_secs(
|
363 363 | 1398796238, 0_f64,
|
364 364 | )))
|
365 365 | .send()
|
366 366 | .await;
|
367 367 | let _ = dbg!(result);
|
368 368 | let http_request = request_receiver.expect_request();
|
369 369 | let expected_headers = [("Content-Type", "application/xml")];
|
370 370 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
|
371 371 | let body = http_request.body().bytes().expect("body should be strict");
|
372 372 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
|
373 373 | body,
|
374 374 | "<XmlTimestampsRequest>\n <epochSecondsOnTarget>1398796238</epochSecondsOnTarget>\n</XmlTimestampsRequest>\n",
|
375 375 | ::aws_smithy_protocol_test::MediaType::from("application/xml"),
|
376 376 | ));
|
377 377 | let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
|
378 378 | ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
|
379 379 | ::pretty_assertions::assert_eq!(uri.path(), "/XmlTimestamps", "path was incorrect");
|
380 380 | }
|
381 381 |
|
382 382 | /// Ensures that the timestampFormat of http-date works
|
383 383 | /// Test ID: XmlTimestampsWithHttpDateFormat
|
384 384 | #[::tokio::test]
|
385 385 | #[::tracing_test::traced_test]
|
386 386 | async fn xml_timestamps_with_http_date_format_request() {
|
387 - | let (http_client, request_receiver) = ::aws_smithy_runtime::client::http::test_util::capture_request(None);
|
387 + | let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
|
388 388 | let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
|
389 389 |
|
390 390 | let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
|
391 391 | let result = client
|
392 392 | .xml_timestamps()
|
393 393 | .set_http_date(::std::option::Option::Some(::aws_smithy_types::DateTime::from_fractional_secs(
|
394 394 | 1398796238, 0_f64,
|
395 395 | )))
|
396 396 | .send()
|
397 397 | .await;
|
398 398 | let _ = dbg!(result);
|
399 399 | let http_request = request_receiver.expect_request();
|
400 400 | let expected_headers = [("Content-Type", "application/xml")];
|
401 401 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
|
402 402 | let body = http_request.body().bytes().expect("body should be strict");
|
403 403 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
|
404 404 | body,
|
405 405 | "<XmlTimestampsRequest>\n <httpDate>Tue, 29 Apr 2014 18:30:38 GMT</httpDate>\n</XmlTimestampsRequest>\n",
|
406 406 | ::aws_smithy_protocol_test::MediaType::from("application/xml"),
|
407 407 | ));
|
408 408 | let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
|
409 409 | ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
|
410 410 | ::pretty_assertions::assert_eq!(uri.path(), "/XmlTimestamps", "path was incorrect");
|
411 411 | }
|
412 412 |
|
413 413 | /// Ensures that the timestampFormat of http-date on the target shape works
|
414 414 | /// Test ID: XmlTimestampsWithHttpDateOnTargetFormat
|
415 415 | #[::tokio::test]
|
416 416 | #[::tracing_test::traced_test]
|
417 417 | async fn xml_timestamps_with_http_date_on_target_format_request() {
|
418 - | let (http_client, request_receiver) = ::aws_smithy_runtime::client::http::test_util::capture_request(None);
|
418 + | let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
|
419 419 | let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
|
420 420 |
|
421 421 | let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
|
422 422 | let result = client
|
423 423 | .xml_timestamps()
|
424 424 | .set_http_date_on_target(::std::option::Option::Some(::aws_smithy_types::DateTime::from_fractional_secs(
|
425 425 | 1398796238, 0_f64,
|
426 426 | )))
|
427 427 | .send()
|
428 428 | .await;
|