Winter Special Flat 65% Limited Time Discount offer - Ends in 0d 00h 00m 00s - Coupon code: suredis

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

Demo: 23 questions
Total 79 questions

Professional Develop VMware Spring Questions and Answers

Question 1

Which two statements are true about Spring Boot and Spring Data JPA? (Choose two.)

Options:

A.

@EntityScan and spring.jpa.* properties can be used to customize Spring Data JPA.

B.

Any kind of Hibernate property can be passed to Spring Data JPA like spring.jpa.properties.xxx.

C.

Spring Data JPA is the only implementation for relational databases.

D.

Scanning of JPA Entities can not be customized, the whole classpath is scanned.

E.

Embedded Databases (H2, HSQLDB, Derby) are not re-created during the startup.

Question 2

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.

Question 3

Which is the correct approach to register for a bean destruction callback?

Options:

A.

Annotate the callback method with @PostDestroy.

B.

Annotate the callback method with @PreDestroy.

C.

Add the @Lazy annotation to the bean configuration.

D.

Configure the bean instance to use prototype scope.

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

Refer to the exhibit.

How can a response status code be set for No Content (204)? (Choose the best answer.)

Options:

A.

Annotate the update() handler method with @PutMapping(“/store/orders/{id”}”, HttpStatus.NO_CONTENT).

B.

Annotate the update() handler method with @ResponseStatus(HttpStatus.NO_CONTENT).

C.

Annotate the update() handler method with @ResponseEntity(204).

D.

The update() handler method cannot return a void type, it must return a ResponseEntity type.

Question 6

Which statement describes the @AfterReturning advice type? (Choose the best answer.)

Options:

A.

The advice is invoked only if the method returns successfully but not if it throws an exception.

B.

The @AfterReturning advice allows behavior to be added after a method returns even if it throws an exception.

C.

The advice has complete control over the method invocation; it could even prevent the method from being called at all.

D.

Typically used to prevent any exception, thrown by the advised method, from propagating up the call-stack.

Question 7

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 8

Which two statements are true about @Controller annotated classes? (Choose two.)

Options:

A.

The @Controller annotated classes can only render views.

B.

The classes are eligible for handling requests in Spring MVC.

C.

The classes must be annotated together with @EnableMvcMappings to be discovered via component scanning.

D.

@Controller is interchangeable with @RestController with no extra code changes for the methods inside the class.

E.

The @Controller annotation is a stereotype annotation like @Component.

Question 9

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

Options:

A.

Auto-configuration uses @Conditional annotations to constrain when it should apply.

B.

Auto-configuration could apply when a bean is missing but not when a bean is present.

C.

Auto-configuration is applied by processing candidates listed in META-INF/spring.factories.

D.

Auto-configuration could apply when a bean is present but not when a bean is missing.

E.

Auto-configuration is applied before user-defined beans have been registered.

Question 10

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 11

Which two statements about pointcut expressions are true? (Choose two.)

Options:

A.

A pointcut expression cannot specify the type of parameters.

B.

A pointcut expression will throw an exception if no methods are matched.

C.

A pointcut expression cannot have a wildcard for a method name.

D.

A pointcut expression can include operators such as the following: && (and), || (or), ! (not).

E.

A pointcut expression can be used to select join points which have been annotated with a specific annotation.

Question 12

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 13

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 14

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 15

Which two statements describe the ApplicationContext correctly? (Choose two.)

Options:

A.

The ApplicationContext is the root interface for accessing the Spring container.

B.

The ApplicationContext lazy initializes beans by default.

C.

The ApplicationContext can be created in a test environment, web application, and in a standalone application.

D.

The ApplicationContext does not include all functionality of the BeanFactory.

E.

The ApplicationContext maintains singleton beans that are instantiated by the Spring runtime.

Question 16

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 17

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 18

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 19

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 20

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 21

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 22

Which two statements are correct regarding the @EnableAutoConfiguration annotation? (Choose two.)

Options:

A.

It is a meta-annotation on the @SpringBootApplication composed annotation.

B.

It enables auto-configuration of the ApplicationContext by attempting to guess necessary beans.

C.

It is meta-annotation on the @SpringBootConfiguration composed annotation.

D.

It has the same effect regardless of the package of the class that is annotated with it.

E.

It ensures auto-configuration is applied before user-defined beans have been registered.

Question 23

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

Options:

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.

Demo: 23 questions
Total 79 questions