Skip to content

Commit

Permalink
fix(brokers/natsjetstream): fix tests (#243)
Browse files Browse the repository at this point in the history
  • Loading branch information
lerenn authored Jul 1, 2024
1 parent 14e42a7 commit 07c6cf7
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions pkg/extensions/brokers/natsjetstream/natsjetstream_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,9 @@ func TestSecureConnectionToNATSJetstream(t *testing.T) {
Name: subj,
Subjects: []string{subj},
}),
WithConsumerConfig(jetstream.ConsumerConfig{Name: "secureConnectTestWithoutTLSConfig"}),
WithConsumerConfig(jetstream.ConsumerConfig{
Name: subj,
}),
)
assert.Error(t, err, "new connection to TLS secured NATS broker without TLS config should return a error")
})
Expand All @@ -123,7 +125,9 @@ func TestSecureConnectionToNATSJetstream(t *testing.T) {
Name: subj,
Subjects: []string{subj},
}),
WithConsumerConfig(jetstream.ConsumerConfig{Name: "secureConnectTestWithoutTLSConfig"}),
WithConsumerConfig(jetstream.ConsumerConfig{
Name: subj,
}),
WithConnectionOpts(nats.Secure(tlsConfig)),
)
assert.NoError(t, err,
Expand All @@ -146,7 +150,9 @@ func TestSecureConnectionToNATSJetstream(t *testing.T) {
Name: subj,
Subjects: []string{subj},
}),
WithConsumerConfig(jetstream.ConsumerConfig{Name: "secureConnectTestWithTLSConfigAndMissingBasicAuth"}),
WithConsumerConfig(jetstream.ConsumerConfig{
Name: subj,
}),
WithConnectionOpts(nats.Secure(tlsConfig)),
)
assert.Error(t, err,
Expand All @@ -168,7 +174,9 @@ func TestSecureConnectionToNATSJetstream(t *testing.T) {
Name: subj,
Subjects: []string{subj},
}),
WithConsumerConfig(jetstream.ConsumerConfig{Name: "secureConnectTestWithTLSConfigAndMissingBasicAuth"}),
WithConsumerConfig(jetstream.ConsumerConfig{
Name: subj,
}),
WithConnectionOpts(
nats.Secure(tlsConfig),
nats.UserInfo("user", "password"),
Expand Down

0 comments on commit 07c6cf7

Please sign in to comment.