File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -95,3 +95,45 @@ func TestUpdateBridgeConfigForConnector(t *testing.T) {
9595 })
9696 }
9797}
98+
99+ func TestGetSslProfileName (t * testing.T ) {
100+ tests := []struct {
101+ name string
102+ tlsCredentials string
103+ useClientCert bool
104+ expected string
105+ }{
106+ {
107+ name : "no tls credentials" ,
108+ tlsCredentials : "" ,
109+ useClientCert : false ,
110+ expected : "" ,
111+ },
112+ {
113+ name : "no tls credentials with client cert" ,
114+ tlsCredentials : "" ,
115+ useClientCert : true ,
116+ expected : "" ,
117+ },
118+ {
119+ name : "with tls credentials without client cert" ,
120+ tlsCredentials : "tls-secret" ,
121+ useClientCert : false ,
122+ expected : "tls-secret-profile" ,
123+ },
124+ {
125+ name : "with tls credentials with client cert" ,
126+ tlsCredentials : "tls-secret" ,
127+ useClientCert : true ,
128+ expected : "tls-secret" ,
129+ },
130+ }
131+ for _ , tt := range tests {
132+ t .Run (tt .name , func (t * testing.T ) {
133+ result := GetSslProfileName (tt .tlsCredentials , tt .useClientCert )
134+ if result != tt .expected {
135+ t .Errorf ("got %q, want %q" , result , tt .expected )
136+ }
137+ })
138+ }
139+ }
You can’t perform that action at this time.
0 commit comments