VMware 2V0-72-22 Exam Questions

Questions for the 2V0-72-22 were updated on : Dec 04 ,2025

Page 1 out of 6. Viewing questions 1-15 out of 79

Question 1

Refer to the exhibit.

How can a Spring Bean be created from this LegacySingleton class?

  • A. Call LegacySingleton.getInstance() from within a @Bean method and return the instance.
  • B. Return an instance of LegacySingleton using the new keyword from a @Bean method.
  • C. It is not possible without modifying the LegacySingleton class, the constructor must be public.
  • D. Modify the LegacySingleton class by adding the @Autowired annotation to the instance variable.
Answer:

A

User Votes:
A
50%
B
50%
C
50%
D
50%

Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 2

Which two statements are true regarding @WebMvcTest? (Choose two.)

  • A. It auto-configures a MockMvc.
  • B. It will only scan for @Controller beans in the source code.
  • C. It is used for testing Spring MVC components such as @Controller with a running server.
  • D. Typically it is used in combination with @MockBean when there is a dependency bean to be mocked.
  • E. It is typically used with @ExtendWith(MockitoExtension.class) in JUnit 5.
Answer:

AD

User Votes:
A
50%
B
50%
C
50%
D
50%
E
50%

Discussions
vote your answer:
A
B
C
D
E
0 / 1000

Question 3

Which two annotations are meta-annotations on the @SpringBootApplication composed
annotation? (Choose two.)

  • A. @Configuration
  • B. @ComponentScan
  • C. @SpringBootConfiguration
  • D. @SpringApplication
  • E. @AutoConfiguration
Answer:

AB

User Votes:
A
50%
B
50%
C
50%
D
50%
E
50%

Explanation:
A . @Configuration This annotation indicates that the class has @Bean definition methods and may
be processed by the Spring container to generate bean definitions and service requests for those
beans at runtime. B. @ComponentScan This annotation configures component scanning directives
for use with @Configuration classes. Provides support parallel with Spring XML's
context:component-scan element.

Discussions
vote your answer:
A
B
C
D
E
0 / 1000

Question 4

Which two mechanisms of autowiring a dependency when multiple beans match the dependency's
type are correct? (Choose two.)

  • A. Use of @Qualifier annotation on the class and @Autowired annotation either on a field or setter methods.
  • B. Use of @Qualifier and @Autowired annotations together with setter methods.
  • C. Use of @Qualifier annotation only with setter methods (@Autowired is optional for setters).
  • D. Use of @Qualifier and @Autowired annotations together on a field.
  • E. Use of @Qualifier annotation only on a field (@Autowired is optional for fields).
Answer:

AD

User Votes:
A
50%
B
50%
C
50%
D
50%
E
50%

Discussions
vote your answer:
A
B
C
D
E
0 / 1000

Question 5

Which is the correct approach to register for a bean destruction callback?

  • A. Annotate the callback method with @PostDestroy.
  • B. Annotate the callback method with @PreDestroy.
  • C. Add the @Lazy annotation to the bean configuration.
  • D. Configure the bean instance to use prototype scope.
Answer:

B

User Votes:
A
50%
B
50%
C
50%
D
50%

Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 6

Refer to the exhibit.

Which two statements are correct regarding auto-configuration of DataSource and JdbcTemplate
beans given a Spring Boot application with only these two dependencies? (Choose two.)

  • A. A DataSource bean will not be auto-configured.
  • B. A JdbcTemplate bean will not be auto-configured.
  • C. A JdbcTemplate bean will be auto-configured.
  • D. A DataSource bean will be auto-configured only if a JdbcTemplate bean is explicitly defined.
  • E. A DataSource bean will be auto-configured.
Answer:

CE

User Votes:
A
50%
B
50%
C
50%
D
50%
E
50%

Discussions
vote your answer:
A
B
C
D
E
0 / 1000

Question 7

Refer to the exhibit.

Which two methods will be implemented at runtime if declared in a Spring Data JPA Repository?
(Choose two.)

  • A. public Customer getsingle(Long id);
  • B. public Customer findFirstOrderDateMax();
  • C. public Customer findByEmail(String email);
  • D. public Customer findFirstByOrderDateBetween(Date d1, Date d2);
  • E. public Customer findCustomerByName(String name);
Answer:

CD

User Votes:
A
50%
B
50%
C
50%
D
50%
E
50%

Discussions
vote your answer:
A
B
C
D
E
0 / 1000

Question 8

Which statements is true?

  • A. Methods annotated with @AfterEach will run only once before any tests in a class are executed.
  • B. @BeforeAll annotation can only be used on non-static methods.
  • C. Methods annotated with @BeforeAll will run only once before any tests in a class are executed.
  • D. @AfterEach annotation must be used on a cleanup method when @BeforeEach is used.
Answer:

C

User Votes:
A
50%
B
50%
C
50%
D
50%

Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 9

What's the password storage format when using the DelegatingPasswordEncoder?

  • A. encodedPassword{id}, where {id} is an identifier used to look up which PasswordEncoder should be used.
  • B. {id}encodedPassword, where {id} is an identifier used to look up which PasswordEncoder should be used.
  • C. {timestamp}encodedPassword, where {timestamp} is the time when the password was encoded.
  • D. {id}{salt}encodedPassword, where {id} is an identifier used to look up which PasswordEncoder should be used and {salt} a randomly generated salt.
Answer:

B

User Votes:
A
50%
B
50%
C
50%
D
50%

Explanation:
https://docs.spring.io/spring-security/site/docs/current/api/org/springframework/security/crypto/password/DelegatingPasswordEncoder.html

Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 10

Refer to the exhibit.

What statement is true about @DirtiesContext?

  • A. It will close the existing cached ApplicationContext and recreate a new one before the test method.
  • B. It will close the existing cached ApplicationContext and recreate a new one after the test method.
  • C. It will keep the existing cached ApplicationContext, all changes to Spring managed beans will be reverted after the test.
  • D. It will recreate only the Spring managed beans that are modified inside the test method.
Answer:

B

User Votes:
A
50%
B
50%
C
50%
D
50%

Explanation:
@DirtiesContext @Test void testProcessWhichDirtiesAppCtx() { // some logic that results in the
Spring container being dirtied } Dirty the context after the current test method.
https://docs.spring.io/spring-framework/reference/testing/annotations/integration-spring/annotation-dirtiescontext.html

Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 11

Which two statements are true about Spring AOP? (Choose two.)

  • A. The @After advice type is invoked regardless of whether a method successfully returned or an exception was thrown.
  • B. In Spring AOP, a join point represents a method execution or property access.
  • C. Spring AOP does not use AspectJ's pointcut expression language.
  • D. Examples of cross-cutting concerns include security, caching, transaction.
  • E. There are in total 4 types of advice, @Before, @After, @AfterReturning and @AfterThrowing.
Answer:

AD

User Votes:
A
50%
B
50%
C
50%
D
50%
E
50%

Discussions
vote your answer:
A
B
C
D
E
0 / 1000

Question 12

Refer to the exhibit.

AppConfig is a Java configuration class. Which two statements are true? (Choose two.)

  • A. The clientService bean declared will have prototype scope by default.
  • B. The name of the clientService() method is invalid and will throw an error.
  • C. The clientService bean will be lazy initialized the first time accessed.
  • D. The bean is of type clientService and by default will be a Singleton.
  • E. The Java configuration can be profile specific by adding a @Profile annotation.
Answer:

DE

User Votes:
A
50%
B
50%
C
50%
D
50%
E
50%

Discussions
vote your answer:
A
B
C
D
E
0 / 1000

Question 13

According to REST principles, which is the recommended way to update the order resource identified
by 1234?

  • A. Send a PUT request to /orders/edit?id=1234.
  • B. Send a PUT request to /orders/1234.
  • C. Send a POST request to /orders/1234.
  • D. Send a POST request to /orders/edit?id=1234.
Answer:

B

User Votes:
A
50%
B
50%
C
50%
D
50%

Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 14

Which two statements are true regarding a Spring Boot "fat" JAR? (Choose two.)

  • A. The "fat" JAR contains both the class files and the source files for your project.
  • B. The "fat" JAR requires an external Servlet container.
  • C. The "fat" JAR contains compiled classes and dependencies that your code needs to run.
  • D. The "fat" JAR can contain multiple embedded application servers.
  • E. The "fat" JAR is created by the Spring Boot Maven plugin or Gradle plugin.
Answer:

CE

User Votes:
A
50%
B
50%
C
50%
D
50%
E
50%

Discussions
vote your answer:
A
B
C
D
E
0 / 1000

Question 15

Which two statements about BeanFactoryPostProcessors are true? (Choose two.)

  • A. Allows for the transformation of Spring bean definitions after the beans have been instantiated.
  • B. Allows for the transformation of Spring bean definitions before the beans are instantiated.
  • C. Creates proxies for the Spring beans that require an extra behavior like transaction management.
  • D. PropertySourcesPlaceholderConfigurer implements BeanFactoryPostProcessor and is used to read property values from the Spring Environment.
  • E. Detects annotations such as @PostConstruct and @PreDestroy and then invokes appropriate behavior.
Answer:

BD

User Votes:
A
50%
B
50%
C
50%
D
50%
E
50%

Explanation:
(1) BeanFactoryPostProcessor (Spring Framework 6.1.3 API). https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/beans/factory/config/BeanFactoryPostProcessor.html.(2)Spring
BeanPostProcessor | Baeldung. https://www.baeldung.com/spring-beanpostprocessor. (3)
BeanFactoryPostProcessor - Spring | Home. https://docs.spring.io/spring-
framework/docs/3.0.x/javadoc-
api/org/springframework/beans/factory/config/BeanFactoryPostProcessor.html. (4)
BeanFactoryPostProcessor (Spring Framework API 2.5). https://docs.spring.io/spring-
framework/docs/2.5.x/javadoc-
api/org/springframework/beans/factory/config/BeanFactoryPostProcessor.html. (5) Spring
BeanPostProcessor Example - HowToDoInJava.
https://howtodoinjava.com/spring-core/spring-bean-
post-processors/

Discussions
vote your answer:
A
B
C
D
E
0 / 1000
To page 2