-
Couldn't load subscription status.
- Fork 38.8k
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!