Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertIndie committed Dec 17, 2024
1 parent 823d692 commit ac41379
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
5 changes: 3 additions & 2 deletions pulsar/consumer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@ func TestProducerConsumer(t *testing.T) {

func TestConsumerConnectError(t *testing.T) {
client, err := NewClient(ClientOptions{
URL: "pulsar://invalid-hostname:6650",
URL: "pulsar://invalid-hostname:6650",
OperationTimeout: 5 * time.Second,
})

assert.Nil(t, err)
Expand All @@ -137,7 +138,7 @@ func TestConsumerConnectError(t *testing.T) {
assert.Nil(t, consumer)
assert.NotNil(t, err)

assert.ErrorContains(t, err, "connection error")
assert.ErrorContains(t, err, "failed to connect to broker")
}

func TestBatchMessageReceive(t *testing.T) {
Expand Down
5 changes: 3 additions & 2 deletions pulsar/producer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ func TestInvalidURL(t *testing.T) {

func TestProducerConnectError(t *testing.T) {
client, err := NewClient(ClientOptions{
URL: "pulsar://invalid-hostname:6650",
URL: "pulsar://invalid-hostname:6650",
OperationTimeout: 5 * time.Second,
})

assert.Nil(t, err)
Expand All @@ -73,7 +74,7 @@ func TestProducerConnectError(t *testing.T) {
assert.Nil(t, producer)
assert.NotNil(t, err)

assert.ErrorContains(t, err, "connection error")
assert.ErrorContains(t, err, "failed to connect to broker")
}

func TestProducerNoTopic(t *testing.T) {
Expand Down
5 changes: 3 additions & 2 deletions pulsar/reader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,8 @@ func TestReaderOnPartitionedTopic(t *testing.T) {

func TestReaderConnectError(t *testing.T) {
client, err := NewClient(ClientOptions{
URL: "pulsar://invalid-hostname:6650",
URL: "pulsar://invalid-hostname:6650",
OperationTimeout: 5 * time.Second,
})

assert.Nil(t, err)
Expand All @@ -221,7 +222,7 @@ func TestReaderConnectError(t *testing.T) {
assert.Nil(t, reader)
assert.NotNil(t, err)

assert.ErrorContains(t, err, "connection error")
assert.ErrorContains(t, err, "failed to connect to broker")
}

func TestReaderOnSpecificMessage(t *testing.T) {
Expand Down

0 comments on commit ac41379

Please sign in to comment.