make the tests compile again

This commit is contained in:
Tamo
2022-10-18 15:14:18 +02:00
committed by Clément Renault
parent b45c430165
commit f7e546eea3
6 changed files with 65 additions and 155 deletions

View File

@ -1,3 +1,5 @@
use std::sync::Arc;
use actix_web::http::header::ContentType;
use actix_web::test::TestRequest;
use actix_web::{http::StatusCode, test};
@ -9,7 +11,7 @@ use crate::common::encoder::Encoder;
use meilisearch_http::{analytics, create_app, Opt};
pub struct Service {
pub index_scheduler: IndexScheduler,
pub index_scheduler: Arc<IndexScheduler>,
pub auth: AuthController,
pub options: Opt,
pub api_key: Option<String>,
@ -85,12 +87,12 @@ impl Service {
}
pub async fn request(&self, mut req: test::TestRequest) -> (Value, StatusCode) {
let app = test::init_service(create_app!(
&self.meilisearch,
&self.auth,
let app = test::init_service(create_app(
self.index_scheduler.clone().into(),
self.auth.clone(),
self.options.clone(),
analytics::MockAnalytics::new(&self.options),
true,
self.options,
analytics::MockAnalytics::new(&self.options).0
))
.await;