Skip to content

Commit 64ac675

Browse files
authored
Add test for IAM mechanism without usr/pwd credentials
1 parent 2d9bd73 commit 64ac675

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

exporter/kafkaexporter/config_test.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,22 @@ func TestValidate_sasl_version(t *testing.T) {
294294
assert.EqualError(t, err, "auth.sasl.version has to be either 0 or 1. configured value 42")
295295
}
296296

297+
func TestValidate_sasl_iam(t *testing.T) {
298+
config := &Config{
299+
Producer: Producer{
300+
Compression: "none",
301+
},
302+
Authentication: kafka.Authentication{
303+
SASL: &kafka.SASLConfig{
304+
Mechanism: "AWS_MSK_IAM",
305+
},
306+
},
307+
}
308+
309+
err := config.Validate()
310+
assert.Equal(t, err, nil)
311+
}
312+
297313
func Test_saramaProducerCompressionCodec(t *testing.T) {
298314
tests := map[string]struct {
299315
compression string

0 commit comments

Comments
 (0)