Kotlin Mockito No Interaction (KMNI)

I know there have been at least two similar questions asked, but I still don't know why I'm getting an exception.

You are mocking the object you are testing. That doesn't make sense. You should create a real WithDefinitions object and call its real methods to test it. If you mock it, by definition, all its methods are replaced by dummy implementations that do nothing.

Wrong Example

WithDefinitions withDefinitions = Mockito.mock(WithDefinitions.class);

True Example

WithDefinitions withDefinitions = new WithDefinitions();

Post a Comment

Previous Next

نموذج الاتصال