VMware vRealize Automation 8.x (2022) — Question 39
Which two statements are true regarding Spring Boot Testing? (Choose two.)
Answer options
- A. @TestApplicationContext is used to define additional beans or customizations for a test.
- B. Test methods in a @SpringBootTest class are transactional by default.
- C. @SpringBootTest is typically used for integration testing.
- D. Test methods annotated with @SpringBootTest will recreate the ApplicationContext.
- E. @SpringBootTest without any configuration classes expects there is only one class annotated with @SpringBootConfiguration in the application.
Correct answer: C, E
Explanation
Option C is correct because @SpringBootTest is indeed commonly used for integration testing, allowing the entire application context to be loaded. Option E is also correct as @SpringBootTest expects a single @SpringBootConfiguration class when no configuration classes are specified, ensuring proper context setup. The other options are incorrect as they either misrepresent the usage of annotations or the behavior of the testing framework.