aboutsummaryrefslogtreecommitdiff
path: root/src/garage/tests/k2v/item.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2024-02-05 14:44:12 +0100
committerAlex Auvolat <alex@adnab.me>2024-02-05 14:44:12 +0100
commit6e69a1fffc715c752a399750c1e26aa46683dbb2 (patch)
treed1539c6107372f14aa6ca09255977df69411a553 /src/garage/tests/k2v/item.rs
parent6e4229e29c1ee3e0b7f3511f80b6108e3beb1efd (diff)
downloadgarage-6e69a1fffc715c752a399750c1e26aa46683dbb2.tar.gz
garage-6e69a1fffc715c752a399750c1e26aa46683dbb2.zip
[dep-upgrade-202402] prepare migration to http/hyper 1.0
Diffstat (limited to 'src/garage/tests/k2v/item.rs')
-rw-r--r--src/garage/tests/k2v/item.rs22
1 files changed, 5 insertions, 17 deletions
diff --git a/src/garage/tests/k2v/item.rs b/src/garage/tests/k2v/item.rs
index 20add889..6b653088 100644
--- a/src/garage/tests/k2v/item.rs
+++ b/src/garage/tests/k2v/item.rs
@@ -7,7 +7,7 @@ use base64::prelude::*;
use serde_json::json;
use crate::json_body;
-use hyper::{Method, StatusCode};
+use hyper::{body::HttpBody, Method, StatusCode};
#[tokio::test]
async fn test_items_and_indices() {
@@ -83,10 +83,7 @@ async fn test_items_and_indices() {
.to_str()
.unwrap()
.to_string();
- let res_body = hyper::body::to_bytes(res.into_body())
- .await
- .unwrap()
- .to_vec();
+ let res_body = res.into_body().collect().await.unwrap().to_bytes();
assert_eq!(res_body, content);
// ReadIndex -- now there should be some stuff
@@ -152,10 +149,7 @@ async fn test_items_and_indices() {
res.headers().get("content-type").unwrap().to_str().unwrap(),
"application/octet-stream"
);
- let res_body = hyper::body::to_bytes(res.into_body())
- .await
- .unwrap()
- .to_vec();
+ let res_body = res.into_body().collect().await.unwrap().to_bytes();
assert_eq!(res_body, content2);
// ReadIndex -- now there should be some stuff
@@ -394,10 +388,7 @@ async fn test_item_return_format() {
.to_str()
.unwrap()
.to_string();
- let res_body = hyper::body::to_bytes(res.into_body())
- .await
- .unwrap()
- .to_vec();
+ let res_body = res.into_body().collect().await.unwrap().to_bytes();
assert_eq!(res_body, single_value);
// f1: not specified
@@ -434,10 +425,7 @@ async fn test_item_return_format() {
res.headers().get("content-type").unwrap().to_str().unwrap(),
"application/octet-stream"
);
- let res_body = hyper::body::to_bytes(res.into_body())
- .await
- .unwrap()
- .to_vec();
+ let res_body = res.into_body().collect().await.unwrap().to_bytes();
assert_eq!(res_body, single_value);
// f3: json