use nvd_cve::client::{BlockingHttpClient, HttpError}; use nvd_cve::cve::CveFeed; use std::time::Duration; pub struct MockBlockingClient { pub get_metafile_response: Result, pub get_feed_response: Result, } impl BlockingHttpClient for MockBlockingClient { fn new>( _: S, _: Option, _: Option, _: Option, ) -> Self { Self { get_metafile_response: Err(HttpError::ParseError), get_feed_response: Err(HttpError::ParseError), } } fn get_metafile(&self, _: &str) -> Result { self.get_metafile_response.clone() } fn get_feed(&self, _: &str) -> Result { self.get_feed_response.clone() } } impl Default for MockBlockingClient { fn default() -> Self { Self::new("http://127.0.0.1/nvd/feeds/json/cve/1.1/", None, None, None) } }