aboutsummaryrefslogtreecommitdiff
path: root/src/garage/tests/k2v/errorcodes.rs
diff options
context:
space:
mode:
authorTobias Krischer <tobias.krischer@elyxon.de>2022-10-16 19:46:15 +0200
committerTobias Krischer <tobias.krischer@elyxon.de>2022-10-17 10:55:26 +0200
commit786500332341c8e39f7e3e82e493e567ecaa70e4 (patch)
tree805e6ca8d90d177410d1610f9086bab7194f8e6e /src/garage/tests/k2v/errorcodes.rs
parent4582a8f34aba85ff7b0a56935f27cc166819dec1 (diff)
downloadgarage-786500332341c8e39f7e3e82e493e567ecaa70e4.tar.gz
garage-786500332341c8e39f7e3e82e493e567ecaa70e4.zip
Use status code 204 No Content for empty responses
Diffstat (limited to 'src/garage/tests/k2v/errorcodes.rs')
-rw-r--r--src/garage/tests/k2v/errorcodes.rs20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/garage/tests/k2v/errorcodes.rs b/src/garage/tests/k2v/errorcodes.rs
index 2fcc45bc..ecb84729 100644
--- a/src/garage/tests/k2v/errorcodes.rs
+++ b/src/garage/tests/k2v/errorcodes.rs
@@ -1,13 +1,13 @@
use crate::common;
-use hyper::Method;
+use hyper::{Method, StatusCode};
#[tokio::test]
async fn test_error_codes() {
let ctx = common::context();
let bucket = ctx.create_bucket("test-k2v-error-codes");
- // Regular insert should work (code 200)
+ // Regular insert should work (code 204)
let res = ctx
.k2v
.request
@@ -19,7 +19,7 @@ async fn test_error_codes() {
.send()
.await
.unwrap();
- assert_eq!(res.status(), 200);
+ assert_eq!(res.status(), StatusCode::NO_CONTENT);
// Insert with trash causality token: invalid request
let res = ctx
@@ -34,7 +34,7 @@ async fn test_error_codes() {
.send()
.await
.unwrap();
- assert_eq!(res.status(), 400);
+ assert_eq!(res.status(), StatusCode::BAD_REQUEST);
// Search without partition key: invalid request
let res = ctx
@@ -52,7 +52,7 @@ async fn test_error_codes() {
.send()
.await
.unwrap();
- assert_eq!(res.status(), 400);
+ assert_eq!(res.status(), StatusCode::BAD_REQUEST);
// Search with start that is not in prefix: invalid request
let res = ctx
@@ -70,7 +70,7 @@ async fn test_error_codes() {
.send()
.await
.unwrap();
- assert_eq!(res.status(), 400);
+ assert_eq!(res.status(), StatusCode::BAD_REQUEST);
// Search with invalid json: 400
let res = ctx
@@ -88,7 +88,7 @@ async fn test_error_codes() {
.send()
.await
.unwrap();
- assert_eq!(res.status(), 400);
+ assert_eq!(res.status(), StatusCode::BAD_REQUEST);
// Batch insert with invalid causality token: 400
let res = ctx
@@ -105,7 +105,7 @@ async fn test_error_codes() {
.send()
.await
.unwrap();
- assert_eq!(res.status(), 400);
+ assert_eq!(res.status(), StatusCode::BAD_REQUEST);
// Batch insert with invalid data: 400
let res = ctx
@@ -122,7 +122,7 @@ async fn test_error_codes() {
.send()
.await
.unwrap();
- assert_eq!(res.status(), 400);
+ assert_eq!(res.status(), StatusCode::BAD_REQUEST);
// Poll with invalid causality token: 400
let res = ctx
@@ -137,5 +137,5 @@ async fn test_error_codes() {
.send()
.await
.unwrap();
- assert_eq!(res.status(), 400);
+ assert_eq!(res.status(), StatusCode::BAD_REQUEST);
}