diff --git a/meilisearch-http/tests/documents/add_documents.rs b/meilisearch-http/tests/documents/add_documents.rs index c64880cf5..3b2f9c9ee 100644 --- a/meilisearch-http/tests/documents/add_documents.rs +++ b/meilisearch-http/tests/documents/add_documents.rs @@ -2,7 +2,6 @@ use crate::common::{GetAllDocumentsOptions, Server}; use actix_web::test; use crate::common::encoder::Encoder; -use meilisearch_http::{analytics, create_app}; use serde_json::{json, Value}; use time::{format_description::well_known::Rfc3339, OffsetDateTime}; @@ -96,14 +95,7 @@ async fn add_single_document_gzip_encoded() { // this is a what is expected and should work let server = Server::new().await; - let app = test::init_service(create_app!( - &server.service.meilisearch, - &server.service.auth, - true, - server.service.options, - analytics::MockAnalytics::new(&server.service.options).0 - )) - .await; + let app = server.init_web_app().await; // post let document = serde_json::to_string(&document).unwrap(); let encoder = Encoder::Gzip; @@ -145,14 +137,7 @@ async fn add_single_document_with_every_encoding() { // this is a what is expected and should work let server = Server::new().await; - let app = test::init_service(create_app!( - &server.service.meilisearch, - &server.service.auth, - true, - server.service.options, - analytics::MockAnalytics::new(&server.service.options).0 - )) - .await; + let app = server.init_web_app().await; // post let document = serde_json::to_string(&document).unwrap(); diff --git a/meilisearch-http/tests/documents/get_documents.rs b/meilisearch-http/tests/documents/get_documents.rs index f3a25e720..1e31bc5a9 100644 --- a/meilisearch-http/tests/documents/get_documents.rs +++ b/meilisearch-http/tests/documents/get_documents.rs @@ -3,7 +3,6 @@ use actix_web::test; use http::header::ACCEPT_ENCODING; use crate::common::encoder::Encoder; -use meilisearch_http::{analytics, create_app}; use serde_json::{json, Value}; use urlencoding::encode as urlencode; @@ -167,15 +166,7 @@ async fn get_all_documents_no_options_with_response_compression() { let index = server.index(index_uid); index.load_test_set().await; - let app = test::init_service(create_app!( - &server.service.meilisearch, - &server.service.auth, - true, - server.service.options, - analytics::MockAnalytics::new(&server.service.options).0 - )) - .await; - + let app = server.init_web_app().await; let req = test::TestRequest::get() .uri(&format!("/indexes/{}/documents?", urlencode(index_uid))) .insert_header((ACCEPT_ENCODING, "gzip")) diff --git a/meilisearch-http/tests/index/create_index.rs b/meilisearch-http/tests/index/create_index.rs index 30040abfe..a05499daa 100644 --- a/meilisearch-http/tests/index/create_index.rs +++ b/meilisearch-http/tests/index/create_index.rs @@ -3,7 +3,6 @@ use crate::common::Server; use actix_web::http::header::ContentType; use actix_web::test; use http::header::ACCEPT_ENCODING; -use meilisearch_http::{analytics, create_app}; use serde_json::{json, Value}; #[actix_rt::test] @@ -43,14 +42,7 @@ async fn create_index_with_gzip_encoded_request() { #[actix_rt::test] async fn create_index_with_gzip_encoded_request_and_receiving_brotli_encoded_response() { let server = Server::new().await; - let app = test::init_service(create_app!( - &server.service.meilisearch, - &server.service.auth, - true, - server.service.options, - analytics::MockAnalytics::new(&server.service.options).0 - )) - .await; + let app = server.init_web_app().await; let body = serde_json::to_string(&json!({ "uid": "test", diff --git a/meilisearch-http/tests/integration.rs b/meilisearch-http/tests/integration.rs index de7379d55..25b4e49b6 100644 --- a/meilisearch-http/tests/integration.rs +++ b/meilisearch-http/tests/integration.rs @@ -1,5 +1,3 @@ -use meilisearch_http::analytics; - mod auth; mod common; mod dashboard;