Latest 2V0-72.22 Practice Test Questions Verified Answers As Experienced in the Actual Test!
Pass VMware 2V0-72.22 Exam in First Attempt Easily
NEW QUESTION # 30
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 foo2) {...}
- B. @Autowired public void setFoo (@Qualifier ("foo1") Foo foo) {...}
- C. @Autowired private Foo foo2;
- D. @Autowired private Foo foo;
- E. @Autowired public void setFoo (Foo foo) {...}
- F. @Autowired @Qualifier ("foo3") Foo foo;
Answer: A,D,E
NEW QUESTION # 31
Which two statements are true regarding Spring Boot Testing? (Choose two.)
- A. Test methods annotated with @SpringBootTest will recreate the ApplicationContext.
- B. @TestApplicationContext is used to define additional beans or customizations for a test.
- C. Test methods in a @SpringBootTest class are transactional by default.
- D. @SpringBootTest without any configuration classes expects there is only one class annotated with @SpringBootConfiguration in the application.
- E. @SpringBootTest is typically used for integration testing.
Answer: A,E
NEW QUESTION # 32
Which two statements about the @Autowired annotation are true? (Choose two.)
- A. By default, if a dependency cannot be satisfied with @Autowired, Spring throws a RuntimeException.
- B. @Autowired fields are injected after any config methods are invoked.
- C. Multiple arguments can be injected into a single method using @Autowired.
- D. @Autowired can be used to inject references into BeanPostProcessor and
- E. If @Autowired is used on a class, field injection is automatically performed for all dependencies.
Answer: C,D
Explanation:
BeanFactoryPostProcessor.
NEW QUESTION # 33
Which two statements are true regarding storing user details in Spring Security? (Choose two.)
- A. User details can be stored in a database, in LDAP, or in-memory.
- B. The user details includes username and password but not authorities.
- C. Passwords must be hashed and the default hashing algorithm is MD5.
- D. With a custom UserDetailsService defined in the ApplicationContext, Spring Boot still creates the default user.
- E. User details can be stored in custom storage and retrieve them by implementing the UserDetailsService interface.
Answer: B,D
NEW QUESTION # 34
Spring puts each bean instance in a scope. What is the default scope? (Choose the best answer.)
- A. session
- B. prototype
- C. request
- D. singleton
Answer: D
NEW QUESTION # 35
Which two statements are true regarding the RestTemplate class? (Choose two.)
- A. It provides convenience methods for writing REST clients.
- B. Sending an HTTP request with a custom header is not possible when using RestTemplate.
- C. It provides convenience methods for writing REST services.
- D. It supports asynchronous non-blocking model.
- E. It automatically supports sending and receiving Java objects.
Answer: B,E
NEW QUESTION # 36
Which two statements are true regarding bean creation? (Choose two.)
- A. A Spring bean can be implicitly created by annotating the class with @Bean and using the component- scanner to scan its package.
- B. A Spring bean can be explicitly created using @Bean annotated methods within a Spring configuration class.
- C. A Spring bean can be implicitly created by annotating the class with @Component and using the component-scanner to scan its package.
- D. A Spring bean can be explicitly created by annotating the class with @Autowired.
- E. A Spring bean can be explicitly created by annotating methods or fields by @Autowired.
Answer: C,D
Explanation:
Reference:
https://howtodoinjava.com/spring-core/spring-beans-autowiring-concepts/
NEW QUESTION # 37
Which two statements are true regarding @DataJpaTest? (Choose two.)
- A. TestEntityManager provides all methods that are provided by EntityManager and more.
- B. It can be used for testing both JPA components and NoSQL components.
- C. It can be used for testing JdbcTemplate.
- D. If an embedded database is on the classpath, it will be used to configure a DataSource by default.
- E. It auto-configures a TestEntityManager bean.
Answer: D,E
NEW QUESTION # 38
Which two statements are correct regarding Spring Boot 2.x Actuator Metrics? (Choose two.)
- A. An external monitoring system must be used with Actuator.
- B. The metrics endpoint /actuator/metrics is exposed over HTTP by default.
- C. A metric must be created with one or more tags.
- D. Custom metrics can be measured using Meter primitives such as Counter, Gauge, Timer, and DistributionSummary.
- E. Timer measures both the number of timed events and the total time of all events timed.
Answer: A,B
NEW QUESTION # 39
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. A JdbcTemplate bean will be created when the DataSource class is in the classpath but there is no DataSource bean.
- B. The @Bean annotation should be removed.
- C. A JdbcTemplate bean will be created when a bean named dataSource has already been created.
- D. @ConditionalOnBean(name= "dataSource") should be replaced with
@ConditionalOnMissingBean (DataSource.class) for greater flexibility. - E. @ConditionalOnBean(name= "dataSource") should be replaced with @ConditionalOnBean (DataSource.class) for greater flexibility.
Answer: A,E
NEW QUESTION # 40
What two options are auto-configured Spring Boot Actuator HealthIndicators? (Choose two.)
- A. DataSourceHealthIndicator
- B. RabbitHealthIndicator
- C. DynamoDBHealthIndicator
- D. OktaHealthIndicator
- E. GoogleCloudDataStoreHealthIndicator
Answer: A,B
NEW QUESTION # 41
Which two are required to use transactions in Spring? (Choose two.)
- A. Add @EnableTransactionManagement to a Java configuration class.
- B. A class requiring a transaction must implement the TransactionInterceptor interface.
- C. Annotate a class, an interface, or individual methods requiring a transaction with the @Transactional annotation.
- D. Write a Spring AOP advice to implement transactional behavior.
- E. A class must be annotated with @Service and @Transaction.
Answer: A,C
NEW QUESTION # 42
Which two options are REST principles? (Choose two.)
- A. RESTful application servers keep track of the client state.
- B. RESTful applications cannot use caching.
- C. RESTful applications use a stateless architecture.
- D. RESTful application use HTTP headers and status codes as a contract with the clients.
- E. RESTful applications favor tight coupling between the clients and the servers.
Answer: C,D
NEW QUESTION # 43
Refer to the exhibit.
It is a Java code fragment from a Spring application. Which statement is true with regard to the above example? (Choose the best answer.)
- A. This syntax is invalid because the result of the getBean() method call should be cast to ClientService.
- B. This syntax is invalid because the bean id must be specified as a method parameter.
- C. It will return a bean called ClientService regardless of its id or name.
- D. It will return a bean of the type ClientService regardless of its id or name.
Answer: D
NEW QUESTION # 44
Which two annotations indicate that the transaction for a transactional test method should be committed after the test method has completed? (Choose two.)
- A. @Rollback(false)
- B. @Commit
- C. @Transactional(commit=true)
- D. @Sql(alwaysCommit=true)
- E. @SqlMergeMode(false)
Answer: A,B
NEW QUESTION # 45
Which three dependencies are provided by the spring-boot-starter-test? (Choose three.)
- A. Junit
- B. Hamcrest
- C. PowerMock
- D. spring-test
- E. Cucumber
- F. EasyMock
Answer: A,B,F
NEW QUESTION # 46
Which statement is true about the @PropertySource annotation? (Choose the best answer.)
- A. Used to add a set of name/value pairs to the Spring Environment from an external source.
- B. Used to easily look up and return a single property value from some external property file.
- C. Used to designate the file directory of the application.properties file in a Spring Boot application.
- D. Used to designate the location of the application.properties file in a Spring Boot application.
Answer: B
NEW QUESTION # 47
Which two statements are true about Spring Boot and Spring Data JPA? (Choose two.)
- A. @EntityScan and spring.jpa.* properties can be used to customize Spring Data JPA.
- B. Scanning of JPA Entities can not be customized, the whole classpath is scanned.
- C. Embedded Databases (H2, HSQLDB, Derby) are not re-created during the startup.
- D. Any kind of Hibernate property can be passed to Spring Data JPA like spring.jpa.properties.xxx.
- E. Spring Data JPA is the only implementation for relational databases.
Answer: C,E
NEW QUESTION # 48
Which two statements are correct when @SpringBootApplication is annotated on a class? (Choose two.)
- A. All other annotations on the class will be ignored.
- B. Methods in the class annotated with @Bean will be ignored.
- C. It causes Spring Boot to enable auto-configuration by default.
- D. Component scanning will start from the package of the class.
- E. A separate ApplicationContext will be created for each class annotated with
Answer: C,E
Explanation:
@SpringBootApplication.
NEW QUESTION # 49
Which two statements are correct regarding the @EnableAutoConfiguration annotation? (Choose two.)
- A. It has the same effect regardless of the package of the class that is annotated with it.
- B. It is meta-annotation on the @SpringBootConfiguration composed annotation.
- C. It is a meta-annotation on the @SpringBootApplication composed annotation.
- D. It enables auto-configuration of the ApplicationContext by attempting to guess necessary beans.
- E. It ensures auto-configuration is applied before user-defined beans have been registered.
Answer: A,C
NEW QUESTION # 50
Which two statements are true regarding a Spring Boot-based Spring MVC application? (Choose two.)
- A. The default embedded servlet container can be replaced with Undertow.
- B. Spring Boot starts up an embedded servlet container by default.
- C. The default port of the embedded servlet container is 8088.
- D. Jetty is the default servlet container.
- E. Spring MVC starts up an in-memory database by default.
Answer: B,D
NEW QUESTION # 51
Which statement describes the propagation behavior of Propagation.REQUIRES_NEW annotation? (Choose the best answer.)
- A. Joins a transaction if one already exists; throws an exception if an active transaction does not exist.
- B. Starts a new transaction; if an active transaction already exists, it is suspended.
- C. Starts a new transaction but throws an exception if an active transaction already exists.
- D. Runs in a nested transaction if an active transaction exists; throws an exception if an active transaction does not exist.
Answer: B
NEW QUESTION # 52
Which two statements are correct regarding the Actuator info endpoint? (Choose two.)
- A. It is not enabled by default.
- B. It can be used to change a property value on a running application.
- C. It provides configuration options through which only an authenticated user can display application information.
- D. Typically it is used to display build or source control information.
- E. It can be used to display arbitrary application information.
Answer: A,E
NEW QUESTION # 53
......
We offers you the latest free online 2V0-72.22 dumps to practice: https://freecert.test4sure.com/2V0-72.22-exam-materials.html