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.
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.