@Mock annotation creates a mock implementation for the class it is annotated with.
@InjectMocks also creates the mock implementation, additionally injects the dependent mocks that are marked with the annotations @Mock into it.
In UserServiceTest we are mocking UserRespository which means we don’t care about how the repository layer works. As the dependencies are mocked, we have to define how the method calls to the mocked object should behave, we can do that by using the method call chain Mockito.when().thenReturn()