Broadcom-VMware
2V0-72.22 · Question #46
Which option is true about use of mocks in a Spring Boot web slice test? (Choose the best answer.)
The correct answer is A. Mocking a Spring Bean requires annotating it with @MockBean annotation. See the full explanation below for the reasoning.
Question
Which option is true about use of mocks in a Spring Boot web slice test? (Choose the best answer.)
Options
- AMocking a Spring Bean requires annotating it with @MockBean annotation.
- BIf a Spring Bean already exists in the web slice test spring context, it cannot be mocked.
- CMocks cannot be used in a Spring Boot web slice test.
- DMocking a Spring Bean requires annotating it with @Mock annotation.
How the community answered
(30 responses)- A73% (22)
- B7% (2)
- C13% (4)
- D7% (2)
Community Discussion
No community discussion yet for this question.