2V0-72.22Free trialFree trial

By vmware
Aug, 2025

Verified

25Q per page

Question 1

If a class is annotated with @Component, what should be done to have Spring automatically detect the annotated class and load it as a bean? (Choose the best answer.)

  • A: Ensure a valid bean name in the @Component annotation is specified.
  • B: Ensure a valid @ComponentScan annotation in the Java configuration is specified.
  • C: Ensure a valid @Scope for the class is specified.
  • D: Ensure a valid @Bean for the class is specified.

Question 2

Given an ApplicationContext containing three bean definitions of type Foo with bean ids foo1, foo2, and foo3, which three @Autowired scenarios are valid and will allow the ApplicationContext to initialize successfully? (Choose three.)

  • A: @Autowired public void setFoo (Foo foo) {…}
  • B: @Autowired @Qualifier (“foo3”) Foo foo;
  • C: @Autowired public void setFoo (@Qualifier (“foo1”) Foo foo) {…}
  • D: @Autowired private Foo foo;
  • E: @Autowired private Foo foo2;
  • F: @Autowired public void setFoo(Foo foo2) {…}

Question 3

Which dependency enables an automatic restart of the application as code is changed during development of a Spring boot configuration on a web application? (Choose the best answer.)

  • A: spring-boot-devtools
  • B: spring-boot-initializr
  • C: spring-boot-starter-devtools
  • D: spring-boot-restart

Question 4

Spring puts each bean instance in a scope. What is the default scope? (Choose the best answer.)

  • A: prototype
  • B: singleton
  • C: request
  • D: session

Question 5

Refer to the exhibit.

Image 1

Which option is a valid way to retrieve the account id? (Choose the best answer.)

  • A: Add @PathVariable(“id”) String accountId argument to the update() handler method.
  • B: Add @PathVariable long accountId argument to the update() handler method.
  • C: Add @RequestParam long accountId argument to the update() handler method.
  • D: Add @RequestParam(“id”) String accountId argument to the update() handler method.

Question 6

Which strategy is correct for configuring Spring Security to intercept particular URLs? (Choose the best answer.)

  • A: The URLs can be specified via configuration (using authorizeRequests () and request matchers), with the most specific rule first and the least specific last.
  • B: Spring Security can obtain URLs from Spring MVC controllers, the Spring Security configuration just needs a reference to the controller to be protected.
  • C: The URLs are specified in a special properties file, used by Spring Security.
  • D: The URLs can be specified via configuration (using authorizeRequests () and request matchers), with the least specific rule first and the most specific last.

Question 7

In which three ways are Security filters used in Spring Security? (Choose three.)

  • A: To provide risk governance.
  • B: To drive authentication.
  • C: To manage application users.
  • D: To provide a logout capability.
  • E: To enforce authorization (access control).
  • F: To encrypt data.

Question 8

Refer to the exhibit.

Image 1

The above code shows a conditional @Bean method for the creation of a JdbcTemplate bean.
Which two statements correctly describe the code behavior? (Choose two.)

  • A: @ConditionalOnBean(name= “dataSource”) should be replaced with @ConditionalOnBean (DataSource.class) for greater flexibility.
  • B: @ConditionalOnBean(name= “dataSource”) should be replaced with @ConditionalOnMissingBean (DataSource.class) for greater flexibility.
  • C: The @Bean annotation should be removed.
  • D: A JdbcTemplate bean will be created when the DataSource class is in the classpath but there is no DataSource bean.
  • E: A JdbcTemplate bean will be created when a bean named dataSource has already been created.

Question 9

What is a Spring Boot starter dependency? (Choose the best answer.)

  • A: A setting for specifying which code you want Spring Boot to generate for you.
  • B: A specific POM which you must build to control Spring Boot’s opinionated runtime.
  • C: A pre-existing model project you can download and use as the basis of your project.
  • D: An easy way to include multiple, coordinated dependencies related to a specific technology, like web or JDBC.

Question 10

Which two are required to use transactions in Spring? (Choose two.)

  • A: Add @EnableTransactionManagement to a Java configuration class.
  • B: Annotate a class, an interface, or individual methods requiring a transaction with the @Transactional annotation.
  • C: A class must be annotated with @Service and @Transaction.
  • D: A class requiring a transaction must implement the TransactionInterceptor interface.
  • E: Write a Spring AOP advice to implement transactional behavior.

Question 11

Which two statements are true regarding the RestTemplate class? (Choose two.)

  • A: It supports asynchronous non-blocking model.
  • B: It automatically supports sending and receiving Java objects.
  • C: It provides convenience methods for writing REST clients.
  • D: It provides convenience methods for writing REST services.
  • E: Sending an HTTP request with a custom header is not possible when using RestTemplate.

Question 12

Which two options will inject the value of the daily.limit system property? (Choose two.)

  • A: @Value(“#{daily.limit}”)
  • B: @Value(“$(systemProperties.daily.limit)”)
  • C: @Value(“$(daily.limit)”)
  • D: @Value(“#{systemProperties[‘daily.limit’]}”)
  • E: @Value(“#{systemProperties.daily.limit}”)

Question 13

Which statement is true? (Choose the best answer.)

  • A: @ActiveProfiles is a class-level annotation that is used to instruct the Spring TestContext Framework to record all application events that are published in the ApplicationContext during the execution of a single test.
  • B: @ActiveProfiles is a class-level annotation that you can use to configure how the Spring TestContext Framework is bootstrapped.
  • C: @ActiveProfiles is a class-level annotation that you can use to configure the locations of properties files and inlined properties to be added to the set of PropertySources in the Environment for an ApplicationContext loaded for an integration test.
  • D: @ActiveProfiles is a class-level annotation that is used to declare which bean definition profiles should be active when loaded an ApplicationContext for an integration test.

Question 14

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

  • A: REST is a Protocol.
  • B: REST is Stateful.
  • C: REST is Reliable.
  • D: REST is Interoperable.
  • E: REST is Relative.

Question 15

Spring Boot will find and load property files in which of the following? (Choose the best answer.)

  • A: A *.properties file matching the name of the class annotated with @SpringBootApplication.
  • B: config.properties or config.yml, usually located in the classpath root.
  • C: application.properties or application.yml, usually located in the classpath root.
  • D: env.properties or env.yml, usually located in the classpath root.

Question 16

Which three dependencies are provided by the spring-boot-starter-test? (Choose three.)

  • A: Cucumber
  • B: Hamcrest
  • C: spring-test
  • D: Junit
  • E: EasyMock
  • F: PowerMock

That’s the end of your free questions

You’ve reached the preview limit for 2V0-72.22

Consider upgrading to gain full access!

Page 1 of 4 • Questions 1-25 of 76

Free preview mode

Enjoy the free questions and consider upgrading to gain full access!