Skip to content

Commit ccfce64

Browse files
committed
Use yaml_from_str_singleton_map
1 parent f3b0540 commit ccfce64

2 files changed

Lines changed: 5 additions & 6 deletions

File tree

rust/operator-binary/src/config/jvm.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@ fn is_heap_jvm_argument(jvm_argument: &str) -> bool {
9595

9696
#[cfg(test)]
9797
mod tests {
98+
use stackable_operator::utils::yaml_from_str_singleton_map;
99+
98100
use super::*;
99101
use crate::crd::HiveRole;
100102

@@ -192,10 +194,8 @@ mod tests {
192194
Role<MetaStoreConfigFragment, HiveMetastoreRoleConfig, JavaCommonConfig>,
193195
String,
194196
) {
195-
let deserializer = serde_yaml::Deserializer::from_str(hive_cluster);
196197
let hive: HiveCluster =
197-
serde_yaml::with::singleton_map_recursive::deserialize(deserializer)
198-
.expect("invalid test input");
198+
yaml_from_str_singleton_map(hive_cluster).expect("invalid test input");
199199

200200
let hive_role = HiveRole::MetaStore;
201201
let rolegroup_ref = hive.metastore_rolegroup_ref("default");

rust/operator-binary/src/crd/affinity.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ mod tests {
3030
api::core::v1::{PodAffinityTerm, PodAntiAffinity, WeightedPodAffinityTerm},
3131
apimachinery::pkg::apis::meta::v1::LabelSelector,
3232
},
33+
utils::yaml_from_str_singleton_map,
3334
};
3435

3536
use super::*;
@@ -54,10 +55,8 @@ mod tests {
5455
default:
5556
replicas: 1
5657
"#;
57-
let deserializer = serde_yaml::Deserializer::from_str(input);
5858
let hive: v1alpha1::HiveCluster =
59-
serde_yaml::with::singleton_map_recursive::deserialize(deserializer)
60-
.expect("invalid test input");
59+
yaml_from_str_singleton_map(input).expect("invalid test input");
6160
let merged_config = hive
6261
.merged_config(&role, &role.rolegroup_ref(&hive, "default"))
6362
.unwrap();

0 commit comments

Comments
 (0)