💄 move getTlsConfig to configuration pkg

This commit is contained in:
Max Lerebourg
2022-12-05 08:10:56 +01:00
parent a17e082ba3
commit 1f094d818a
4 changed files with 75 additions and 76 deletions
+28
View File
@@ -1,7 +1,9 @@
package configuration
import (
"crypto/tls"
"testing"
"reflect"
)
func getMinimalConfig() *Config {
@@ -182,3 +184,29 @@ func Test_validateParamsRequired(t *testing.T) {
})
}
}
func Test_GetTLSConfigCrowdsec(t *testing.T) {
type args struct {
config *Config
}
tests := []struct {
name string
args args
want *tls.Config
wantErr bool
}{
// TODO: Add test cases.
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
got, err := GetTLSConfigCrowdsec(tt.args.config)
if (err != nil) != tt.wantErr {
t.Errorf("getTLSConfigCrowdsec() error = %v, wantErr %v", err, tt.wantErr)
return
}
if !reflect.DeepEqual(got, tt.want) {
t.Errorf("getTLSConfigCrowdsec() = %v, want %v", got, tt.want)
}
})
}
}