September/2022 Latest Braindump2go 2V0-72.22 Exam Dumps with PDF and VCE Free Updated Today! Following are some new Braindump2go 2V0-72.22 Real Exam Questions!
Question: 20
Which statement is true? (Choose the best answer.)
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.
B. @ActiveProfiles is a class-level annotation that you can use to configure how the Spring TestContext Framework is bootstrapped.
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.
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.
Answer: D
Reference:https://docs.spring.io/spring-framework/docs/4.2.x/spring-framework-reference/html/integration-testing.html
Question: 21
Which two statements are true about REST? (Choose two.)
A. REST is a Protocol.
B. REST is Stateful.
C. REST is Reliable.
D. REST is Interoperable.
E. REST is Relative.
Answer: AD
Reference:https://www.tutorialspoint.com/restful/restful_introduction.htm
Question: 22
Spring Boot will find and load property files in which of the following? (Choose the best answer.)
A. A *.properties file matching the name of the class annotated with @SpringBootApplication.
B. config.properties or config.yml, usually located in the classpath root.
C. application.properties or application.yml, usually located in the classpath root.
D. env.properties or env.yml, usually located in the classpath root.
Answer: C
Reference:https://stackabuse.com/how-to-access-property-file-values-in-spring-boot/
Question: 23
Which three dependencies are provided by the spring-boot-starter-test? (Choose three.)
A. Cucumber
B. Hamcrest
C. spring-test
D. Junit
E. EasyMock
F. PowerMock
Answer: BDE
Reference:https://www.baeldung.com/spring-boot-testing
Question: 24
Which two statements are correct regarding Spring Boot auto-configuration customization? (Choose two.)
A. Use the @AutoConfigureAfter or @AutoConfigureBefore annotations to apply configuration in a specific order.
B. Disable specific auto-configuration classes by using the exclude attribute on the @EnableAutoConfiguation annotation.
C. Provide customized auto-configuration by subclassing the provided Spring Boot auto-configuration classes.
D. Enable component scanning within auto-configuration classes to find necessary components.
E. Control the order of auto-configuration classes applied with @AutoConfigureOrder.
Answer: AB
Reference: https://docs.spring.io/spring-boot/docs/1.4.3.RELEASE/reference/html/using-boot-auto-configuration.html
Question: 25
Which two statements about the @Autowired annotation are true? (Choose two.)
A. @Autowired fields are injected after any config methods are invoked.
B. Multiple arguments can be injected into a single method using @Autowired.
C. By default, if a dependency cannot be satisfied with @Autowired, Spring throws a RuntimeException.
D. If @Autowired is used on a class, field injection is automatically performed for all dependencies.
E. @Autowired can be used to inject references into BeanPostProcessor and BeanFactoryPostProcessor.
Answer: BE
Question: 26
Which two statements are correct regarding the @EnableAutoConfiguration annotation? (Choose two.)
A. It is a meta-annotation on the @SpringBootApplication composed annotation.
B. It enables auto-configuration of the ApplicationContext by attempting to guess necessary beans.
C. It is meta-annotation on the @SpringBootConfiguration composed annotation.
D. It has the same effect regardless of the package of the class that is annotated with it.
E. It ensures auto-configuration is applied before user-defined beans have been registered.
Answer: AD
Reference:https://docs.spring.io/spring-boot/docs/current/api/org/springframework/boot/autoconfigure/ EnableAutoConfiguration.html
Question: 27
Which two statements are true concerning the BeanPostProcessor Extension point? (Choose two.)
A. BeanPostProcessors are called before the dependencies have been injected.
B. Custom BeanPostProcessors can be implemented for Spring applications.
C. BeanPostProcessors are called before the BeanFactoryPostProcessors.
D. BeanPostProcessors are called during the initialization phase of a bean life cycle.
E. BeanPostProcessors cannot be ordered in a Spring Boot application.
Answer: BD
Reference:https://docs.spring.io/spring-framework/docs/3.0.0.M3/reference/html/ch04s07.html
Question: 28
Which two statements are true about @Controller annotated classes? (Choose two.)
A. The @Controller annotated classes can only render views.
B. The classes are eligible for handling requests in Spring MVC.
C. The classes must be annotated together with @EnableMvcMappings to be discovered via component scanning.
D. @Controller is interchangeable with @RestController with no extra code changes for the methods inside the class.
E. The @Controller annotation is a stereotype annotation like @Component.
Answer: BE
Reference:https://www.baeldung.com/spring-mvc-handler-adapters https://www.dineshonjava.com/stereotype-annotations-in-spring/
Question: 29
Which three types can be used as @Controller method arguments? (Choose three.)
A. Locale
B. Principal
C. Language
D. Session
E. Request
F. HttpSession
Answer: AEF
Reference:https://docs.spring.io/spring-framework/docs/3.0.0.M4/spring-framework- reference/html/ ch15s03.html
Question: 30
Which three statements are advantages of using Spring’s Dependency Injection? (Choose three.)
A. Dependency injection can make code easier to trace because it couples behavior with construction.
B. Dependency injection reduces the start-up time of an application.
C. Dependencies between application components can be managed external to the components.
D. Configuration can be externalized and centralized in a small set of files.
E. Dependency injection creates tight coupling between components.
F. Dependency injection facilitates loose coupling between components.
Answer: BDE
Reference:https://raviroza.com/tight-coupling-and-loose-coupling-in-spring-framework/
Question: 31
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
Reference:https://www.journaldev.com/21556/springbootapplication-springapplication
Question: 32
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
Question: 33
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
Reference:https://www.baeldung.com/spring-aop-pointcut-tutorial
Question: 34
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
Question: 35
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
Reference:https://docs.spring.io/spring-security/site/docs/5.2.11.RELEASE/reference/html/authorization.html
Question: 36
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
Question: 37
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
Reference:https://learningviacode.blogspot.com/2012/10/attributes-in-springs-declarative.html
Question: 38
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
Reference:https://docs.spring.io/spring-boot/docs/1.5.14.RELEASE/reference/html/boot-features-sql.html
Question: 39
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
Question: 40
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
Question: 41
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
Question: 42
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
Reference:https://docs.spring.io/spring-boot/docs/current/api/org/springframework/boot/test/autoconfigure/orm/jpa/DataJpaTest.html
Question: 43
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
Question: 44
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
Question: 45
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
Reference: https://stackoverflow.com/questions/55691288/is-this-the-correct-way-to-return-204-no- content- using-spring
Resources From:
1.2022 Latest Braindump2go 2V0-72.22 Exam Dumps (PDF & VCE) Free Share:
https://www.braindump2go.com/2v0-72-22.html
2.2022 Latest Braindump2go 2V0-72.22 PDF and 2V0-72.22 VCE Dumps Free Share:
https://drive.google.com/drive/folders/1KnnAVOsBnO2kCaQ6lFtq4qJB-DQ_ahwO?usp=sharing
3.2021 Free Braindump2go 2V0-72.22 Exam Questions Download:
https://www.braindump2go.com/free-online-pdf/1V0-81.20-PDF-Dumps(1-20).pdf
https://www.braindump2go.com/free-online-pdf/1V0-81.20-VCE-Dumps(21-41).pdf
Free Resources from Braindump2go,We Devoted to Helping You 100% Pass All Exams!