Question: How are mocking frameworks such as Mockito used with Spring?

  1. Mockito will spin up a mock web service hosted in a Docker container that can respond to HTTP requests to mock out third-party APIs.
  2. Mockito can use annotations or factory methods to create mock objects that may be injected into tests in place of dependencies. The behavior of mocks can be explicitly configured.
  3. Mockito will create mock users to repeatedly perform requests against your Spring application to test your app's ability to take load.
  4. Mockito will spin up a mock web service hosted in a Docker container that can respond to RPC calls to mock out remote resources.

Answer: The correct answer of the above question is Option B:Mockito can use annotations or factory methods to create mock objects that may be injected into tests in place of dependencies. The behavior of mocks can be explicitly configured.