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

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

Page: 1 / 8
Total 79 questions

Professional Develop VMware Spring Questions and Answers

Testing Engine

  • Product Type: Testing Engine
$42  $119.99

PDF Study Guide

  • Product Type: PDF Study Guide
$36.75  $104.99
Question 1

Which option is true about use of mocks in a Spring Boot web slice test? (Choose the best answer.)

Options:

A.

Mocking a Spring Bean requires annotating it with @MockBean annotation.

B.

If a Spring Bean already exists in the web slice test spring context, it cannot be mocked.

C.

Mocks cannot be used in a Spring Boot web slice test.

D.

Mocking a Spring Bean requires annotating it with @Mock annotation.

Question 2

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 3

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

Options:

A.

prototype

B.

singleton

C.

request

D.

session

Question 4

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 5

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 6

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 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 true regarding a Spring Boot "fat" JAR? (Choose two.)

Options:

A.

The "fat" JAR contains both the class files and the source files for your project.

B.

The "fat" JAR requires an external Servlet container.

C.

The "fat" JAR contains compiled classes and dependencies that your code needs to run.

D.

The "fat" JAR can contain multiple embedded application servers.

E.

The "fat" JAR is created by the Spring Boot Maven plugin or Gradle plugin.

Question 9

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 10

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.

Question 11

Which two options are application slices that can be tested with Spring Boot Testing? (Choose two.)

Options:

A.

Repository

B.

Messaging

C.

Web

D.

Container

E.

Client

Question 12

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 13

What are the two reasons Spring be used to build a Java application? (Choose two.)

Options:

A.

Spring automates a Java application build.

B.

Spring provides a Dependency Injection container.

C.

Spring automates deployment of Java applications to all of the major cloud providers.

D.

Spring provides comprehensive Java IDE support.

E.

Spring provides abstractions over infrastructure such as persistence and messaging.

Question 14

Which two statements describe Spring JdbcTemplate? (Choose two.)

Options:

A.

All JdbcTemplate methods throw SQLException which you are required to handle.

B.

The JdbcTemplate provides the ability to work with result sets.

C.

The JdbcTemplate can only perform update but not insert to the database.

D.

The JdbcTemplate provides methods for query execution.

E.

The JdbcTemplate generates SQL statements.

Question 15

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 16

Which statement defines a pointcut? (Choose the best answer.)

Options:

A.

A point in the execution of a program such as a method call or field assignment.

B.

An expression that selects one or more join points.

C.

A module that encapsulated advices.

D.

Code to be executed at each selected join point.

Question 17

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 18

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 19

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 20

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 21

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

Options:

A.

Allows for the transformation of Spring bean definitions after the beans have been instantiated.

B.

Allows for the transformation of Spring bean definitions before the beans are instantiated.

C.

Creates proxies for the Spring beans that require an extra behavior like transaction management.

D.

PropertySourcesPlaceholderConfigurer implements BeanFactoryPostProcessor and is used to read property values from the Spring Environment.

E.

Detects annotations such as @PostConstruct and @PreDestroy and then invokes appropriate behavior.

Question 22

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 23

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.

Page: 1 / 8
Total 79 questions