Skip to content

Commit

Permalink
Please clippy.
Browse files Browse the repository at this point in the history
  • Loading branch information
fmassot committed Dec 4, 2023
1 parent 63d2e33 commit d612dc8
Showing 1 changed file with 27 additions and 7 deletions.
34 changes: 27 additions & 7 deletions quickwit/quickwit-serve/src/rest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -321,9 +321,11 @@ mod tests {
use std::pin::Pin;
use std::task::{Context, Poll};

use async_trait::async_trait;
use http::HeaderName;
use hyper::{Request, Response, StatusCode};
use quickwit_cluster::{create_cluster_for_test, ChannelTransport};
use quickwit_common::pubsub::{Event, EventBroker, EventSubscriber};
use quickwit_config::NodeConfig;
use quickwit_index_management::IndexService;
use quickwit_ingest::{IngestApiService, IngestServiceClient};
Expand Down Expand Up @@ -554,6 +556,21 @@ mod tests {
}
}

#[derive(Debug, Clone)]
struct MyEvent;

impl Event for MyEvent {}

#[derive(Debug, Clone)]
struct MySubscriber;

#[async_trait]
impl EventSubscriber<MyEvent> for MySubscriber {
async fn handle_event(&mut self, _event: MyEvent) {
// Do nothing.
}
}

#[tokio::test]
async fn test_additional_headers() {
let mut node_config = NodeConfig::for_test();
Expand All @@ -574,22 +591,25 @@ mod tests {
let cluster = create_cluster_for_test(Vec::new(), &[], &transport, false)
.await
.unwrap();
let event_broker = EventBroker::default();
let subscription_handle = event_broker.subscribe(MySubscriber);
let quickwit_services = QuickwitServices {
_report_splits_subscription_handle_opt: Some(subscription_handle),
cluster,
_report_splits_subscription_handle_opt: None,
control_plane_service,
ingester_service_opt: None,
metastore_server_opt: None,
index_manager: index_service,
indexing_service_opt: None,
janitor_service_opt: None,
search_service: Arc::new(MockSearchService::new()),
index_manager: index_service,
ingest_service: ingest_service_client(),

ingester_service_opt: None,
ingest_router_service: IngestRouterServiceClient::from(
IngestRouterServiceClient::mock(),
),
ingest_service: ingest_service_client(),
janitor_service_opt: None,
metastore_client,
metastore_server_opt: None,
node_config: Arc::new(node_config.clone()),
search_service: Arc::new(MockSearchService::new()),
};
let handler = api_v1_routes(Arc::new(quickwit_services));
let resp = warp::test::request()
Expand Down

0 comments on commit d612dc8

Please sign in to comment.