-
Couldn't load subscription status.
- Fork 38.8k
Closed as not planned
Labels
in: testIssues in the test moduleIssues in the test module
Description
In Spring Boot 3.3:
@SpyBean
private ReprocessBackOffImpl reprocessBackOffImpl;doThrow(exception).when(reprocessBackOffImpl).assertPreConditions(context);It's working fine....
but after upgrading to Spring Boot 3.4:
@MockitoSpyBean
private ReprocessBackOffImpl reprocessBackOffImpl;doThrow(exception).when(reprocessBackOffImpl).assertPreConditions(context);I'm getting the following exception.
Argument passed to when() is not a mock!
Example of correct stubbing:
doThrow(new RuntimeException()).when(mock).someMethod();
org.mockito.exceptions.misusing.NotAMockException:
Argument passed to when() is not a mock!
Metadata
Metadata
Assignees
Labels
in: testIssues in the test moduleIssues in the test module