259 259 | .map_err(|err| {
|
260 260 | ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
|
261 261 | })?;
|
262 262 | cfg.interceptor_state()
|
263 263 | .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
|
264 264 | ::std::result::Result::Ok(())
|
265 265 | }
|
266 266 | }
|
267 267 | #[allow(unreachable_code, unused_variables)]
|
268 268 | #[cfg(test)]
|
269 - | mod upload_archive_request_test {
|
269 + | mod upload_archive_test {
|
270 + |
|
270 271 | /// Glacier requires that a version header be set on all requests.
|
271 272 | /// Test ID: GlacierVersionHeader
|
272 273 | #[::tokio::test]
|
273 - | #[allow(unused_mut)]
|
274 + | #[::tracing_test::traced_test]
|
274 275 | async fn glacier_version_header_request() {
|
275 276 | let (http_client, request_receiver) = ::aws_smithy_runtime::client::http::test_util::capture_request(None);
|
276 277 | let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
|
277 278 | let config_builder = config_builder.region(::aws_types::region::Region::new("us-east-1"));
|
278 279 | let mut config_builder = config_builder;
|
279 280 | config_builder.set_region(Some(crate::config::Region::new("us-east-1")));
|
280 281 |
|
281 282 | let config = config_builder.http_client(http_client).build();
|
282 283 | let client = crate::Client::from_conf(config);
|
283 284 | let result = client
|
284 285 | .upload_archive()
|
285 286 | .set_account_id(::std::option::Option::Some("foo".to_owned()))
|
286 287 | .set_vault_name(::std::option::Option::Some("bar".to_owned()))
|
287 288 | .send()
|
288 289 | .await;
|
289 290 | let _ = dbg!(result);
|
290 291 | let http_request = request_receiver.expect_request();
|
291 292 | let expected_headers = [("X-Amz-Glacier-Version", "2012-06-01")];
|
292 293 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
|
293 294 | let body = http_request.body().bytes().expect("body should be strict");
|
294 295 | // No body
|
295 296 | ::pretty_assertions::assert_eq!(::std::str::from_utf8(body).unwrap(), "");
|
296 297 | let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
|
297 298 | ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
|
298 299 | ::pretty_assertions::assert_eq!(uri.path(), "/foo/vaults/bar/archives", "path was incorrect");
|
299 300 | }
|
300 301 | /// Glacier requires checksum headers that are cumbersome to provide.
|
301 302 | /// Test ID: GlacierChecksums
|
302 303 | #[::tokio::test]
|
303 - | #[allow(unused_mut)]
|
304 + | #[::tracing_test::traced_test]
|
304 305 | async fn glacier_checksums_request() {
|
305 306 | let (http_client, request_receiver) = ::aws_smithy_runtime::client::http::test_util::capture_request(None);
|
306 307 | let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
|
307 308 | let config_builder = config_builder.region(::aws_types::region::Region::new("us-east-1"));
|
308 309 | let mut config_builder = config_builder;
|
309 310 | config_builder.set_region(Some(crate::config::Region::new("us-east-1")));
|
310 311 |
|
311 312 | let config = config_builder.http_client(http_client).build();
|
312 313 | let client = crate::Client::from_conf(config);
|
313 314 | let result = client
|
314 315 | .upload_archive()
|
315 316 | .set_account_id(::std::option::Option::Some("foo".to_owned()))
|
316 317 | .set_vault_name(::std::option::Option::Some("bar".to_owned()))
|
317 318 | .set_body(::std::option::Option::Some(::aws_smithy_types::byte_stream::ByteStream::from_static(
|
318 319 | b"hello world",
|
319 320 | )))
|
320 321 | .send()
|
321 322 | .await;
|
322 323 | let _ = dbg!(result);
|
323 324 | let http_request = request_receiver.expect_request();
|
324 325 | let expected_headers = [
|
325 326 | ("X-Amz-Content-Sha256", "b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9"),
|
326 327 | ("X-Amz-Glacier-Version", "2012-06-01"),
|
327 328 | (
|
328 329 | "X-Amz-Sha256-Tree-Hash",
|
329 330 | "b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9",
|
330 331 | ),
|
331 332 | ];
|
332 333 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
|
333 334 | let body = http_request.body().bytes().expect("body should be strict");
|
334 335 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
|
335 336 | body,
|
336 337 | "hello world",
|
337 338 | ::aws_smithy_protocol_test::MediaType::from("unknown"),
|
338 339 | ));
|
339 340 | let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
|
340 341 | ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
|
341 342 | ::pretty_assertions::assert_eq!(uri.path(), "/foo/vaults/bar/archives", "path was incorrect");
|
342 343 | }
|
343 344 | /// Glacier requires that the account id be set, but you can just use a
|
344 345 | /// hyphen (-) to indicate the current account. This should be default
|
345 346 | /// behavior if the customer provides a null or empty string.
|
346 347 | /// Test ID: GlacierAccountIdEmpty
|
347 348 | #[::tokio::test]
|
348 - | #[allow(unused_mut)]
|
349 + | #[::tracing_test::traced_test]
|
349 350 | async fn glacier_account_id_empty_request() {
|
350 351 | let (http_client, request_receiver) = ::aws_smithy_runtime::client::http::test_util::capture_request(None);
|
351 352 | let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
|
352 353 | let config_builder = config_builder.region(::aws_types::region::Region::new("us-east-1"));
|
353 354 | let mut config_builder = config_builder;
|
354 355 | config_builder.set_region(Some(crate::config::Region::new("us-east-1")));
|
355 356 |
|
356 357 | let config = config_builder.http_client(http_client).build();
|
357 358 | let client = crate::Client::from_conf(config);
|
358 359 | let result = client
|
359 360 | .upload_archive()
|
360 361 | .set_account_id(::std::option::Option::Some("".to_owned()))
|
361 362 | .set_vault_name(::std::option::Option::Some("bar".to_owned()))
|
362 363 | .send()
|
363 364 | .await;
|
364 365 | let _ = dbg!(result);
|
365 366 | let http_request = request_receiver.expect_request();
|
366 367 | let expected_headers = [("X-Amz-Glacier-Version", "2012-06-01")];
|
367 368 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
|
368 369 | let body = http_request.body().bytes().expect("body should be strict");
|
369 370 | // No body
|
370 371 | ::pretty_assertions::assert_eq!(::std::str::from_utf8(body).unwrap(), "");
|
371 372 | let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
|
372 373 | ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
|
373 374 | ::pretty_assertions::assert_eq!(uri.path(), "/-/vaults/bar/archives", "path was incorrect");
|
374 375 | }
|
375 376 | /// Glacier requires that the account id be set, but you can just use a
|
376 377 | /// hyphen (-) to indicate the current account. This should be default
|
377 378 | /// behavior if the customer provides a null or empty string.
|
378 379 | /// Test ID: GlacierAccountIdUnset
|
379 380 | #[::tokio::test]
|
380 - | #[allow(unused_mut)]
|
381 + | #[::tracing_test::traced_test]
|
381 382 | async fn glacier_account_id_unset_request() {
|
382 383 | let (http_client, request_receiver) = ::aws_smithy_runtime::client::http::test_util::capture_request(None);
|
383 384 | let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
|
384 385 | let config_builder = config_builder.region(::aws_types::region::Region::new("us-east-1"));
|
385 386 | let mut config_builder = config_builder;
|
386 387 | config_builder.set_region(Some(crate::config::Region::new("us-east-1")));
|
387 388 |
|
388 389 | let config = config_builder.http_client(http_client).build();
|
389 390 | let client = crate::Client::from_conf(config);
|
390 391 | let result = client
|