Skip to content

Commit

Permalink
Add test that demonstrates the issue
Browse files Browse the repository at this point in the history
Related to #273
  • Loading branch information
lukebakken committed Jul 7, 2024
1 parent 6696c6d commit bd55399
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,46 @@ func TestIntegrationQueueDeclarePassiveOnMissingExchangeShouldError(t *testing.T
}
}

// https://github.com/rabbitmq/amqp091-go/issues/273
func TestIntegrationQueueDeclarePassiveOnQueueTypeMismatchShouldError(t *testing.T) {
c := integrationConnection(t, t.Name())
if c != nil {
defer c.Close()

ch, err := c.Channel()
if err != nil {
t.Fatalf("create channel1: %s", err)
}
defer ch.Close()

queueName := t.Name()

if _, err := ch.QueueDeclare(
queueName, // name
false, // durable
true, // auto-delete
false, // exclusive
false, // noWait
nil, // arguments
); err != nil {
t.Fatalf("queue declare: %s", err)
}

args := Table{QueueTypeArg: QueueTypeQuorum}

if _, err := ch.QueueDeclarePassive(
queueName, // name
false, // duration (note: not durable)
true, // auto-delete
false, // exclusive
false, // noWait
args, // arguments
); err == nil {
t.Fatal("QueueDeclarePassive with mismatched queue type should error")
}
}
}

// https://github.com/streadway/amqp/issues/94
func TestIntegrationPassiveQueue(t *testing.T) {
c := integrationConnection(t, "queue")
Expand Down

0 comments on commit bd55399

Please sign in to comment.