aboutsummaryrefslogtreecommitdiff
path: root/src/garage/tests/k2v/item.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2024-02-13 11:24:56 +0100
committerAlex Auvolat <alex@adnab.me>2024-02-13 11:36:28 +0100
commitcf2af186fcc0c8f581a966454b6cd4720d3821f0 (patch)
tree37a978ba9ffb780fc828cff7b8ec93662d50884f /src/garage/tests/k2v/item.rs
parentdb48dd3d6c1f9e86a62e9b8edfce2c1620bcd5f3 (diff)
parent823078b4cdaf93e09de0847c5eaa75beb7b26b7f (diff)
downloadgarage-cf2af186fcc0c8f581a966454b6cd4720d3821f0.tar.gz
garage-cf2af186fcc0c8f581a966454b6cd4720d3821f0.zip
Merge branch 'main' into next-0.10
Diffstat (limited to 'src/garage/tests/k2v/item.rs')
-rw-r--r--src/garage/tests/k2v/item.rs21
1 files changed, 5 insertions, 16 deletions
diff --git a/src/garage/tests/k2v/item.rs b/src/garage/tests/k2v/item.rs
index 20add889..5a347bd9 100644
--- a/src/garage/tests/k2v/item.rs
+++ b/src/garage/tests/k2v/item.rs
@@ -7,6 +7,7 @@ use base64::prelude::*;
use serde_json::json;
use crate::json_body;
+use http_body_util::BodyExt;
use hyper::{Method, StatusCode};
#[tokio::test]
@@ -83,10 +84,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 +150,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 +389,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 +426,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