Skip to content

Commit

Permalink
added defered confirmation to connection mock
Browse files Browse the repository at this point in the history
  • Loading branch information
gabo1208 committed Jul 27, 2023
1 parent 2c761bb commit b4852da
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/rabbit/rabbit_mocks.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ func (rm *RabbitMQBadConnectionMock) NotifyClose(c chan *amqp.Error) chan *amqp.
type RabbitMQChannelMock struct {
NotifyCloseChannel chan *amqp.Error
ConsumeChannel <-chan amqp.Delivery
dc *amqp.DeferredConfirmation
}

func (rm *RabbitMQChannelMock) IsClosed() bool {
Expand All @@ -83,7 +84,7 @@ func (rm *RabbitMQChannelMock) Consume(a string, b string, c bool, d bool, e boo
}

func (rm *RabbitMQChannelMock) PublishWithDeferredConfirm(a string, b string, c bool, d bool, p amqp.Publishing) (*amqp.DeferredConfirmation, error) {
return &amqp.DeferredConfirmation{}, nil
return rm.dc, nil
}

func (rm *RabbitMQChannelMock) Confirm(a bool) error {
Expand Down

0 comments on commit b4852da

Please sign in to comment.