New Year Special 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: save70

Free and Premium VMware 2V0-72.22 Dumps Questions Answers

Page: 1 / 6
Total 79 questions

Professional Develop VMware Spring Questions and Answers

Question 1

Which two statements are true regarding bean creation? (Choose two.)

Options:

A.

A Spring bean can be explicitly created by annotating methods or fields by @Autowired.

B.

A Spring bean can be implicitly created by annotating the class with @Component and using the component-scanner to scan its package.

C.

A Spring bean can be implicitly created by annotating the class with @Bean and using the component- scanner to scan its package.

D.

A Spring bean can be explicitly created using @Bean annotated methods within a Spring configuration class.

E.

A Spring bean can be explicitly created by annotating the class with @Autowired.

Buy Now
Question 2

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.)

Options:

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 3

Which two statements are true concerning constructor injection? (Choose two.)

Options:

A.

If there is only one constructor the @Autowired annotation is not required.

B.

Constructor injection only allows one value to be injected.

C.

Constructor injection is preferred over field injection to support unit testing.

D.

Construction injection can be used with multiple constructors without @Autowired annotation.

E.

Field injection is preferred over constructor injection from a unit testing standpoint.

Question 4

Which two options are REST principles? (Choose two.)

Options:

A.

RESTful applications use a stateless architecture.

B.

RESTful application use HTTP headers and status codes as a contract with the clients.

C.

RESTful applications cannot use caching.

D.

RESTful application servers keep track of the client state.

E.

RESTful applications favor tight coupling between the clients and the servers.

Question 5

Refer to the exhibit.

Which two statements are correct regarding the HelloAutoConfig auto-configuration class when it is specified in the META-INF/spring.factories file? (Choose two.)

Options:

A.

A HelloService bean will be created from the helloService() method even if the

HelloService.class is not in the classpath.

B.

A HelloService bean will be created from the helloService() method only when there is no other

HelloService bean in the ApplicationContext.

C.

This auto-configuration class is used only when the HelloService.class is not on the classpath.

D.

This auto-configuration class is used only when the HelloService.class is on the classpath.

E.

A HelloService bean will be created from the helloService() method and will replace existing a

HelloService bean in the ApplicationContext.

Question 6

Which three statements are advantages of using Spring’s Dependency Injection? (Choose three.)

Options:

A.

Dependency injection can make code easier to trace because it couples behavior with construction.

B.

Dependency injection reduces the start-up time of an application.

C.

Dependencies between application components can be managed external to the components.

D.

Configuration can be externalized and centralized in a small set of files.

E.

Dependency injection creates tight coupling between components.

F.

Dependency injection facilitates loose coupling between components.

Question 7

Refer to the exhibit.

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

Options:

A.

CustomerRepository should be a class, not an interface.

B.

JPA annotations are required on the Customer class to successfully use Spring Data JDBC.

C.

An implementation of this repository can be automatically generated by Spring Data JPA.

D.

A class that implements CustomerRepository must be implemented and declared as a Spring Bean.

Question 8

Which two statements are correct regarding the differences between @ConfigurationProperties and @Value? (Choose two.)

Options:

A.

@Value must be used for environment variables, as @ConfigurationProperties cannot access the environment.

B.

@Value supports relaxed binding of properties, but not property binding through SpEL.

C.

@ConfigurationProperties is preferable over @Value when type-safety during property binding is a concern.

D.

@ConfigurationProperties only bind properties from .properties files, not from .yml files.

E.

@ConfigurationProperties supports relaxed binding of properties, but not property binding through SpEL.

Question 9

Which two annotations indicate that the transaction for a transactional test method should be committed after the test method has completed? (Choose two.)

Options:

A.

@SqlMergeMode(false)

B.

@Rollback(false)

C.

@Commit

D.

@Sql(alwaysCommit=true)

E.

@Transactional(commit=true)

Question 10

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

Options:

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).

Question 11

Which two statements are true regarding Spring and Spring Boot Testing? (Choose two.)

Options:

A.

EasyMock is supported out of the box.

B.

@SpringBootTest or @SpringJUnitConfig can be used for creating an ApplicationContext.

C.

Mockito spy is not supported in Spring Boot testing by default.

D.

The spring-test dependency provides annotations such as @Mock and @MockBean.

E.

Integration and slice testing are both supported.

Question 12

Which three types can be used as @Controller method arguments? (Choose three.)

Options:

A.

Locale

B.

Principal

C.

Language

D.

Session

E.

Request

F.

HttpSession

Question 13

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

Options:

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.

Question 14

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

Options:

A.

REST is a Protocol.

B.

REST is Stateful.

C.

REST is Reliable.

D.

REST is Interoperable.

E.

REST is Relative.

Question 15

Refer to the exhibit.

Based on the default Spring behavior, choose the correct answer. (Choose the best answer.)

Options:

A.

One AccountRepository bean will be instantiated since the default scope is singleton.

B.

Three AccountRepository beans will be instantiated as the accountRepository() method will be called three times.

C.

Many AccountRepository beans will be instantiated, depending how often accountRepository(), transferService() and accountService() are called.

D.

Two AccountRepository beans will be instantiated as the accountRepository() method will be called two times.

Question 16

Which statement describes the propagation behavior of Propagation.REQUIRES_NEW annotation? (Choose the best answer.)

Options:

A.

Starts a new transaction but throws an exception if an active transaction already exists.

B.

Joins a transaction if one already exists; throws an exception if an active transaction does not exist.

C.

Starts a new transaction; if an active transaction already exists, it is suspended.

D.

Runs in a nested transaction if an active transaction exists; throws an exception if an active transaction does not exist.

Question 17

Which two statements are correct regarding Spring Boot auto-configuration customization? (Choose two.)

Options:

A.

Use the @AutoConfigureAfter or @AutoConfigureBefore annotations to apply configuration in a specific order.

B.

Disable specific auto-configuration classes by using the exclude attribute on the

@EnableAutoConfiguation annotation.

C.

Provide customized auto-configuration by subclassing the provided Spring Boot auto-configuration classes.

D.

Enable component scanning within auto-configuration classes to find necessary components.

E.

Control the order of auto-configuration classes applied with @AutoConfigureOrder.

Question 18

Refer to the exhibit.

What statement is true about @DirtiesContext?

Options:

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.

Question 19

Which two statements are true regarding storing user details in Spring Security? (Choose two.)

Options:

A.

With a custom UserDetailsService defined in the ApplicationContext, Spring Boot still creates the default user.

B.

Passwords must be hashed and the default hashing algorithm is MD5.

C.

User details can be stored in custom storage and retrieve them by implementing the

UserDetailsService interface.

D.

User details can be stored in a database, in LDAP, or in-memory.

E.

The user details includes username and password but not authorities.

Question 20

Refer to the exhibit.

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

Options:

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 21

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

Options:

A.

@Value(“#{daily.limit}”)

B.

@Value(“$(systemProperties.daily.limit)”)

C.

@Value(“$(daily.limit)”)

D.

@Value(“#{systemProperties[‘daily.limit’]}”)

E.

@Value(“#{systemProperties.daily.limit}”)

Question 22

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

Options:

A.

@Configuration

B.

@ComponentScan

C.

@SpringBootConfiguration

D.

@SpringApplication

E.

@AutoConfiguration

Question 23

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

Options:

A.

TestEntityManager provides all methods that are provided by EntityManager and more.

B.

If an embedded database is on the classpath, it will be used to configure a DataSource by default.

C.

It can be used for testing both JPA components and NoSQL components.

D.

It auto-configures a TestEntityManager bean.

E.

It can be used for testing JdbcTemplate.

Page: 1 / 6
Total 79 questions