You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 23, 2023. It is now read-only.
As a user of felice, which is great, by the way, I'd like to test what I'm actually sending, that is, topic, body and key. I am using a mock of the producer Send function, which looks like that:
p.SendFunc=func(_ context.Context, topicstring, vinterface{}, opts...fproducer.Option) (*fproducer.Message, error) {
// Test the bodyrequire.Equal(t, &Object{}, v)
// Test topicrequire.Equal(t, "my-topic", topic)
// Test the keymess:=producer.NewMessage(topic, "")
opts[0](mess)
k, err:=mess.Key.Encode()
require.NoError(t, err)
require.Equal(t, "awesome-key", string(k))
The last part is almost impossible to write it without knowing all insights of library. Is there any better way to test it given the previous constraint? If so, I'd love to have it documented in godoc, if not, a helper would be great :)
As a user of
felice, which is great, by the way, I'd like to test what I'm actually sending, that is,topic,bodyandkey. I am using a mock of the producerSendfunction, which looks like that:The last part is almost impossible to write it without knowing all insights of library. Is there any better way to test it given the previous constraint? If so, I'd love to have it documented in godoc, if not, a helper would be great :)