2V0-72-22 practice question 3 of 15
Which two statements are true regarding Spring and Spring Boot Testing? (Choose two.)
Full set: 79 questionsThe Spring testing framework provides comprehensive support for both unit and integration testing. Annotations like @SpringBootTest (from Spring Boot) and @SpringJUnitConfig (from Spring Framework) are used to bootstrap a Spring ApplicationContext for tests. Spring Boot enhances this by supporting "slice testing" with annotations like @WebMvcTest or @DataJpaTest, which load only a specific part of the application context. This allows for faster, more focused integration tests alongside full application tests.
A. The spring-boot-starter-test dependency includes Mockito for mocking, not EasyMock. EasyMock would need to be added as a separate dependency.
C. Mockito is included by default and fully supports spies. Spring Boot provides @SpyBean to add Mockito spies to the application context.
D. @Mock is a core Mockito annotation. @MockBean is provided by the spring-boot-test module, not the core spring-test dependency.
1. Spring Boot Reference Documentation, Version 3.2.1. Section 5.1, "Test Scope Dependencies". This section lists the libraries provided by spring-boot-starter-test, which includes Mockito. Available at: https://docs.spring.io/spring-boot/docs/current/reference/html/features.html#features.testing.test-scope-dependencies
2. Spring Boot Reference Documentation, Version 3.2.1. Section 5.4, "Testing Spring Applications". This section describes using @SpringBootTest to load a complete ApplicationContext. Available at: https://docs.spring.io/spring-boot/docs/current/reference/html/features.html#features.testing.spring-boot-applications
3. Spring Boot Reference Documentation, Version 3.2.1. Section 5.6, "Testing Application Slices". This section explains the concept of slice tests and lists annotations like @WebMvcTest. Available at: https://docs.spring.io/spring-boot/docs/current/reference/html/features.html#features.testing.spring-boot-applications.slices
4. Spring Framework Reference Documentation, Version 6.1.2. Section 14.5.3, "Spring JUnit Jupiter Annotations". This section details the @SpringJUnitConfig composed annotation for creating an ApplicationContext. Available at: https://docs.spring.io/spring-framework/docs/current/reference/html/testing.html#spring-testing-annotations-junit-jupiter
Keep practicing
Take the free 2V0-72-22 practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other 2V0-72-22 practice questions
- Question 1Which two statements describe Spring JdbcTemplate? (Choose two.)
- Question 2Which two options will inject the value of the daily.limit system property? (Choose two.)
- Question 4Which two statements are correct regarding Spring Boot auto-configuration customization? …
- Question 5Which two statements are true about @Controller annotated classes? (Choose two.)
- Question 6Which statement is true? (Choose the best
- Question 8Which two statements are correct regarding the Health Indicator status? (Choose two.)
