Not planned
Description
Currently Mockito doesn't work with native tests. See spring-attic/spring-native#1561 and spring-attic/spring-native#1063 for more details.
For now, we can disable the ResetMocksTestExecutionListener
, but it would be nice if we could make Mockito work.
Metadata
Metadata
Assignees
Labels
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
Disable ResetMocksTestExecutionListener on native
sdeleuze commentedon Aug 31, 2022
FYI there is ongoing work on GraalVM side to make it work, I will try to share up to date news about current status.
test disable to spring-projects/spring-boot#32195
test disable to spring-projects/spring-boot#32195
mhalbritter commentedon Nov 25, 2022
There's more than just GraalVM supporting this. Currently, using
@MockBean
wreaks havoc even when not using native-image, just enabling AOT mode is enough.mhalbritter commentedon Nov 25, 2022
We have a smoke test which uses
@MockBean
here: https://github.com/spring-projects/spring-aot-smoke-tests/tree/main/boot/boot-tcfmhalbritter commentedon Dec 5, 2022
I've added metadata for Mockito 4.8.1 to the reachability-metadata repository. However I found no way to get the class mocks from Mockito working, as they all rely on creating classes at runtime. But it works when using the
ProxyMockMaker
, which is able to mock interfaces.eiswind commentedon Dec 7, 2022
@mhalbritter are there plans to support @MockBean? Having this with the proxymockmaker would be already a big gain.
31 remaining items