Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check the received message value in producer mocks #667

Closed
jacksilv opened this issue Jun 9, 2016 · 2 comments
Closed

Check the received message value in producer mocks #667

jacksilv opened this issue Jun 9, 2016 · 2 comments

Comments

@jacksilv
Copy link
Contributor

jacksilv commented Jun 9, 2016

Hi guys, not sure if this is a valid issue.
When developing a unit test for a program that uses the sync/asyc producer, I can only say that I expect to receive a message and that I want the mock response to be success/error.
For my test I need to check the value inside the message, so I propose to extend the producerExpectation struct in mocks.go and to add new methods to the producer mock, that receive in input a string (regexp) and check the received value against this regexp.
I am ok to propose an implementation if it makes sense.

@eapache
Copy link
Contributor

eapache commented Jun 9, 2016

Seems reasonable to me.

@jacksilv
Copy link
Contributor Author

Thanks folks, I will start working on the implementation soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants