79170423

Date: 2024-11-08 14:32:53
Score: 0.5
Natty:
Report link

Ok. The solution is like suggested on the micronaut docu (https://micronaut-projects.github.io/micronaut-test/4.0.0-M8/guide/index.html#junit5) Instead of using @Spy on all "normal" implementations. I just had to use

    @MockBean(ClassToBeMockedImpl.class)
    public ClassToBeMocked classToBeMocked() {
        return mock(ClassToBeMocked.class);
    }

on the class I want o mock. So all the field injection were uncessary.

Reasons:
  • Whitelisted phrase (-1): solution is
  • RegEx Blacklisted phrase (1): I want
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: Zonko