New Year Special Limited Time Flat 70% Discount offer - Ends in 0d 00h 00m 00s - Coupon code: 70spcl

VMware 2V0-72.22 Professional Develop VMware Spring Exam Practice Test

Page: 1 / 8
Total 79 questions

Professional Develop VMware Spring Questions and Answers

Question 1

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 2

Refer to the exhibit.

Question # 2

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

Options:

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.

Question 3

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 4

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

Options:

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 5

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 6

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

Options:

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 7

Which two use cases can be addressed by the method level security annotation @PreAuthorize? (Choose two.)

Options:

A.

Allow access to a method based on user identity.

B.

Allow access to a method based on the returned object.

C.

Allow access to a method based on HTTP method.

D.

Allow access to a method based on request URL.

E.

Allow access to a method based on roles.

Question 8

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 9

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

Options:

A.

@TestApplicationContext is used to define additional beans or customizations for a test.

B.

Test methods in a @SpringBootTest class are transactional by default.

C.

@SpringBootTest is typically used for integration testing.

D.

Test methods annotated with @SpringBootTest will recreate the ApplicationContext.

E.

@SpringBootTest without any configuration classes expects there is only one class annotated with @SpringBootConfiguration in the application.

Question 10

Which two statements are correct regarding Spring Boot 2.x Actuator Metrics? (Choose two.)

Options:

A.

An external monitoring system must be used with Actuator.

B.

The metrics endpoint /actuator/metrics is exposed over HTTP by default.

C.

Timer measures both the number of timed events and the total time of all events timed.

D.

Custom metrics can be measured using Meter primitives such as Counter, Gauge, Timer, and DistributionSummary.

E.

A metric must be created with one or more tags.

Question 11

Refer to the exhibit.

Question # 11

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 12

Which two statements are correct regarding the Actuator info endpoint? (Choose two.)

Options:

A.

It provides configuration options through which only an authenticated user can display application information.

B.

It is not enabled by default.

C.

It can be used to display arbitrary application information.

D.

It can be used to change a property value on a running application.

E.

Typically it is used to display build or source control information.

Question 13

Which two statements are correct regarding the Actuator loggers endpoint? (Choose two.)

Options:

A.

To get a logging level of a package called account.web, you can access the /actuator/loggers/account.web endpoint.

B.

An application restart is required to change the logging level of the package.

C.

In order to use the loggers endpoint, a logger implementation dependency needs to be added.

D.

The logging levels of a package that can be accessed via the loggers endpoint include configuredLevel and effectiveLevel.

Question 14

Refer to the exhibit.

Question # 14

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 15

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

Options:

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 16

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

Options:

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.

Question 17

Which two options are valid optional attributes for Spring’s @Transactional annotation? (Choose two.)

Options:

A.

isolation

B.

writeOnly

C.

nestedTransaction

D.

readWrite

E.

propagation

Question 18

Which two statements are correct regarding the Health Indicator status? (Choose two.)

Options:

A.

The last status in a sorted list of HealthIndicators is used to derive the final system health.

B.

The status with the least severity is used as the top-level status.

C.

Custom status values can be created.

D.

The built-in status values are DOWN, OUT_OF_SERVICE, UNKNOWN, and UP in decreasing order of severity.

E.

The severity order cannot be changed due to security reasons.

Question 19

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 20

Which statement is true about the @PropertySource annotation? (Choose the best answer.)

Options:

A.

Used to designate the location of the application.properties file in a Spring Boot application.

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 add a set of name/value pairs to the Spring Environment from an external source.

Question 21

Which two statements about the @Autowired annotation are true? (Choose two.)

Options:

A.

@Autowired fields are injected after any config methods are invoked.

B.

Multiple arguments can be injected into a single method using @Autowired.

C.

By default, if a dependency cannot be satisfied with @Autowired, Spring throws a RuntimeException.

D.

If @Autowired is used on a class, field injection is automatically performed for all dependencies.

E.

@Autowired can be used to inject references into BeanPostProcessor and

BeanFactoryPostProcessor.

Question 22

Which two statements are true regarding a Spring Boot-based Spring MVC application? (Choose two.)

Options:

A.

The default embedded servlet container can be replaced with Undertow.

B.

Jetty is the default servlet container.

C.

Spring Boot starts up an embedded servlet container by default.

D.

The default port of the embedded servlet container is 8088.

E.

Spring MVC starts up an in-memory database by default.

Question 23

Which three types of objects can be returned form a JdbcTemplate query? (Choose three.)

Options:

A.

Generic MapS

B.

Simple types (int, long, String, etc)

C.

JSONObject

D.

User defined types

E.

Properties

F.

XMLObject

Page: 1 / 8
Total 79 questions