Closed gliderguy closed 5 months ago
Cause was in the chapter when creating spring boot project the picture figure 3-1 shows 3.0.5 If you forget to follow the written instructions and don't update springframework.boot version to 3.1.0 you will get the error.
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.0.5</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
when running test ChallengeGeneratorServiceTest received error
org.mockito.exceptions.base.MockitoException: Unable to initialize @Spy annotated field 'random'.
Mockito cannot mock this class: class java.util.Random.