Complete the code to create a mock object using Mockito.
MyService service = Mockito.[1](MyService.class);
The mock method creates a mock object for the given class.
Complete the code to verify that a method was called once on a mock.
Mockito.[1](mockObject).someMethod();The verify method checks if a method was called on a mock.
Fix the error in the code to stub a method call on a spy object.
Mockito.[1](spyObject.someMethod()).thenReturn("value");
The when method is used to stub method calls on mocks or spies.
Fill both blanks to create a spy and stub a method to return a value.
MyService spyService = Mockito.[1](new MyService()); Mockito.[2](spyService.someMethod()).thenReturn("Hello");
First, create a spy with spy(). Then stub a method call with when().
Fill all three blanks to mock a repository, stub a method, and verify the call.
Repository repo = Mockito.[1](Repository.class); Mockito.[2](repo.findById(1)).thenReturn(Optional.of(new Item())); Mockito.[3](repo).findById(1);
Create a mock with mock(), stub a method with when(), and verify the call with verify().
