Summer Sale Limited Time 60% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: 28522818

Home > VMware > VCP-AM Develop 2022 > 2V0-72.22

2V0-72.22 Professional Develop VMware Spring Question and Answers

Question # 4

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

A.

isolation

B.

writeOnly

C.

nestedTransaction

D.

readWrite

E.

propagation

Full Access
Question # 5

Which two options will inject the value of the daily.limit system property? (Choose two.)

A.

@Value(“#{daily.limit}”)

B.

@Value(“$(systemProperties.daily.limit)”)

C.

@Value(“$(daily.limit)”)

D.

@Value(“#{systemProperties[‘daily.limit’]}”)

E.

@Value(“#{systemProperties.daily.limit}”)

Full Access
Question # 6

Which two statements are true regarding the RestTemplate class? (Choose two.)

A.

It supports asynchronous non-blocking model.

B.

It automatically supports sending and receiving Java objects.

C.

It provides convenience methods for writing REST clients.

D.

It provides convenience methods for writing REST services.

E.

Sending an HTTP request with a custom header is not possible when using RestTemplate.

Full Access
Question # 7

Spring Boot will find and load property files in which of the following? (Choose the best answer.)

A.

A *.properties file matching the name of the class annotated with @SpringBootApplication.

B.

config.properties or config.yml, usually located in the classpath root.

C.

application.properties or application.yml, usually located in the classpath root.

D.

env.properties or env.yml, usually located in the classpath root.

Full Access
Question # 8

Which statement is true? (Choose the best answer.)

A.

@ActiveProfiles is a class-level annotation that is used to instruct the Spring TestContext Framework to record all application events that are published in the ApplicationContext during the execution of a single test.

B.

@ActiveProfiles is a class-level annotation that you can use to configure how the Spring TestContext Framework is bootstrapped.

C.

@ActiveProfiles is a class-level annotation that you can use to configure the locations of properties files and inlined properties to be added to the set of PropertySources in the Environment for an ApplicationContext loaded for an integration test.

D.

@ActiveProfiles is a class-level annotation that is used to declare which bean definition profiles should be active when loaded an ApplicationContext for an integration test.

Full Access
Question # 9

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

A.

REST is a Protocol.

B.

REST is Stateful.

C.

REST is Reliable.

D.

REST is Interoperable.

E.

REST is Relative.

Full Access
Question # 10

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

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.

Full Access
Question # 11

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

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.

Full Access
Question # 12

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

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.

Full Access
Question # 13

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

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.

Full Access
Question # 14

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

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.

Full Access
Question # 15

Which two statements are correct when @SpringBootApplication is annotated on a class? (Choose two.)

A.

It causes Spring Boot to enable auto-configuration by default.

B.

Component scanning will start from the package of the class.

C.

All other annotations on the class will be ignored.

D.

Methods in the class annotated with @Bean will be ignored.

E.

A separate ApplicationContext will be created for each class annotated with

@SpringBootApplication.

Full Access
Question # 16

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

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) {…}

Full Access
Question # 17

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

A.

@Configuration

B.

@ComponentScan

C.

@SpringBootConfiguration

D.

@SpringApplication

E.

@AutoConfiguration

Full Access
Question # 18

Refer to the exhibit.

Which two statements are correct regarding auto-configuration of DataSource and JdbcTemplate beans given a Spring Boot application with only these two dependencies? (Choose two.)

A.

A DataSource bean will not be auto-configured.

B.

A JdbcTemplate bean will not be auto-configured.

C.

A JdbcTemplate bean will be auto-configured.

D.

A DataSource bean will be auto-configured only if a JdbcTemplate bean is explicitly defined.

E.

A DataSource bean will be auto-configured.

Full Access
Question # 19

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

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.

Full Access
Question # 20

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

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.

Full Access
Question # 21

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

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.

Full Access
Question # 22

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

A.

Generic MapS

B.

Simple types (int, long, String, etc)

C.

JSONObject

D.

User defined types

E.

Properties

F.

XMLObject

Full Access
Question # 23

Refer to the exhibit.

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

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.

Full Access