@@ -32,8 +32,9 @@ pub fn tls_default() -> Option<String> {
3232#[ cfg( test) ]
3333mod tests {
3434 use indoc:: formatdoc;
35+ use stackable_operator:: utils:: yaml_from_str_singleton_map;
3536
36- use crate :: crd:: { tests :: deserialize_yaml_str , tls:: DruidTls , v1alpha1:: DruidClusterConfig } ;
37+ use crate :: crd:: { tls:: DruidTls , v1alpha1:: DruidClusterConfig } ;
3738
3839 const BASE_DRUID_CONFIGURATION : & str = r#"
3940deepStorage:
@@ -50,8 +51,8 @@ zookeeperConfigMapName: zk-config-map
5051
5152 #[ test]
5253 fn test_tls_default ( ) {
53- let druid_cluster_config =
54- deserialize_yaml_str :: < DruidClusterConfig > ( BASE_DRUID_CONFIGURATION ) ;
54+ let druid_cluster_config: DruidClusterConfig =
55+ yaml_from_str_singleton_map ( BASE_DRUID_CONFIGURATION ) . expect ( "failed to parse YAML" ) ;
5556
5657 assert_eq ! (
5758 druid_cluster_config. tls,
@@ -69,8 +70,8 @@ zookeeperConfigMapName: zk-config-map
6970 tls:
7071 serverAndInternalSecretClass: druid-secret-class
7172 " } ;
72- dbg ! ( & input ) ;
73- let druid_cluster_config = deserialize_yaml_str :: < DruidClusterConfig > ( & input) ;
73+ let druid_cluster_config : DruidClusterConfig =
74+ yaml_from_str_singleton_map ( & input) . expect ( "failed to parse YAML" ) ;
7475
7576 assert_eq ! (
7677 druid_cluster_config. tls,
@@ -87,8 +88,8 @@ zookeeperConfigMapName: zk-config-map
8788 {BASE_DRUID_CONFIGURATION}
8889 tls: null
8990 " } ;
90- dbg ! ( & input ) ;
91- let druid_cluster_config = deserialize_yaml_str :: < DruidClusterConfig > ( & input) ;
91+ let druid_cluster_config : DruidClusterConfig =
92+ yaml_from_str_singleton_map ( & input) . expect ( "failed to parse YAML" ) ;
9293
9394 assert_eq ! ( druid_cluster_config. tls, None , ) ;
9495 assert_eq ! ( druid_cluster_config. authentication, vec![ ] ) ;
@@ -101,8 +102,8 @@ zookeeperConfigMapName: zk-config-map
101102 tls:
102103 serverAndInternalSecretClass: null
103104 " } ;
104- dbg ! ( & input ) ;
105- let druid_cluster_config = deserialize_yaml_str :: < DruidClusterConfig > ( & input) ;
105+ let druid_cluster_config : DruidClusterConfig =
106+ yaml_from_str_singleton_map ( & input) . expect ( "failed to parse YAML" ) ;
106107
107108 assert_eq ! (
108109 druid_cluster_config. tls,
@@ -122,8 +123,8 @@ zookeeperConfigMapName: zk-config-map
122123 authentication:
123124 - authenticationClass: druid-user-authentication-class
124125 " } ;
125- dbg ! ( & input ) ;
126- let druid_cluster_config = deserialize_yaml_str :: < DruidClusterConfig > ( & input) ;
126+ let druid_cluster_config : DruidClusterConfig =
127+ yaml_from_str_singleton_map ( & input) . expect ( "failed to parse YAML" ) ;
127128
128129 assert_eq ! (
129130 druid_cluster_config. tls,
0 commit comments