To inject mock objects into the tested object in a Spring Boot unit test, the _____ annotation is used with Mockito.

  • @Autowired
  • @InjectMocks
  • @MockBean
  • @MockitoInject
In Spring Boot unit testing with Mockito, you use the @InjectMocks annotation to inject mock objects into the object being tested. This allows you to control the behavior of dependencies during testing.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *