VMware vRealize Automation 8.x (2022) — Question 22
Which two statements are true regarding Spring and Spring Boot Testing? (Choose two.)
Answer options
- A. EasyMock is supported out of the box.
- B. @SpringBootTest or @SpringJUnitConfig can be used for creating an ApplicationContext.
- C. Mockito spy is not supported in Spring Boot testing by default.
- D. The spring-test dependency provides annotations such as @Mock and @MockBean.
- E. Integration and slice testing are both supported.
Correct answer: B, E
Explanation
Option B is correct because @SpringBootTest and @SpringJUnitConfig are indeed used to set up an ApplicationContext for testing in Spring Boot. Option E is also correct as both integration testing and slice testing are supported in Spring. The other options contain inaccuracies regarding support and availability of testing features in Spring Boot.