Which statement describes the @AfterReturning advice type? (Choose the best answer.)

Which statement describes the @AfterReturning advice type? (Choose the best answer.)
A . The advice is invoked only if the method returns successfully but not if it throws an exception.
B . The @AfterReturning advice allows behavior to be added after a method returns even if it throws an exception.
C . The advice has complete control over the method invocation; it could even prevent the method from being called at all.
D . Typically used to prevent any exception, thrown by the advised method, from propagating up the call-stack.

Answer: A

Explanation:

Reference: https://www.amitph.com/spring-aop-afterreturning-advice

Which two statements are true regarding Spring Boot Testing? (Choose two.)

Which two statements are true regarding Spring Boot Testing? (Choose two.)
A . @TestApplicationContext is used to define additional beans or customizations for a test.
B . Test methods in a @SpringBootTest class are transactional by default.
C . @SpringBootTest is typically used for integration testing.
D . Test methods annotated with @SpringBootTest will recreate the ApplicationContext.
E . @SpringBootTest without any configuration classes expects there is only one class annotated [email protected] in the application.

Answer: C,D

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

What are the two reasons Spring be used to build a Java application? (Choose two.)
A . Spring automates a Java application build.
B . Spring provides a Dependency Injection container.
C . Spring automates deployment of Java applications to all of the major cloud providers.
D . Spring provides comprehensive Java IDE support.
E . Spring provides abstractions over infrastructure such as persistence and messaging.

Answer: A,B

Explanation:

Reference: https://spring.io/why-spring

How can a response status code be set for No Content (204)?

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

Explanation:

Reference: https://stackoverflow.com/questions/55691288/is-this-the-correct-way-to-return-204-no-content- using-spring

Which statement defines a pointcut? (Choose the best answer.)

Which statement defines a pointcut? (Choose the best answer.)
A . A point in the execution of a program such as a method call or field assignment.
B . An expression that selects one or more join points.
C . A module that encapsulated advices.
D . Code to be executed at each selected join point.

Answer: B

Explanation:

Reference: https://www.baeldung.com/spring-aop-pointcut-tutorial

Which three statements are advantages of using Spring’s Dependency Injection? (Choose three.)

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: B,D,E

Explanation:

Reference: https://raviroza.com/tight-coupling-and-loose-coupling-in-spring-framework/

Which two statements describe Spring JdbcTemplate? (Choose two.)

Which two statements describe Spring JdbcTemplate? (Choose two.)
A . All JdbcTemplate methods throw SQLException which you are required to handle.
B . The JdbcTemplate provides the ability to work with result sets.
C . The JdbcTemplate can only perform update but not insert to the database.
D . The JdbcTemplate provides methods for query execution.
E . The JdbcTemplate generates SQL statements.

Answer: B,E

Explanation:

Reference: https://www.baeldung.com/spring-jdbctemplate-in-list

Which two statements are true regarding bean creation? (Choose two.)

Which two statements are true regarding bean creation? (Choose two.)
A . A Spring bean can be explicitly created by annotating methods or fields by @Autowired.
B . A Spring bean can be implicitly created by annotating the class with @Component and using the component-scanner to scan its package.
C . A Spring bean can be implicitly created by annotating the class with @Bean and using the component- scanner to scan its package.
D . A Spring bean can be explicitly created using @Bean annotated methods within a Spring configuration class.
E . A Spring bean can be explicitly created by annotating the class with @Autowired.

Answer: B,E

Explanation:

Reference:

https://docs.spring.io/spring-framework/docs/3.0.0.M4/spring-framework-reference/html/ch03s10.html

https://howtodoinjava.com/spring-core/spring-beans-autowiring-concepts/

Which two statements are correct regarding Spring Boot 2.x Actuator Metrics? (Choose two.)

Which two statements are correct regarding Spring Boot 2.x Actuator Metrics? (Choose two.)
A . An external monitoring system must be used with Actuator.
B . The metrics endpoint /actuator/metrics is exposed over HTTP by default.
C . Timer measures both the number of timed events and the total time of all events timed.
D . Custom metrics can be measured using Meter primitives such as Counter, Gauge, Timer, and Distribution Summary.
E . A metric must be created with one or more tags.

Answer: A,B