VMware 2V0-72.22 - Professional Develop VMware Spring Exam
Page: 2 / 18
Total 90 questions
Question #6 (Topic: Exam A)
Which two statements are true regarding a Spring Boot-based Spring MVC application? (Choose two.)
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.
Answer: BC
Question #7 (Topic: Exam A)
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.
Answer: CD
Question #8 (Topic: Exam A)
Refer to the exhibit.

Assume that the application is using Spring transaction management which uses Spring AOP internally.
Choose the statement that describes what is happening when the update1 method is called? (Choose the best answer.)

Assume that the application is using Spring transaction management which uses Spring AOP internally.
Choose the statement that describes what is happening when the update1 method is called? (Choose the best answer.)
A. There are 2 transactions because REQUIRES_NEW always runs in a new transaction.
B. An exception is thrown as another transaction cannot be started within an existing transaction.
C. There is only one transaction because REQUIRES_NEW will use an active transaction if one already exists.
D. There is only one transaction initiated by update1() because the call to update2() does not go through the proxy.
Answer: D
Question #9 (Topic: Exam A)
Which two statements are true concerning constructor injection? (Choose two.)
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.
Answer: CE
Question #10 (Topic: Exam A)
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) {…}
Answer: ADF