1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
mod config;
mod sink;

pub use config::BlackholeConfig;

#[cfg(test)]
mod tests {

    use std::time::Duration;

    use crate::{
        sinks::{
            blackhole::{config::BlackholeConfig, sink::BlackholeSink},
            VectorSink,
        },
        test_util::{
            components::run_and_assert_nonsending_sink_compliance, random_events_with_stream,
        },
    };

    #[tokio::test]
    async fn blackhole() {
        let config = BlackholeConfig {
            print_interval_secs: Duration::from_secs(10),
            rate: None,
            acknowledgements: Default::default(),
        };
        let sink = BlackholeSink::new(config);
        let sink = VectorSink::Stream(Box::new(sink));

        let (_input_lines, events) = random_events_with_stream(100, 10, None);
        run_and_assert_nonsending_sink_compliance(sink, events, &[]).await;
    }
}