Use a unique name for an index in a shared server

Signed-off-by: Martin Tzvetanov Grigorov <mgrigorov@apache.org>
This commit is contained in:
Martin Tzvetanov Grigorov 2025-06-14 15:10:48 +03:00
parent 0598320252
commit 95e8a9bef1
No known key found for this signature in database
GPG Key ID: 3194FD8C1AE300EF

View File

@ -46,8 +46,10 @@ async fn create_index_with_gzip_encoded_request_and_receiving_brotli_encoded_res
let server = Server::new_shared(); let server = Server::new_shared();
let app = server.init_web_app().await; let app = server.init_web_app().await;
let index = server.unique_index_with_prefix("test");
let body = serde_json::to_string(&json!({ let body = serde_json::to_string(&json!({
"uid": "test", "uid": index.uid.clone(),
"primaryKey": None::<&str>, "primaryKey": None::<&str>,
})) }))
.unwrap(); .unwrap();
@ -68,7 +70,7 @@ async fn create_index_with_gzip_encoded_request_and_receiving_brotli_encoded_res
let parsed_response = let parsed_response =
serde_json::from_slice::<Value>(decoded.into().as_ref()).expect("Expecting valid json"); serde_json::from_slice::<Value>(decoded.into().as_ref()).expect("Expecting valid json");
assert_eq!(parsed_response["indexUid"], "test"); assert_eq!(parsed_response["indexUid"], index.uid);
} }
#[actix_rt::test] #[actix_rt::test]