File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed
crates/stackable-operator/src/utils Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -46,3 +46,29 @@ impl KubernetesClusterInfo {
4646 Self { cluster_domain }
4747 }
4848}
49+
50+ #[ cfg( test) ]
51+ mod test {
52+ use rstest:: rstest;
53+
54+ use super :: * ;
55+
56+ #[ rstest]
57+ #[ case( None , KUBERNETES_CLUSTER_DOMAIN_DEFAULT ) ]
58+ #[ case( Some ( "example.com" . parse( ) . unwrap( ) ) , "example.com." ) ]
59+ fn test_kubernetes_cluster_info_creation (
60+ #[ case] kubernetes_cluster_domain : Option < DomainName > ,
61+ #[ case] expected_cluster_domain : & str ,
62+ ) {
63+ let opts = KubernetesClusterInfoOpts {
64+ kubernetes_cluster_domain,
65+ } ;
66+
67+ let cluster_info = KubernetesClusterInfo :: new ( & opts) ;
68+
69+ assert_eq ! (
70+ cluster_info. cluster_domain,
71+ DomainName :: from_str( expected_cluster_domain) . unwrap( )
72+ ) ;
73+ }
74+ }
You can’t perform that action at this time.
0 commit comments