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

Add unit tests with embedded Kafka for the controller #2

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

tonvanbart
Copy link

Hi Jeroen, nogmaals bedankt voor de informatieve workshop.
Met wat gezoek en gedoe heb ik er een test voor de SensorController bij gehangen die gebruik maakt van KafkaEmbedded, en de header en payload van het bericht verifieert. Kijk maar of je er wat aan hebt ;)
De SensorData class heb ik verLombokt omdat ik te lui was om er een goede equals() in te hangen, wat nodig was voor de assert in de tests.

@jresoort
Copy link
Owner

Hi Ton,
Thanks for your contribution. I will have a look when I have some time.

@timtebeek
Copy link

timtebeek commented Sep 24, 2018

@tonvanbart Hi Ton, here's my code that does the same, but uses less test context setup:
https://github.com/jresoort/kafkastreams-workshop/pull/3/files
Feel free to compare and adopt; We'll add some tests to the workshop repository for sure, thanks! :)

@tonvanbart
Copy link
Author

Hi Tim, thanks!
I had a look, looks cool. It's quite a bit shorter indeed.
I do think there's a difference though as the test I added is also checking the contents of the payload and header; as far as I can see the test in your branch just verifies that a message was sent (regardless of content). Or am I missing something?

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

Successfully merging this pull request may close these issues.

None yet

3 participants