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

2V0-72.22 Professional Develop VMware Spring Questions and Answers

Questions 4

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.

Buy Now
Questions 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.

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

Buy Now
Questions 7

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.

Buy Now
Questions 8

If a class is annotated with @Component, what should be done to have Spring automatically detect the annotated class and load it as a bean? (Choose the best answer.)

Options:

A.

Ensure a valid bean name in the @Component annotation is specified.

B.

Ensure a valid @ComponentScan annotation in the Java configuration is specified.

C.

Ensure a valid @Scope for the class is specified.

D.

Ensure a valid @Bean for the class is specified.

Buy Now
Questions 9

Refer to the exhibit.

Which two methods will be implemented at runtime if declared in a Spring Data JPA Repository? (Choose two.)

Options:

A.

public Customer getsingle(Long id);

B.

public Customer findFirstOrderDateMax();

C.

public Customer findByEmail(String email);

D.

public Customer findFirstByOrderDateBetween(Date d1, Date d2);

E.

public Customer findCustomerByName(String name);

Buy Now
Questions 10

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.

Buy Now
Questions 11

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.

Buy Now
Questions 12

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.

Buy Now
Questions 13

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.

Buy Now
Questions 14

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.

Buy Now
Questions 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.

Questions 16

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.

Buy Now
Questions 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.

Buy Now
Questions 18

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.

Buy Now
Questions 19

Refer to the exhibit.

How can a Spring Bean be created from this LegacySingleton class?

Options:

A.

Call LegacySingleton.getInstance() from within a @Bean method and return the instance.

B.

Return an instance of LegacySingleton using the new keyword from a @Bean method.

C.

It is not possible without modifying the LegacySingleton class, the constructor must be public.

D.

Modify the LegacySingleton class by adding the @Autowired annotation to the instance variable.

Buy Now
Questions 20

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

Options:

A.

@Configuration

B.

@ComponentScan

C.

@SpringBootConfiguration

D.

@SpringApplication

E.

@AutoConfiguration

Buy Now
Questions 21

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.

Buy Now
Questions 22

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

Questions 23

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

Options:

A.

It auto-configures a MockMvc.

B.

It will only scan for @Controller beans in the source code.

C.

It is used for testing Spring MVC components such as @Controller with a running server.

D.

Typically it is used in combination with @MockBean when there is a dependency bean to be mocked.

E.

It is typically used with @ExtendWith(MockitoExtension.class) in JUnit 5.

Buy Now
Exam Code: 2V0-72.22
Exam Name: Professional Develop VMware Spring
Last Update: Dec 3, 2024
Questions: 79

PDF + Testing Engine

$134.99

Testing Engine

$99.99

PDF (Q&A)

$84.99