Junior — Middle
What will be the result when executing a method using Mockito?
sobes.tech AI
Answer from AI
When using Mockito, if you call a mock object's method, by default it does nothing and returns the default value for the return type (e.g., null for objects, 0 for numbers, false for boolean). To get specific behavior, you need to explicitly set it up using when(...).thenReturn(...) or other configuration methods. If the method is not configured, the call will not execute real code but will simply return the default value.