Professional Develop VMware Spring v1.0 (2V0-72.22)

Page:    1 / 6   
Total 90 questions

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.


Answer : A

Which two options are application slices that can be tested with Spring Boot Testing? (Choose two.)

  • A. Repository
  • B. Messaging
  • C. Web
  • D. Container
  • E. Client


Answer : AC

Which statements is true?

  • A. Methods annotated with @AfterEach will run only once before any tests in a class are executed.
  • B. @BeforeAll annotation can only be used on non-static methods.
  • C. Methods annotated with @BeforeAll will run only once before any tests in a class are executed.
  • D. @AfterEach annotation must be used on a cleanup method when @BeforeEach is used.


Answer : C

Using declarative transaction management, which situation will cause a transaction to roll back by default?

  • A. When any uncaught unchecked exception is thrown
  • B. When any type of exception is thrown, checked or unchecked
  • C. When any uncaught checked exception is thrown
  • D. Only when a Spring-specific exception is thrown


Answer : A

Refer to the exhibit.



What statement is true about @DirtiesContext?

  • A. It will close the existing cached ApplicationContext and recreate a new one before the test method.
  • B. It will close the existing cached ApplicationContext and recreate a new one after the test method.
  • C. It will keep the existing cached ApplicationContext, all changes to Spring managed beans will be reverted after the test.
  • D. It will recreate only the Spring managed beans that are modified inside the test method.


Answer : B

According to REST principles, which is the recommended way to update the order resource identified by 1234?

  • A. Send a PUT request to /orders/edit?id=1234.
  • B. Send a PUT request to /orders/1234.
  • C. Send a POST request to /orders/1234.
  • D. Send a POST request to /orders/edit?id=1234.


Answer : B

What's the password storage format when using the DelegatingPasswordEncoder?

  • A. encodedPassword{id}, where {id} is an identifier used to look up which PasswordEncoder should be used.
  • B. {id}encodedPassword, where {id} is an identifier used to look up which PasswordEncoder should be used.
  • C. {timestamp}encodedPassword, where {timestamp} is the time when the password was encoded.
  • D. {id}{salt}encodedPassword, where {id} is an identifier used to look up which PasswordEncoder should be used and {salt} a randomly generated salt.


Answer : B

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.


Answer : CE

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.


Answer : AD

The Spring RestTemplate class:

  • A. Can be used for non-blocking I/O, streaming applications, or handling reactive streams back pressure.
  • B. Requires HttpMessageConverters to be explicitly defined for it before it can be used.
  • C. Can only be used to talk to applications implemented using Spring MVC or WebFlux.
  • D. Can be used to send and receive HTTP data defined using Spring's RequestEntity and ResponseEntity.


Answer : D

Which two statements are true regarding a Spring Boot "fat" JAR? (Choose two.)

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


Answer : CE

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

  • A. It is an MVC framework that implements the JAX-RS specification,
  • B. mvc.properties is used to provide URL mappings to controllers.
  • C. Classes annotated with @Controller annotation can be detected by component scanning and loaded as Spring beans.
  • D. Spring MVC requires a Servlet container, Spring Boot can embed Tomcat, Jetty or Undertow.
  • E. A DispatcherServlet is created for every @Controller/@RestController annotated class.


Answer : CD

Spring bean classes are defined under a package called com.mycomp.service. What two options are required to enable component scanning? (Choose two.)

  • A. Ensure bean classes are annotated with the @Component annotation.
  • B. Add the @ComponentScan ("com.mycomp. service") to the Java configuration.
  • C. Ensure bean classes are annotated with the @Autowired annotation.
  • D. Ensure bean classes are annotated with the @Bean annotation.
  • E. Ensure bean classes are annotated with the @ComponentScan annotation.


Answer : AB

Which two statements are true regarding result set handling? (Choose two.)

  • A. JdbcTemplate is configured with a default RowMapper.
  • B. JdbcTemplate can return each row of a ResultSet as a Set.
  • C. JdbcTemplate can return each row of a ResultSet as a Map.
  • D. RowMapper interface is used for mapping a single row of a ResultSet to an object.
  • E. RowMapper interface cannot be used for multiple row queries.


Answer : CD

What Spring Boot Starter can be used for a Spring REST Application?

  • A. spring-boot-starter-web
  • B. spring-boot-starter-rest
  • C. spring-boot-starter-rest-mvc
  • D. spring-boot-starter-web-mvc


Answer : A

Page:    1 / 6   
Total 90 questions