Skip to content

Commit

Permalink
Aerospike Module: Fix unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
herrBez committed Feb 23, 2024
1 parent 59df82f commit 8965a52
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions metricbeat/module/aerospike/aerospike_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
package aerospike

import (
"crypto/tls"
"errors"
"fmt"
"testing"
Expand Down Expand Up @@ -118,7 +117,8 @@ func TestParseClientPolicy(t *testing.T) {
UserPasswordClientPolicy.Password = samplePassword

TLSPolicy := as.NewClientPolicy()
TLSPolicy.TlsConfig = &tls.Config{}
tlsconfig, _ := tlscommon.LoadTLSConfig(&tlscommon.Config{Enabled: getBoolPointer(true)})
TLSPolicy.TlsConfig = tlsconfig.ToConfig()

ClusterNamePolicy := as.NewClientPolicy()
ClusterNamePolicy.ClusterName = sampleClusterName
Expand Down Expand Up @@ -167,7 +167,6 @@ func TestParseClientPolicy(t *testing.T) {
Enabled: getBoolPointer(true),
},
},

expectedClientPolicy: TLSPolicy,
expectedErr: nil,
},
Expand All @@ -193,8 +192,9 @@ func TestParseClientPolicy(t *testing.T) {
}
assert.Equal(t, test.expectedClientPolicy.User, result.User, test.Name)
assert.Equal(t, test.expectedClientPolicy.Password, result.Password, test.Name)
assert.Equal(t, test.expectedClientPolicy.ClusterName, result.ClusterName, test.Name)
if test.Config.TLS.IsEnabled() {
assert.NotNil(t, test.expectedClientPolicy.TlsConfig)
assert.NotNil(t, result.TlsConfig)
}
}
}

0 comments on commit 8965a52

Please sign in to comment.