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

Chapter 03: ChallengeGeneratorServiceTest.java - @Mock can also be used, instead of @Spy #4

Open
hannah23280 opened this issue Dec 19, 2023 · 0 comments

Comments

@hannah23280
Copy link

In the book, it mentions to use @SPY for random field in the ChallengeGeneratorServiceTest.java. But i am able to use @mock, and the testing still passed. I am currently using spring boot 3.2.0. Any idea why?

In the book. it also mentions "since the basic Java classes implementing random generators do not work on interfaces (which you could then simply mock instead of spy), not sure if can elaborate on this, cos not sure what that mean.

@hannah23280 hannah23280 changed the title Chapter 03: ChallengeGeneratorServiceTest.java Chapter 03: ChallengeGeneratorServiceTest.java - @Mock can also be used, instead of @Spy Dec 19, 2023
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

No branches or pull requests

1 participant