-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Closed as not planned
Closed as not planned
Copy link
Labels
in: testIssues in the test moduleIssues in the test modulestatus: duplicateA duplicate of another issueA duplicate of another issuetype: regressionA bug that is also a regressionA bug that is also a regression
Description
Upgrading from Spring Boot 3.4.0-M3 (Spring Framework 6.2.0-RC1) to Spring Boot 3.4.0-RC1 (Spring Framework 6.2.0-RC3) breaks my use of a @MockitoSpyBean of the form doReturn(results).when(spyBean).method(argumentMatchers...).
That form is the one recommend by Mockito.
The error thrown says Argument passed to when() is not a mock!: https://github.com/JKatzwinkel/tla-es/actions/runs/11541063711/job/32122614536?pr=382#step:9:188 .
This problem did not occur with Spring Boot 3.4.0-M3 (Spring Framework 6.2.0-RC1).
This is where the spy (operations) gets stubbed:
doReturn(hits).when(operations).search(
any(org.springframework.data.elasticsearch.core.query.Query.class),
eq(SentenceEntity.class),
any()
);Please let me know if you need further information or if this is not an issue with spring boot. Thanks!
Metadata
Metadata
Assignees
Labels
in: testIssues in the test moduleIssues in the test modulestatus: duplicateA duplicate of another issueA duplicate of another issuetype: regressionA bug that is also a regressionA bug that is also a regression