Winter Special Limited Time 65% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: dumps65

VMware 2V0-72.22 Dumps

Page: 1 / 8
Total 79 questions

Professional Develop VMware Spring Questions and Answers

Question 1

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 2

Which two statements are true about Spring AOP? (Choose two.)

Options:

A.

The @After advice type is invoked regardless of whether a method successfully returned or an exception was thrown.

B.

In Spring AOP, a join point represents a method execution or property access.

C.

Spring AOP does not use AspectJ's pointcut expression language.

D.

Examples of cross-cutting concerns include security, caching, transaction.

E.

There are in total 4 types of advice, @Before, @After, @AfterReturning and @AfterThrowing.

Question 3

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.

Question 4

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

Options:

A.

Java system properties have higher precedence than the properties loaded from

@TestPropertySource.

B.

Properties defined @PropertySource are not loaded if @TestPropertySource is used.

C.

@TestPropertySource annotation loads a properties file relative to the root of the project by default.

D.

Inlined properties defined in @TestPropertySource can be used to override properties defined in property files.

Question 5

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 6

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 7

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 8

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 9

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 10

Refer to the exhibit.

as

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 11

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 12

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 13

Which statements is true?

Options:

A.

Methods annotated with @AfterEach will run only once before any tests in a class are executed.

B.

@BeforeAll annotation can only be used on non-static methods.

C.

Methods annotated with @BeforeAll will run only once before any tests in a class are executed.

D.

@AfterEach annotation must be used on a cleanup method when @BeforeEach is used.

Question 14

Refer to the exhibit.

as

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 15

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 16

Which following statements are true about Spring Data? (Choose two.)

Options:

A.

Spring Data implementations exist for many data storage types, such as MongoDB, Neo4j, and Redis.

B.

Spring Data works by applying the JPA annotations to data stores such as MongoDB, Neo4j, and Redis.

C.

Spring Data can greatly reduce the amount of “boilerplate” code typically needed for data access.

D.

Spring Data is specifically designed for JPA, JDBC, and relational database access only.

E.

Spring Data cannot be used together with Spring MVC.

Question 17

Refer to the exhibit.

as

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 18

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 19

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 20

What is a Spring Boot starter dependency? (Choose the best answer.)

Options:

A.

A setting for specifying which code you want Spring Boot to generate for you.

B.

A specific POM which you must build to control Spring Boot’s opinionated runtime.

C.

A pre-existing model project you can download and use as the basis of your project.

D.

An easy way to include multiple, coordinated dependencies related to a specific technology, like web or JDBC.

Question 21

Refer to the exhibit.

as

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 22

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 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 / 8
Total 79 questions