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

Test GameEventHandler #2

Open
andreykirson opened this issue Aug 10, 2021 · 1 comment
Open

Test GameEventHandler #2

andreykirson opened this issue Aug 10, 2021 · 1 comment
Assignees
Labels
question Further information is requested

Comments

@andreykirson
Copy link

Hi, in your book, you recommend creating a test for a new Game Event Handler class. You have an implementation of this test, because I'm a little confused about how to use this instruction to create a test for the consumer https://docs.spring.io/spring-amqp/reference/html/#test-harness

@mechero
Copy link
Contributor

mechero commented Aug 10, 2021

Hi Andrey, good question! I haven't written tests using those Spring AMQP tools yet. What I had in mind is mocking the GameService operation and invoking the handleMultiplicationSolved method explicitly with an event that you can create beforehand. You can also instruct the mock to throw an exception to test the error scenario.

@mechero mechero self-assigned this Aug 10, 2021
@mechero mechero added the question Further information is requested label Aug 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants