Professional Develop VMware Spring v1.0

Page:    1 / 6   
Exam contains 97 questions

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.


Answer : AE

Refer to the exhibit.

It is a Java code fragment from a Spring application. Which statement is true with regard to the above example? (Choose the best answer.)

  • A. This syntax is invalid because the result of the getBean() method call should be cast to ClientService.
  • B. It will return a bean called ClientService regardless of its id or name.
  • C. This syntax is invalid because the bean id must be specified as a method parameter.
  • D. It will return a bean of the type ClientService regardless of its id or name.


Answer : D

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

  • A. A pointcut expression cannot specify the type of parameters.
  • B. A pointcut expression will throw an exception if no methods are matched.
  • C. A pointcut expression cannot have a wildcard for a method name.
  • D. A pointcut expression can include operators such as the following: && (and), || (or), ! (not).
  • E. A pointcut expression can be used to select join points which have been annotated with a specific annotation.


Answer : DE

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


Answer : BDE

Which two use cases can be addressed by the method level security annotation @PreAuthorize? (Choose two.)

  • A. Allow access to a method based on user identity.
  • B. Allow access to a method based on the returned object.
  • C. Allow access to a method based on HTTP method.
  • D. Allow access to a method based on request URL.
  • E. Allow access to a method based on roles.


Answer : CE

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

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

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


Answer : AE

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

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

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

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

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

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

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

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

Page:    1 / 6   
Exam contains 97 questions

Talk to us!


Have any questions or issues ? Please dont hesitate to contact us

Certlibrary.com is owned by MBS Tech Limited: Room 1905 Nam Wo Hong Building, 148 Wing Lok Street, Sheung Wan, Hong Kong. Company registration number: 2310926
Certlibrary doesn't offer Real Microsoft Exam Questions. Certlibrary Materials do not contain actual questions and answers from Cisco's Certification Exams.
CFA Institute does not endorse, promote or warrant the accuracy or quality of Certlibrary. CFA® and Chartered Financial Analyst® are registered trademarks owned by CFA Institute.
Terms & Conditions | Privacy Policy