use std::collections::HashMap;
mod test_get_feature;
mod test_get_feature_ids;
mod test_get_property;
mod test_get_property_ids;
mod test_using_example_data;
use crate::client::cache::ConfigurationSnapshot;
use crate::client::AppConfigurationClientIBMCloud;
use crate::models::tests::example_configuration_enterprise;
use crate::models::Configuration;
use crate::Entity;
use crate::Value;
use rstest::fixture;
use std::sync::{Arc, Mutex};
pub struct TrivialEntity;
impl Entity for TrivialEntity {
fn get_id(&self) -> String {
"TrivialId".into()
}
fn get_attributes(&self) -> HashMap<String, Value> {
HashMap::new()
}
}
pub struct GenericEntity {
pub id: String,
pub attributes: HashMap<String, Value>,
}
impl Entity for GenericEntity {
fn get_id(&self) -> String {
self.id.clone()
}
fn get_attributes(&self) -> HashMap<String, Value> {
self.attributes.clone()
}
}
#[fixture]
fn client_enterprise(
example_configuration_enterprise: Configuration,
) -> AppConfigurationClientIBMCloud {
let configuration_snapshot =
ConfigurationSnapshot::new("dev", example_configuration_enterprise).unwrap();
let (sender, _) = std::sync::mpsc::channel();
AppConfigurationClientIBMCloud {
latest_config_snapshot: Arc::new(Mutex::new(configuration_snapshot)),
_thread_terminator: sender,
}
}