nerdexam
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)
  • A
    73% (22)
  • B
    7% (2)
  • C
    13% (4)
  • D
    7% (2)

Community Discussion

No community discussion yet for this question.

Full 2V0-72.22 Practice