ExamGecko
Home Home / VMware / 2V0-72.22

VMware 2V0-72.22 Practice Test - Questions Answers, Page 2

Question list
Search
Search

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
A.
spring-boot-devtools
Answers
B.
spring-boot-initializr
B.
spring-boot-initializr
Answers
C.
spring-boot-starter-devtools
C.
spring-boot-starter-devtools
Answers
D.
spring-boot-restart
D.
spring-boot-restart
Answers
Suggested answer: A

Explanation:

Reference: https://docs.spring.io/spring-boot/docs/current/reference/html/using.html

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

A.
prototype
A.
prototype
Answers
B.
singleton
B.
singleton
Answers
C.
request
C.
request
Answers
D.
session
D.
session
Answers
Suggested answer: B

Explanation:

Reference: https://stackoverflow.com/questions/17599216/spring-bean-scopes

Refer to the exhibit.

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.
A.
Add @PathVariable(“id”) String accountId argument to the update() handler method.
Answers
B.
Add @PathVariable long accountId argument to the update() handler method.
B.
Add @PathVariable long accountId argument to the update() handler method.
Answers
C.
Add @RequestParam long accountId argument to the update() handler method.
C.
Add @RequestParam long accountId argument to the update() handler method.
Answers
D.
Add @RequestParam(“id”) String accountId argument to the update() handler method.
D.
Add @RequestParam(“id”) String accountId argument to the update() handler method.
Answers
Suggested answer: A

Explanation:

Reference: https://docs.spring.io/spring-framework/docs/4.3.12.RELEASE/spring-framework-reference/htmlsingle/

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

Explanation:

Reference: https://www.baeldung.com/security-none-filters-none-access-permitAll

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

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

Explanation:

Reference: https://www.javadevjournal.com/spring-security/spring-security-filters/

Refer to the exhibit.

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.
A.
@ConditionalOnBean(name= “dataSource”) should be replaced with @ConditionalOnBean(DataSource.class) for greater flexibility.
Answers
B.
@ConditionalOnBean(name= “dataSource”) should be replaced with@ConditionalOnMissingBean (DataSource.class) for greater flexibility.
B.
@ConditionalOnBean(name= “dataSource”) should be replaced with@ConditionalOnMissingBean (DataSource.class) for greater flexibility.
Answers
C.
The @Bean annotation should be removed.
C.
The @Bean annotation should be removed.
Answers
D.
A JdbcTemplate bean will be created when the DataSource class is in the classpath but there is no DataSource bean.
D.
A JdbcTemplate bean will be created when the DataSource class is in the classpath but there is no DataSource bean.
Answers
E.
A JdbcTemplate bean will be created when a bean named dataSource has already been created.
E.
A JdbcTemplate bean will be created when a bean named dataSource has already been created.
Answers
Suggested answer: A, D

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

Explanation:

Reference: https://developer.ibm.com/tutorials/j-spring-boot-basics-perry/

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

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

Explanation:

Reference: https://www.baeldung.com/transaction-configuration-with-jpa-and-spring

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

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

Explanation:

Reference: https://docs.spring.io/spring-framework/docs/current/javadocapi/org/springframework/web/client/ RestTemplate.html

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.
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.
Answers
B.
@ActiveProfiles is a class-level annotation that you can use to configure how the Spring TestContext Framework is bootstrapped.
B.
@ActiveProfiles is a class-level annotation that you can use to configure how the Spring TestContext Framework is bootstrapped.
Answers
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.
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.
Answers
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.
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.
Answers
Suggested answer: D

Explanation:

Reference: https://docs.spring.io/spring-framework/docs/4.2.x/spring-framework-reference/html/integration- testing.html

Total 60 questions
Go to page: of 6