1
0
mirror of https://github.com/eventials/goevents.git synced 2025-04-28 13:48:49 +08:00
eventials.goevents/mock/producer.go

28 lines
438 B
Go
Raw Permalink Normal View History

2016-12-01 11:40:58 -02:00
package mock
import (
2017-10-05 14:55:13 -03:00
"github.com/eventials/goevents/messaging"
2016-12-01 11:40:58 -02:00
"github.com/stretchr/testify/mock"
)
type Producer struct {
mock.Mock
}
2017-10-05 14:55:13 -03:00
func NewMockProducer() messaging.Producer {
return &Producer{}
}
2017-03-09 17:32:05 -03:00
func (p *Producer) Publish(action string, data []byte) {
2017-03-09 23:17:20 -03:00
p.Called(action, data)
2017-03-09 17:32:05 -03:00
}
func (p *Producer) Close() {
2017-03-09 23:17:20 -03:00
p.Called()
}
func (p *Producer) NotifyClose() <-chan bool {
2017-10-05 14:55:13 -03:00
args := p.Called()
return args.Get(0).(chan bool)
2016-12-01 11:40:58 -02:00
}