2V0-72.22無料試験学習ガイド!(更新された81問あります) [Q31-Q54]

Share

2V0-72.22無料試験学習ガイド!(更新された81問あります)

2V0-72.22問題集にはVCP-AM Develop 2022認証済み試験問題と解答

質問 # 31
Which two statements are true regarding Spring and Spring Boot Testing? (Choose two.)

  • A. The spring-test dependency provides annotations such as @Mock and @MockBean.
  • B. @SpringBootTest or @SpringJUnitConfig can be used for creating an ApplicationContext.
  • C. Integration and slice testing are both supported.
  • D. EasyMock is supported out of the box.
  • E. Mockito spy is not supported in Spring Boot testing by default.

正解:B、C

解説:
Spring and Spring Boot provide various annotations and utilities to support testing of different layers of the application. To create an ApplicationContext for integration tests, we can use either @SpringBootTest or @SpringJUnitConfig annotations. The former is a specialized annotation that also provides additional features such as auto-configuration, web environment emulation, and test properties management. The latter is a general-purpose annotation that combines @ContextConfiguration and @ExtendWith(SpringExtension.class) annotations.
To perform slice testing, which focuses on testing a specific layer or feature of the application in isolation, we can use annotations such as @WebMvcTest, @DataJpaTest, @RestClientTest, etc. These annotations will only load the relevant beans for the tested slice and mock or stub the other dependencies.


質問 # 32
Which two statements are true regarding the RestTemplate class? (Choose two.)

  • A. Sending an HTTP request with a custom header is not possible when using RestTemplate.
  • B. It automatically supports sending and receiving Java objects.
  • C. It provides convenience methods for writing REST services.
  • D. It provides convenience methods for writing REST clients.
  • E. It supports asynchronous non-blocking model.

正解:A、B


質問 # 33
Which two statements are true regarding Spring Security? (Choose two.)

  • A. A special Java Authentication and Authorization Service (JAAS) policy file needs to be configured.
  • B. Authentication data can be accessed using a variety of different mechanisms, including databases and LDAP.
  • C. It provides a strict implementation of the Java EE Security specification.
  • D. Access control can be configured at the method level.
  • E. In the authorization configuration, the usage of permitAll () allows bypassing Spring security completely.

正解:D、E


質問 # 34
Which two options will inject the value of the daily.limit system property? (Choose two.)

  • A. @Value("#{systemProperties['daily.limit']}")
  • B. @Value("$(daily.limit)")
  • C. @Value("#{systemProperties.daily.limit}")
  • D. @Value("$(systemProperties.daily.limit)")
  • E. @Value("#{daily.limit}")

正解:A、D


質問 # 35
Which two are required to use transactions in Spring? (Choose two.)

  • A. Add @EnableTransactionManagement to a Java configuration class.
  • B. Annotate a class, an interface, or individual methods requiring a transaction with the @Transactional annotation.
  • C. Write a Spring AOP advice to implement transactional behavior.
  • D. A class requiring a transaction must implement the TransactionInterceptor interface.
  • E. A class must be annotated with @Service and @Transaction.

正解:A、B


質問 # 36
Spring puts each bean instance in a scope. What is the default scope? (Choose the best answer.)

  • A. session
  • B. singleton
  • C. request
  • D. prototype

正解:B


質問 # 37
In which three ways are Security filters used in Spring Security? (Choose three.)

  • A. To drive authentication.
  • B. To encrypt data.
  • C. To provide a logout capability.
  • D. To provide risk governance.
  • E. To enforce authorization (access control).
  • F. To manage application users.

正解:A、C、E

解説:
Spring Security uses a filter-based architecture to provide security services for web applications. A filter is an object that intercepts HTTP requests and responses and performs some logic before or after the request is processed by the servlet. Spring Security provides a number of filters for different purposes, such as:
Authentication: Filters that handle the authentication process, such as UsernamePasswordAuthenticationFilter, BasicAuthenticationFilter, RememberMeAuthenticationFilter, etc.
User management: Filters that manage the user details and roles, such as SecurityContextPersistenceFilter, AnonymousAuthenticationFilter, ConcurrentSessionFilter, etc.
Logout: Filters that handle the logout process, such as LogoutFilter and SecurityContextLogoutHandler.
Authorization: Filters that enforce access control rules based on the user's authentication and roles, such as FilterSecurityInterceptor, ExceptionTranslationFilter, etc.


質問 # 38
Refer to the exhibit.

Which two methods will be implemented at runtime if declared in a Spring Data JPA Repository? (Choose two.)

  • A. public Customer findCustomerByName(String name);
  • B. public Customer findFirstByOrderDateBetween(Date d1, Date d2);
  • C. public Customer findByEmail(String email);
  • D. public Customer findFirstOrderDateMax();
  • E. public Customer getsingle(Long id);

正解:B、C


質問 # 39
Which following statements are true about Spring Data? (Choose two.)

  • A. Spring Data is specifically designed for JPA, JDBC, and relational database access only.
  • B. Spring Data works by applying the JPA annotations to data stores such as MongoDB, Neo4j, and Redis.
  • C. Spring Data implementations exist for many data storage types, such as MongoDB, Neo4j, and Redis.
  • D. Spring Data cannot be used together with Spring MVC.
  • E. Spring Data can greatly reduce the amount of "boilerplate" code typically needed for data access.

正解:C、E

解説:
Spring Data MongoDB https://spring.io/projects/spring-data-mongodb . Spring Data Neo4j https://spring.io/projects/spring-data-neo4j Spring Data Redis https://spring.io/projects/spring-data-redis For example: Spring Data Envers Optional<T> findById(ID primaryKey);


質問 # 40
Refer to the exhibit.

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

  • A. clientService (starting with lowercase "c")
  • B. clientServiceImpl (starting with lowercase "c")
  • C. clientServiceImpl (starting with uppercase "C")
  • D. ClientService (starting with uppercase "C")

正解:D


質問 # 41
What are the two reasons Spring be used to build a Java application? (Choose two.)

  • A. Spring automates deployment of Java applications to all of the major cloud providers.
  • B. Spring provides comprehensive Java IDE support.
  • C. Spring provides abstractions over infrastructure such as persistence and messaging.
  • D. Spring automates a Java application build.
  • E. Spring provides a Dependency Injection container.

正解:C、E

解説:
B . Spring provides a Dependency Injection container. True. One of the core features of Spring is its powerful Dependency Injection (DI) container, which helps manage the lifecycle and dependencies of the application's components. E. Spring provides abstractions over infrastructure such as persistence and messaging. True. Spring provides a range of abstractions over various infrastructure concerns, such as persistence (with Spring Data and JPA), messaging (with Spring JMS and Spring AMQP), transaction management, and more. These abstractions simplify and unify the way developers interact with these systems.


質問 # 42
Refer to the exhibit.

Which option is a valid way to retrieve the account id? (Choose the best answer.)

  • A. Add @RequestParam long accountId argument to the update() handler method.
  • B. Add @PathVariable("id") String accountId argument to the update() handler method.
  • C. Add @PathVariable long accountId argument to the update() handler method.
  • D. Add @RequestParam("id") String accountId argument to the update() handler method.

正解:C


質問 # 43
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 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.
  • C. @ActiveProfiles is a class-level annotation that you can use to configure how the Spring TestContext Framework is bootstrapped.
  • 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.

正解:D

解説:
A bean definition profile is a named logical grouping of bean definitions that can be activated or deactivated in different environments. For example, we can define different profiles for development, testing, and production environments. Spring provides the @Profile annotation to mark a bean definition or a configuration class as belonging to a specific profile. To activate a profile, we can use the spring.profiles.active property or the ConfigurableEnvironment.setActiveProfiles() method.
The @ActiveProfiles annotation is a class-level annotation that is used in conjunction with the Spring TestContext Framework to declare which profiles should be active when loading an ApplicationContext for an integration test. This annotation can be applied to any class annotated with @ContextConfiguration or a meta-annotation that is composed of @ContextConfiguration.


質問 # 44
Which two options are REST principles? (Choose two.)

  • A. RESTful application use HTTP headers and status codes as a contract with the clients.
  • B. RESTful applications cannot use caching.
  • C. RESTful application servers keep track of the client state.
  • D. RESTful applications use a stateless architecture.
  • E. RESTful applications favor tight coupling between the clients and the servers.

正解:A、D

解説:
REST stands for Representational State Transfer, which is an architectural style for designing web services that adhere to certain principles. One of these principles is statelessness, which means that each request from a client to a server must contain all the information necessary to understand the request, and that no session state is maintained on the server side. Another principle is uniform interface, which means that clients and servers communicate using a standardized protocol, such as HTTP, and use its features, such as headers and status codes, to exchange information about the resources and their representations.


質問 # 45
Which two statements about BeanFactoryPostProcessors are true? (Choose two.)

  • A. Creates proxies for the Spring beans that require an extra behavior like transaction management.
  • B. Detects annotations such as @PostConstruct and @PreDestroy and then invokes appropriate behavior.
  • C. Allows for the transformation of Spring bean definitions before the beans are instantiated.
  • D. PropertySourcesPlaceholderConfigurer implements BeanFactoryPostProcessor and is used to read property values from the Spring Environment.
  • E. Allows for the transformation of Spring bean definitions after the beans have been instantiated.

正解:C、D

解説:
(1) BeanFactoryPostProcessor (Spring Framework 6.1.3 API). https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/beans/factory/config/BeanFactoryPostProcessor.html. (2) Spring BeanPostProcessor | Baeldung. https://www.baeldung.com/spring-beanpostprocessor. (3) BeanFactoryPostProcessor - Spring | Home. https://docs.spring.io/spring-framework/docs/3.0.x/javadoc-api/org/springframework/beans/factory/config/BeanFactoryPostProcessor.html. (4) BeanFactoryPostProcessor (Spring Framework API 2.5). https://docs.spring.io/spring-framework/docs/2.5.x/javadoc-api/org/springframework/beans/factory/config/BeanFactoryPostProcessor.html. (5) Spring BeanPostProcessor Example - HowToDoInJava. https://howtodoinjava.com/spring-core/spring-bean-post-processors/


質問 # 46
Which two statements are true regarding @WebMvcTest? (Choose two.)

  • A. Typically it is used in combination with @MockBean when there is a dependency bean to be mocked.
  • B. It will only scan for @Controller beans in the source code.
  • C. It is typically used with @ExtendWith(MockitoExtension.class) in JUnit 5.
  • D. It is used for testing Spring MVC components such as @Controller with a running server.
  • E. It auto-configures a MockMvc.

正解:A、E


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

  • A. Passwords must be hashed and the default hashing algorithm is MD5.
  • B. User details can be stored in custom storage and retrieve them by implementing the UserDetailsService interface.
  • C. User details can be stored in a database, in LDAP, or in-memory.
  • D. The user details includes username and password but not authorities.
  • E. With a custom UserDetailsService defined in the ApplicationContext, Spring Boot still creates the default user.

正解:B、C


質問 # 48
If a class is annotated with @Component, what should be done to have Spring automatically detect the annotated class and load it as a bean? (Choose the best answer.)

  • A. Ensure a valid @Bean for the class is specified.
  • B. Ensure a valid bean name in the @Component annotation is specified.
  • C. Ensure a valid @ComponentScan annotation in the Java configuration is specified.
  • D. Ensure a valid @Scope for the class is specified.

正解:B


質問 # 49
Which two options will inject the value of the daily.limit system property? (Choose two.)

  • A. @Value("#{systemProperties['daily.limit']}")
  • B. @Value("#{systemProperties.daily.limit}")
  • C. @Value("$(systemProperties.daily.limit)")
  • D. @Value("$(daily.limit)")
  • E. @Value("#{daily.limit}")

正解:A、D

解説:
The @Value annotation can be used to inject values from external sources into fields, constructor parameters, or method parameters. To inject a system property, the annotation can use either the ${...} placeholder syntax or the #{...} SpEL expression syntax. The former is simpler and more concise, while the latter is more powerful and flexible. Both syntaxes can access the systemProperties map, which contains all the system properties as key-value pairs.


質問 # 50
Which two options are REST principles? (Choose two.)

  • A. RESTful application use HTTP headers and status codes as a contract with the clients.
  • B. RESTful applications cannot use caching.
  • C. RESTful application servers keep track of the client state.
  • D. RESTful applications use a stateless architecture.
  • E. RESTful applications favor tight coupling between the clients and the servers.

正解:A、D


質問 # 51
Which three statements are advantages of using Spring's Dependency Injection? (Choose three.)

  • A. Dependencies between application components can be managed external to the components.
  • B. Dependency injection creates tight coupling between components.
  • C. Configuration can be externalized and centralized in a small set of files.
  • D. Dependency injection can make code easier to trace because it couples behavior with construction.
  • E. Dependency injection reduces the start-up time of an application.
  • F. Dependency injection facilitates loose coupling between components.

正解:A、C、F

解説:
C . Dependencies between application components can be managed external to the components.
This is true because dependency injection allows the application components to declare their dependencies without creating or obtaining them directly. Instead, the dependencies are provided by an external entity, such as the Spring container, which can read the configuration from XML files, annotations, or Java code1.
D . Configuration can be externalized and centralized in a small set of files.
This is true because dependency injection enables the separation of concerns between the application logic and the configuration. The configuration can be stored in a small number of files that can be easily changed without affecting the source code2.
F . Dependency injection facilitates loose coupling between components.
This is true because dependency injection reduces the direct dependencies between components, making them more reusable and testable. It also allows for easier substitution of different implementations of the same interface3.


質問 # 52
Which option is true about use of mocks in a Spring Boot web slice test? (Choose the best answer.)

  • A. Mocking a Spring Bean requires annotating it with @MockBean annotation.
  • B. If a Spring Bean already exists in the web slice test spring context, it cannot be mocked.
  • C. Mocking a Spring Bean requires annotating it with @Mock annotation.
  • D. Mocks cannot be used in a Spring Boot web slice test.

正解:A

解説:
A web slice test is a type of test in Spring Boot that focuses on testing only the web layer of an application, without starting a full server or requiring a real database. To isolate the web layer from other dependencies, such as services or repositories, mocks can be used to simulate their behavior and return predefined responses. To create and inject a mock for an existing bean in the application context, the @MockBean annotation can be used on a field or a parameter in the test class. This annotation will replace any existing bean of the same type with a mock created by Mockito.


質問 # 53
Which two statements are correct regarding the Actuator loggers endpoint? (Choose two.)

  • A. An application restart is required to change the logging level of the package.
  • B. To get a logging level of a package called account.web, you can access the /actuator/loggers/account.web endpoint.
  • C. In order to use the loggers endpoint, a logger implementation dependency needs to be added.
  • D. The logging levels of a package that can be accessed via the loggers endpoint include configuredLevel and effectiveLevel.

正解:B、D


質問 # 54
......

実際問題を使って2V0-72.22問題集で100%無料2V0-72.22試験問題集:https://www.jpntest.com/shiken/2V0-72.22-mondaishu

実際に出ると確認されたの2V0-72.22試験問題集と解答で2V0-72.22無料更新:https://drive.google.com/open?id=1D5htbaPkZbQ83CF-1oCCH9QEyfJvfqm1

弊社を連絡する

我々は12時間以内ですべてのお問い合わせを答えます。

オンラインサポート時間:( UTC+9 ) 9:00-24:00
月曜日から土曜日まで

サポート:現在連絡