Weekend Special Sale Limited Time 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: buysanta

Exact2Pass Menu

Question # 4

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

Full Access
Question # 5

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.

Full Access
Question # 6

Refer to the exhibit.

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

A.

Add @PathVariable(“id”) String accountId argument to the update() handler method.

B.

Add @PathVariable long accountId argument to the update() handler method.

C.

Add @RequestParam long accountId argument to the update() handler method.

D.

Add @RequestParam(“id”) String accountId argument to the update() handler method.

Full Access
Question # 7

Which two options are REST principles? (Choose two.)

A.

RESTful applications use a stateless architecture.

B.

RESTful application use HTTP headers and status codes as a contract with the clients.

C.

RESTful applications cannot use caching.

D.

RESTful application servers keep track of the client state.

E.

RESTful applications favor tight coupling between the clients and the servers.

Full Access
Question # 8

Which is the correct approach to register for a bean destruction callback?

A.

Annotate the callback method with @PostDestroy.

B.

Annotate the callback method with @PreDestroy.

C.

Add the @Lazy annotation to the bean configuration.

D.

Configure the bean instance to use prototype scope.

Full Access
Question # 9

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.

Mocks cannot be used in a Spring Boot web slice test.

D.

Mocking a Spring Bean requires annotating it with @Mock annotation.

Full Access
Question # 10

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.

Full Access
Question # 11

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.

Full Access
Question # 12

Which two statements are true concerning constructor injection? (Choose two.)

A.

If there is only one constructor the @Autowired annotation is not required.

B.

Constructor injection only allows one value to be injected.

C.

Constructor injection is preferred over field injection to support unit testing.

D.

Construction injection can be used with multiple constructors without @Autowired annotation.

E.

Field injection is preferred over constructor injection from a unit testing standpoint.

Full Access
Question # 13

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

Full Access
Question # 14

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”)

Full Access
Question # 15

Which two statements are correct regarding the differences between @ConfigurationProperties and @Value? (Choose two.)

A.

@Value must be used for environment variables, as @ConfigurationProperties cannot access the environment.

B.

@Value supports relaxed binding of properties, but not property binding through SpEL.

C.

@ConfigurationProperties is preferable over @Value when type-safety during property binding is a concern.

D.

@ConfigurationProperties only bind properties from .properties files, not from .yml files.

E.

@ConfigurationProperties supports relaxed binding of properties, but not property binding through SpEL.

Full Access
Question # 16

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.

Full Access
Question # 17

Which two statements are correct regarding the Health Indicator status? (Choose two.)

A.

The last status in a sorted list of HealthIndicators is used to derive the final system health.

B.

The status with the least severity is used as the top-level status.

C.

Custom status values can be created.

D.

The built-in status values are DOWN, OUT_OF_SERVICE, UNKNOWN, and UP in decreasing order of severity.

E.

The severity order cannot be changed due to security reasons.

Full Access
Question # 18

Which strategy is correct for configuring Spring Security to intercept particular URLs? (Choose the best answer.)

A.

The URLs can be specified via configuration (using authorizeRequests () and request matchers), with the most specific rule first and the least specific last.

B.

Spring Security can obtain URLs from Spring MVC controllers, the Spring Security configuration just needs a reference to the controller to be protected.

C.

The URLs are specified in a special properties file, used by Spring Security.

D.

The URLs can be specified via configuration (using authorizeRequests () and request matchers), with the least specific rule first and the most specific last.

Full Access
Question # 19

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.

Full Access
Question # 20

Which two statements are correct regarding the Actuator loggers endpoint? (Choose two.)

A.

To get a logging level of a package called account.web, you can access the /actuator/loggers/account.web endpoint.

B.

An application restart is required to change the logging level of the package.

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.

Full Access
Question # 21

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 getsingle(Long id);

B.

public Customer findFirstOrderDateMax();

C.

public Customer findByEmail(String email);

D.

public Customer findFirstByOrderDateBetween(Date d1, Date d2);

E.

public Customer findCustomerByName(String name);

Full Access
Question # 22

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

A.

It auto-configures a MockMvc.

B.

It will only scan for @Controller beans in the source code.

C.

It is used for testing Spring MVC components such as @Controller with a running server.

D.

Typically it is used in combination with @MockBean when there is a dependency bean to be mocked.

E.

It is typically used with @ExtendWith(MockitoExtension.class) in JUnit 5.

Full Access
Question # 23

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.

Full Access