Question: How are mocking frameworks such as Mockito used with Spring?
- 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.
- 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.
- Mockito will create mock users to repeatedly perform requests against your Spring application to test your app's ability to take load.
- 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.