ExamGecko
Question list
Search
Search

Question 4 - 2V0-72.22 discussion

Report
Export

Which option is true about use of mocks in a Spring Boot web slice test? (Choose the best answer.)

A.
Mocking a Spring Bean requires annotating it with @MockBean annotation.
Answers
A.
Mocking a Spring Bean requires annotating it with @MockBean annotation.
B.
If a Spring Bean already exists in the web slice test spring context, it cannot be mocked.
Answers
B.
If a Spring Bean already exists in the web slice test spring context, it cannot be mocked.
C.
Mocks cannot be used in a Spring Boot web slice test.
Answers
C.
Mocks cannot be used in a Spring Boot web slice test.
D.
Mocking a Spring Bean requires annotating it with @Mock annotation.
Answers
D.
Mocking a Spring Bean requires annotating it with @Mock annotation.
Suggested answer: A

Explanation:

Reference: https://tanzu.vmware.com/developer/guides/spring-boot-testing/

asked 16/09/2024
hesham azarkan
44 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first