VMware 2v0-72-22 practice test

Professional Develop VMware Spring Exam

Last exam update: May 17 ,2024
Page 1 out of 4. Viewing questions 1-15 out of 60

Question 1

Which two statements are correct regarding the Health Indicator status? (Choose two.)

  • 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.
Answer:

CD

User Votes:
A 1 votes
50%
B
50%
C 1 votes
50%
D
50%
E
50%

Explanation:
Reference:
https://docs.spring.io/spring-boot/docs/1.5.x/reference/html/production-ready-endpoints.html

Discussions
vote your answer:
A
B
C
D
E
0 / 1000

Question 2

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

  • 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.
Answer:

D

User Votes:
A
50%
B 1 votes
50%
C
50%
D
50%

Explanation:
Reference:
https://www.concretepage.com/spring-5/testpropertysource-example-spring-test

Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 3

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.
Answer:

BC

User Votes:
A 1 votes
50%
B 1 votes
50%
C
50%
D
50%
E
50%

Explanation:
Reference:
https://docs.spring.io/spring-boot/docs/current/reference/html/actuator.html

Discussions
vote your answer:
A
B
C
D
E
0 / 1000

Question 4

Refer to the exhibit.

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

  • 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.
Answer:

C

User Votes:
A
50%
B
50%
C 1 votes
50%
D
50%

Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 5

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.
Answer:

A

User Votes:
A 1 votes
50%
B
50%
C
50%
D
50%

Explanation:
Reference:
https://www.amitph.com/spring-aop-afterreturning-advice

Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 6

Refer to the exhibit.

How can a response status code be set for No Content (204)? (Choose the best answer.)

  • 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.
Answer:

C

User Votes:
A
50%
B 1 votes
50%
C
50%
D
50%

Explanation:
Reference:
https://stackoverflow.com/questions/55691288/is-this-the-correct-way-to-return-204-no-
content
- using-spring

Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 7

Which two statements are correct regarding Spring Boot auto-configuration? (Choose two.)

  • A. Auto-configuration uses @Conditional annotations to constrain when it should apply.
  • B. Auto-configuration could apply when a bean is missing but not when a bean is present.
  • C. Auto-configuration is applied by processing candidates listed in META-INF/spring.factories.
  • D. Auto-configuration could apply when a bean is present but not when a bean is missing.
  • E. Auto-configuration is applied before user-defined beans have been registered.
Answer:

DE

User Votes:
A
50%
B
50%
C
50%
D 1 votes
50%
E 1 votes
50%

Discussions
vote your answer:
A
B
C
D
E
0 / 1000

Question 8

Which two statements are true regarding storing user details in Spring Security? (Choose two.)

  • 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.
Answer:

AE

User Votes:
A 1 votes
50%
B
50%
C 1 votes
50%
D
50%
E
50%

Discussions
vote your answer:
A
B
C
D
E
0 / 1000

Question 9

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

  • 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.
Answer:

BD

User Votes:
A
50%
B 1 votes
50%
C 1 votes
50%
D
50%
E
50%

Explanation:
Reference:
https://docs.spring.io/spring-boot/docs/current/api/org/springframework/boot/test/autoconfigure/orm/jpa/DataJpaTest.html

Discussions
vote your answer:
A
B
C
D
E
0 / 1000

Question 10

Refer to the exhibit.

What is the id/name of the declared bean in this Java configuration class? (Choose the best answer.)

  • A. clientServiceImpl (starting with lowercase “c”)
  • B. clientServiceImpl (starting with uppercase “C”)
  • C. clientService (starting with lowercase “c”)
  • D. ClientService (starting with uppercase “C”)
Answer:

D

User Votes:
A 1 votes
50%
B
50%
C 1 votes
50%
D
50%

Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 11

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

  • 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.
Answer:

BD

User Votes:
A 1 votes
50%
B
50%
C 1 votes
50%
D
50%
E
50%

Discussions
vote your answer:
A
B
C
D
E
0 / 1000

Question 12

Refer to the exhibit.

Based on the default Spring behavior, choose the correct answer. (Choose the best answer.)

  • A. One AccountRepository bean will be instantiated since the default scope is singleton.
  • B. Three AccountRepository beans will be instantiated as the accountRepository() method will be called three times.
  • C. Many AccountRepository beans will be instantiated, depending how often accountRepository(), transferService() and accountService() are called.
  • D. Two AccountRepository beans will be instantiated as the accountRepository() method will be called two times.
Answer:

C

User Votes:
A 1 votes
50%
B
50%
C
50%
D
50%

Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 13

Which two statements are true about Spring Boot and Spring Data JPA? (Choose two.)

  • A. @EntityScan and spring.jpa.* properties can be used to customize Spring Data JPA.
  • B. Any kind of Hibernate property can be passed to Spring Data JPA like spring.jpa.properties.xxx.
  • C. Spring Data JPA is the only implementation for relational databases.
  • D. Scanning of JPA Entities can not be customized, the whole classpath is scanned.
  • E. Embedded Databases (H2, HSQLDB, Derby) are not re-created during the startup.
Answer:

CE

User Votes:
A
50%
B 1 votes
50%
C 1 votes
50%
D
50%
E
50%

Explanation:
Reference:
https://docs.spring.io/spring-boot/docs/1.5.14.RELEASE/reference/html/boot-features-sql.html

Discussions
vote your answer:
A
B
C
D
E
0 / 1000

Question 14

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

  • A. isolation
  • B. writeOnly
  • C. nestedTransaction
  • D. readWrite
  • E. propagation
Answer:

AE

User Votes:
A 1 votes
50%
B
50%
C
50%
D
50%
E 1 votes
50%

Explanation:
Reference:
https://learningviacode.blogspot.com/2012/10/attributes-in-springs-declarative.html

Discussions
vote your answer:
A
B
C
D
E
0 / 1000

Question 15

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

  • A. Used to designate the location of the application.properties file in a Spring Boot application.
  • B. Used to easily look up and return a single property value from some external property file.
  • C. Used to designate the file directory of the application.properties file in a Spring Boot application.
  • D. Used to add a set of name/value pairs to the Spring Environment from an external source.
Answer:

B

User Votes:
A 1 votes
50%
B
50%
C
50%
D
50%

Discussions
vote your answer:
A
B
C
D
0 / 1000
To page 2