Skip to main content

2V0-72.22 Real Exam Questions

Professional Develop VMware Spring

60 questions available · Page 1 of 6

Updated Exam DumpsVerified AnswersPass Guarantee

Get Complete Exam Dumps
Question 1 Multiple choice

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

  1. A

    EasyMock is supported out of the box.

  2. B

    @SpringBootTest or @SpringJUnitConfig can be used for creating an ApplicationContext.

  3. C

    Mockito spy is not supported in Spring Boot testing by default.

  4. D

    The spring-test dependency provides annotations such as @Mock and @MockBean.

  5. E

    Integration and slice testing are both supported.

Show answer and explanation

Correct answers: C, D

Explanation

References:
https://docs.spring.io/spring-boot/docs/2.1.5.RELEASE/reference/html/boot-features-testing.html

Question 2 Multiple choice

Which two statements are correct regarding Spring Boot 2.
x Actuator Metrics? (Choose two.)

  1. A

    An external monitoring system must be used with Actuator.

  2. B

    The metrics endpoint /actuator/metrics is exposed over HTTP by default.

  3. C

    Timer measures both the number of timed events and the total time of all events timed.

  4. D

    Custom metrics can be measured using Meter primitives such as Counter, Gauge, Timer, and DistributionSummary.

  5. E

    A metric must be created with one or more tags.

Show answer and explanation

Correct answers: A, B

Question 3 Multiple choice

Which two statements are correct regarding the @EnableAutoConfiguration annotation? (Choose two.)

  1. A

    It is a meta-annotation on the @SpringBootApplication composed annotation.

  2. B

    It enables auto-configuration of the ApplicationContext by attempting to guess necessary beans.

  3. C

    It is meta-annotation on the @SpringBootConfiguration composed annotation.

  4. D

    It has the same effect regardless of the package of the class that is annotated with it.

  5. E

    It ensures auto-configuration is applied before user-defined beans have been registered.

Show answer and explanation

Correct answers: A, D

Explanation

References:
https://docs.spring.io/spring-boot/docs/current/api/org/springframework/boot/autoconfigure/
EnableAutoConfiguration.html

Question 4 Multiple choice

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

  1. A

    With a custom UserDetailsService defined in the ApplicationContext, Spring Boot still creates the default user.

  2. B

    Passwords must be hashed and the default hashing algorithm is MD5.

  3. C

    User details can be stored in custom storage and retrieve them by implementing the UserDetailsService interface.

  4. D

    User details can be stored in a database, in LDAP, or in-memory.

  5. E

    The user details includes username and password but not authorities.

Show answer and explanation

Correct answers: A, E

Question 5 Multiple choice

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

  1. A

    TestEntityManager provides all methods that are provided by EntityManager and more.

  2. B

    If an embedded database is on the classpath, it will be used to configure a DataSource by default.

  3. C

    It can be used for testing both JPA components and NoSQL components.

  4. D

    It auto-configures a TestEntityManager bean.

  5. E

    It can be used for testing JdbcTemplate.

Show answer and explanation

Correct answers: B, D

Explanation

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

Question 6 Single choice

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

  1. A

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

  2. B

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

  3. C

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

  4. D

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

Show answer and explanation

Correct answer: C

Explanation

References:
https://stackabuse.com/how-to-access-property-file-values-in-spring-boot/

Question 7 Multiple choice

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

  1. A

    @EntityScan and spring.jpa.* properties can be used to customize Spring Data JPA.

  2. B

    Any kind of Hibernate property can be passed to Spring Data JPA like spring.jpa.properties.xxx.

  3. C

    Spring Data JPA is the only implementation for relational databases.

  4. D

    Scanning of JPA Entities can not be customized, the whole classpath is scanned.

  5. E

    Embedded Databases (H2, HSQLDB, Derby) are not re-created during the startup.

Show answer and explanation

Correct answers: C, E

Explanation

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

Question 8 Single choice

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

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

  2. B

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

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

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

Show answer and explanation

Correct answer: D

Explanation

References:
https://docs.spring.io/spring-framework/docs/4.2.x/spring-framework-reference/html/integration-testing.html

Question 9 Multiple choice

Which two statements about the @Autowired annotation are true? (Choose two.)

  1. A

    @Autowired fields are injected after any config methods are invoked.

  2. B

    Multiple arguments can be injected into a single method using @Autowired.

  3. C

    By default, if a dependency cannot be satisfied with @Autowired, Spring throws a RuntimeException.

  4. D

    If @Autowired is used on a class, field injection is automatically performed for all dependencies.

  5. E

    @Autowired can be used to inject references into BeanPostProcessor and BeanFactoryPostProcessor.

Show answer and explanation

Correct answers: B, E

Question 10 Multiple choice

Which two statements about pointcut expressions are true? (Choose two.)

  1. A

    A pointcut expression cannot specify the type of parameters.

  2. B

    A pointcut expression will throw an exception if no methods are matched.

  3. C

    A pointcut expression cannot have a wildcard for a method name.

  4. D

    A pointcut expression can include operators such as the following: && (and), || (or), ! (not).

  5. E

    A pointcut expression can be used to select join points which have been annotated with a specific annotation.

Show answer and explanation

Correct answers: D, E

Explanation

References:
https://www.baeldung.com/spring-aop-pointcut-tutorial